安装subversion1.8和apache
一.安装apr和apr-uti
wget http://mirror.bit.edu.cn/apache//apr/apr-1.4.8.tar.gztar zxvf apr-1.4.8.tar.gzcd apr-1.4.8./configure --prefix=/usr/local/aprmake && make install
wget http://mirrors.cnnic.cn/apache/apr/apr-util-1.5.2.tar.gztar zxvf apr-util-1.5.2.tar.gzcd apr-util-1.5.2./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/make && make install
wget http://www.sqlite.org/2013/sqlite-autoconf-3080000.tar.gztar zxvf sqlite-autoconf-3080000.tar.gzcd sqlite-autoconf-3080000./configure make && make install
wget http://www.openssl.org/source/openssl-1.0.1.tar.gztar xzvf openssl-1.0.1.tar.gzcd openssl-1.0.1./config --prefix=/usr/local/opensslmake && make install
wget http://mirrors.cnnic.cn/apache//httpd/httpd-2.2.25.tar.gztar zxvf httpd-2.2.25.tar.gzexport LDFLAGS=-ldlcd httpd-2.2.25./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr-util/bin/apu-1-config --enable-modules=so --enable-dav --enable-maintainer-mode --enable-rewrite --enable-ssl --with-ssl=/usr/local/opensslmake && make install
cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd#编辑/etc/init.d/httpd,在第二行增加如下内容#chkconfig: 2345 85 35chkconfig httpd on
wget http://jaist.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gztar -xvzf zlib-1.2.8.tar.gzcd zlib-1.2.8./configuremake && make install
wget http://mirror.esocc.com/apache/subversion/subversion-1.8.4.tar.gztar zxvf subversion-1.8.4.tar.gzmkdir -p ./subversion-1.8.4/sqlite-amalgamationcp ./sqlite-autoconf-3080000/sqlite3.c ./subversion-1.8.4/sqlite-amalgamationcd subversion-1.8.4./configure --prefix=/opt/svn/subversion --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr-util/bin/apu-1-config --with-zlib --enable-maintainer-modemake && make install
cp /opt/svn/subversion/libexec/mod_authz_svn.so /usr/local/apache2/modules/cp /opt/svn/subversion/libexec/mod_dav_svn.so /usr/local/apache2/modules/
#加载整合svn所需so文件LoadModule dav_svn_module modules/mod_dav_svn.soLoadModule authz_svn_module modules/mod_authz_svn.so<Location /> DAV svn SVNParentPath /opt/svn/data/ #svn 根目录 SVNListParentPath On SVNAutoversioning On SVNReposName "svn" AuthzSVNAccessFile /opt/svn/subversion/conf/authz.conf #目录分组权限 AuthType Basic AuthName "Subversion repository" AuthUserFile /opt/svn/subversion/conf/passwd.conf #密码验证文件 Require valid-user</Location>
mkdir -p /opt/svn/data/repos
svnadmin create /opt/svn/data/repos
chown -R daemon /opt/svn/data/reposchmod -R 755 /opt/svn/data/repos
/usr/local/apache2/bin/htpasswd -c /opt/svn/subversion/conf/passwd.conf username
/usr/local/apache2/bin/htpasswd /opt/svn/subversion/conf/passwd.conf username1
[groups] #<groupname1>=<username1>,<username2> admin=username #[<versionLib>:projectName/directory] #@<groupsname>=<authorities> #<username>=<authorities> [/] @admin = rw #指定用户组成员可以读写根目录所有应用 [repos:/abc/aaa] username1= rw #指定用户username1可以读写:/abc/aaa目录的文件
/usr/local/apache2/bin/apachectl start
wget http://www.webdav.org/neon/neon-0.29.6.tar.gztar zxvf neon-0.29.6.tar.gzcd neon-0.29.6./configure --prefix=/usr/local/neonmake && make install
#128位rsa算法生成密钥[root@SVN-SERVER ~]# openssl genrsa 1024 > server.keyGenerating RSA private key, 1024 bit long modulus.....++++++......++++++e is 65537 (0x10001)
[root@SVN-SERVER ~]# openssl req -new -key server.key > server.csrYou are about to be asked to enter information that will be incorporatedinto your certificate request.What you are about to enter is what is called a Distinguished Name or a DN.There are quite a few fields but you can leave some blankFor some fields there will be a default value,If you enter '.', the field will be left blank.-----Country Name (2 letter code) [XX]:CNState or Province Name (full name) []:beijingLocality Name (eg, city) [Default City]:beijingOrganization Name (eg, company) [Default Company Ltd]:noneOrganizational Unit Name (eg, section) []:Common Name (eg, your name or your server's hostname) []:SVN-SERVEREmail Address []:Please enter the following 'extra' attributesto be sent with your certificate requestA challenge password []:An optional company name []:
openssl req -x509 -days 365 -key server.key -in server.csr > server.crt
cp ./server.crt /usr/local/apache2/confcp ./server.key /usr/local/apache2/conf
Include conf/extra/httpd-ssl.conf
cd /usr/local/apache2/conf/extra vim httpd-ssl.confSSLCertificateFile "/usr/local/apache2/conf/server.crt"SSLCertificateKeyFile "/usr/local/apache2/conf/server.key"
SSLRequireSSL