以下为svn安装与迁移,迁移非常简单直接copy库文件就ok。
#安装subversion前,须安装apr和apr-util才能正常工作,系统默认情况下,是已经有apr和apr-util这两个包的,但版本较低,仅支持subversion 1.4
- mkdir /root/svn
- cd /root/svn
- rpm -e –nodeps apr apr-util
- wget http://archive.apache.org/dist/apr/apr-1.4.6.tar.gz
- wget http://archive.apache.org/dist/apr/apr-util-1.4.1.tar.gz
- tar xzf apr-1.4.6.tar.gz
- tar xzf apr-util-1.4.1.tar.gz
- cd apr-1.4.6
- ./configure –prefix=/usr/local/apr
- make && make install
- cd ../apr-util-1.4.1
- ./configure –with-apr=/usr/local/apr
- make && make install
- cd ../
- wget http://www.apache.org/dist//httpd/httpd-2.2.22.tar.gz
- tar xzf httpd-2.2.22.tar.gz
- cd httpd-2.2.22
- ./configure –prefix=/usr/local/apache –enable-so –enable-ssl
- –enable-rewrite –with-mpm=worker –enable-headers –enable-deflate
- –enable-dav –with-apr=/usr/local/apr/bin/apr-1-config
- –with-apr-util=/usr/local/apr/bin/apu-1-config -enable-maintainer-mode
- make && make install
- cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
- sed -i ‘2a # chkconfig: – 85 15’ /etc/init.d/httpd
- sed -i ‘3a # description: Apache server’ /etc/init.d/httpd
- chmod 755 /etc/init.d/httpd
- chkconfig –add httpd
- chkconfig httpd on
- cd ../
- wget http://labs.renren.com/apache-mirror/subversion/subversion-1.7.3.tar.gz
- tar xzf subversion-1.7.3.tar.gz
- cd subversion-1.7.3
- ./configure –prefix=/usr/local/subversion –with-apxs=/usr/local/apache/bin/apxs –with-apr=/usr/local/apr/bin/apr-1-config –with-apr-util=/usr/local/apr/bin/apu-1-config –with-ssl –with-zlib –without-berkeley-db –enable-maintainer-mode
#报错如下
- checking sqlite library version (via header)… unsupported SQLite version
- checking sqlite library version (via pkg-config)… none or unsupported 3.3
- no
- An appropriate version of sqlite could not be found. We recommmend
- 3.7.6.3, but require at least 3.6.18.
- Please either install a newer sqlite on this system
- or
- get the sqlite 3.7.6.3 amalgamation from:
- http://www.sqlite.org/sqlite-amalgamation-3.7.6.3.tar.gz
- unpack the archive using tar/gunzip and copy sqlite3.c from the
- resulting directory to:
- /root/svn/subversion-1.7.3/sqlite-amalgamation/sqlite3.c
- configure: error: Subversion requires SQLite
#解决方法:根据报错提示
- cd ../
- wget http://www.sqlite.org/sqlite-autoconf-3071000.tar.gz
- mkdir subversion-1.7.3/sqlite-amalgamation
- tar xzf sqlite-autoconf-3071000.tar.gz
- cp sqlite-autoconf-3071000/sqlite3.c subversion-1.7.3/sqlite-amalgamation/
- cd subversion-1.7.3
重新编译,可以忽略DBD警告
- ./configure –prefix=/usr/local/subversion \
- –with-apxs=/usr/local/apache/bin/apxs –with-apr=/usr/local/apr/bin/apr-1-config \
- –with-apr-util=/usr/local/apr/bin/apu-1-config –with-ssl –with-zlib –enable-maintainer-mode
- make && make install
配置subversion
1. 复制账号密码、权限认证文件
将账号密码(svn_auth_file)、权限认证(svn_access)复制到/data/svn/目录下
2.修改账号密码文件
复制过来的svn_auth_file密码都是明文应用/usr/local/apache2/bin/htpasswd /data/svn/svn_auth_file admin,不加密可能不能正常登陆。
3.复制资料库
将import、repository复制到/data/svn/目录下
配置apache的httpd.conf
修改apache下的httpd.conf最后增加以下内容。
- LoadModule dav_svn_module modules/mod_dav_svn.so
- LoadModule authz_svn_module modules/mod_authz_svn.so
- <Location /svn>
- DAV svn
- SVNParentPath /data/svn/repository
- AuthType Basic
- AuthName “Subversion repository”
- AuthUserFile /data/svn/svn_auth_file
- AuthzSVNAccessFile “/data/svn/svn_access”
- Require valid-user
- </Location>
验证
- /usr/local/apache/bin/apachectl –t
- Service apache restart
访问:http://192.168.1.110/svn/mjm_repo