1.安装所需软件包
yum -y install subversion subversion-devel httpd mod_dav_svn apr-devel apr-until-devel neon-devel
2.下载安装pysvn
wget http://pysvn.barrys-emacs.org/source_kits/pysvn-1.7.5.tar.gz
[root@submin ~]# tar zxf pysvn-1.7.5.tar.gz
[root@submin ~]# cd pysvn-1.7.2/Source/
[root@submin Source]# python setup.py backport
#python2.6版本以下要执行
[root@submin Source]# python setup.py configure
[root@submin Source]# make
[root@submin Source]# cd ../Tests/
[root@submin Tests]# make
[root@submin Tests]# ../Source/
[root@submin Source]# mkdir /usr/lib/python2.4/site-packages/pysvn
[root@submin Source]# cp pysvn/* /usr/lib/python2.4/site-packages/pysvn/
简单测试pysvn
[root@submin ~]# python
Python 2.4.3 (#1, Sep 3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysvn
如果提示错误,说明pysvn安装成功。
3.安装配置submin
wget http://supermind.nl/submin/current/submin-1.2.11.tar.gz
[root@submin ~]# tar zxf submin-1.2.11.tar.gz
[root@submin ~]# cd submin-1.2.11
[root@submin submin-1.2.11]# python bin/install.py /usr/local/
[root@web submin-1.2.11]# /usr/local/bin/submin-admin create default
Apache files created:
/etc/submin/default-apache-wsgi.conf
/etc/submin/default-apache-cgi.conf
Please include one of these in your apache config. Also make sure that
you have mod_dav_svn and mod_authz_svn enabled.
Created submin configuration with default user admin (password: admin)
提示创建/etc/submin创建了apache配置文件,submin默认用户和密码都是admin
将生成的default-apache-cgi.conf文件连接到httpd配置文件目录下的conf.d,这样这个配置自动加载入httpd.conf中
[root@submin ~]# ln -s /etc/submin/default-apache-cgi.conf /etc/httpd/conf.d/submin.conf
创建svn根目录
[root@submin ~]# mkdir -p /data/svn
[root@submin ~]# cd /data/svn/
[root@submin svn]# cp /var/lib/submin/authz .
[root@submin svn]# cp /var/lib/submin/htpasswd .
[root@submin svn]# cp /var/lib/submin/userproperties.conf .
[root@submin svn]# rm -rf /var/lib/submin/svn/
[root@submin svn]# ln -s /data/svn /var/lib/submin/svn
修改权限
[root@submin ~]# chown -R apache:apache /data/svn
修改default.conf,svn认证文件及目录与创建的相同
[root@submin ~]# vim /etc/submin/default.conf
- [svn]
- authz_file = /data/svn/authz
- userprop_file = /data/svn/userproperties.conf
- access_file = /data/svn/htpasswd
- repositories = /data/svn
- [www]
- base_url = /submin
- svn_base_url = /svn
- trac_base_url = /trac #加入行
修改submin.conf,svn认证文件及目录与创建的相同
[root@submin ~]# vim /etc/httpd/conf.d/submin.conf
- <Location /svn>
- DAV svn
- SVNParentPath /data/svn
- AuthType Basic
- AuthName "Subversion repository"
- AuthUserFile /data/svn/htpasswd
- AuthzSVNAccessFile /data/svn/authz
- Satisfy Any
- Require valid-user
- Location>
[root@submin ~]# /etc/init.d/httpd start
主要修改:
1. /etc/submin/default.conf和/etc/httpd/conf.d/submin.conf,让2个配置文件的目录和认证文件指向同一个文件(/data/svn).另外就是/etc/httpd/conf.d/subversion.conf中不需要对svn目录认证
2. submin的svn目录指向svn的目录