目的:转移Windows上SVN服务器到Linux,支持简单用户认证(怎么支持Linux系统用户的httpd认证,以方便用户自己维护密码?),支持SSL加密协议
google搜索svn server优先显示"Apache Subversion"-----Enterprise-class centralized version control for the masses,网上安装教程比较丰富
1:安装apache subversion及依赖包
1.1 获取装apache subversion源码
wget -c
tar xjf subversion-1.7.5.tar.bz2
cd subversion-1.7.5
[wenjing@CentOS6 subversion-1.7.5]$ cat INSTALL | grep "REQUIRED"
* libapr and libapr-util (REQUIRED for client and server)
* SQLite (REQUIRED for client and server)
* libz (REQUIRED for client and server)
1. Apache Portable Runtime 0.9.7 or 1.X.X (REQUIRED)
2. Zlib (REQUIRED)
13. SQLite (REQUIRED)
主要精读INSTALL文档,因为一个较完善的SVN服务器依赖较多其他插件,这里主要是httpd/apr/apr-util,按照INSTALL顺序应该先安装强制依赖包
1.2 安装依赖包
apr/apr-util/libtool/neon等安装过程略,因为这里已经安装完毕所以可以查到相关依赖包版本信息
[root@centos6 ~]# rpm -qa "apr*"
apr-util-1.3.9-3.el6_0.1.i686
apr-util-devel-1.3.9-3.el6_0.1.i686
apr-util-ldap-1.3.9-3.el6_0.1.i686
apr-1.3.9-3.el6_0.1.i686
apr-devel-1.3.9-3.el6_0.1.i686
[root@centos6 ~]#
[root@centos6 ~]#
[root@centos6 ~]# rpm -qa "libtool*"
libtool-2.2.6-15.5.el6.i686
libtool-ltdl-2.2.6-15.5.el6.i686
[root@centos6 ~]#
[root@centos6 ~]#
[root@centos6 ~]#
[root@centos6 ~]# rpm -qa "neon*"
neon-0.29.3-1.2.el6.i686
[root@centos6 ~]#
[root@centos6 ~]#
[root@centos6 ~]# rpm -qa "autoconf*"
autoconf-2.63-5.1.el6.noarch
[root@centos6 ~]#
[root@centos6 ~]#
[root@centos6 ~]#
[root@centos6 ~]# rpm -qa "sqlite*"
sqlite-3.6.20-1.el6.i686
sqlite-devel-3.6.20-1.el6.i686
[root@centos6 ~]#
[root@centos6 ~]#
[root@centos6 ~]#
[root@centos6 ~]# rpm -qa "openssl*"
openssl-1.0.0-4.el6_0.2.i686
openssl098e-0.9.8e-17.el6.centos.i686
openssl-devel-1.0.0-4.el6_0.2.i686
1.3 安装依赖包Apache Httpd
wget
tar httpd-2.4.2.tar.bz2
cd httpd-2.4.2
./configure --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr --enable-dav --enable-so --enable-maintainer-mode --enable-ssl --enable-deflate --enable-so
make
make instal
1.4 安装apache subersion
确定依赖包都安装完毕,可以再返回到subersion-1.7.5源码目录
cd subversion-1.7.5
./configure --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr --with-apxs=/usr/local/apache2/bin/apxs --with-neon=/usr/lib --with-apache-libexecdir=/usr/local/apache2/modules
make
make install
1.5 SVN代码迁移
备份windows svn服务器的代码版本库
svnadmin dump d:/svndata > d:\svnbak\svnbak20120721.dump
linux的svn代码库为:/opt/.svn/svn
加载已经备份的代码库
svnadmin load /opt/.svn/svn < ~/WIN/svnbak20120721.dump
2: Apache Httpd
详细配置步骤还请参见subversion源码下的INSTALL文件
2.1 Apache Httpd简单用户验证配置/SIMPLE Authentication and Authorization
please refer to
Will add following section for Httpd config file /usr/local/apache2/conf/httpd.conf
AuthType Basic
AuthName "Restricted Files"
# (Following line optional)
AuthBasicProvider file
AuthUserFile /usr/local/apache2/passwd/passwords
AuthGroupFile /usr/local/apache2/passwd/groups
Require group group_name_1 group_name_2
#Require user user_name_1 user_name_2
</Location>
2.2 Apache Httpd支持SSL
How To Install Apache 2 with SSL on Linux (with mod_ssl, openssl)
please refer to
or
3: 验证测试及部分文件摘录
3.1 启动步骤
/usr/local/apache2/bin/apachectl start
Apache/2.4.2 mod_ssl (Pass Phrase Dialog)
Some of your private key files are encrypted for security reasons.
In order to read them you have to provide the pass phrases.
Server :443 (RSA)
Enter pass phrase:
OK: Pass Phrase Dialog successful.
[root@centos6 ~]# ps -ef | grep "httpd"
root 32400 1 0 Jul23 ? 00:00:00 /usr/local/apache2/bin/httpd -k start
daemon 32401 32400 0 Jul23 ? 00:00:00 /usr/local/apache2/bin/httpd -k start
daemon 32402 32400 0 Jul23 ? 00:00:00 /usr/local/apache2/bin/httpd -k start
daemon 32403 32400 0 Jul23 ? 00:00:00 /usr/local/apache2/bin/httpd -k start
daemon 32404 32400 0 Jul23 ? 00:00:00 /usr/local/apache2/bin/httpd -k start
daemon 32495 32400 0 Jul23 ? 00:00:00 /usr/local/apache2/bin/httpd -k start
root 32679 32655 0 08:43 pts/1 00:00:00 grep httpd
3.2 svn客户端版本信息
[wenjing@centos6 ~]$ svn --version
svn, version 1.7.5 (r1336830)
compiled Jul 23 2012, 11:01:51