最近需要配置svn服务器。在网上找了一下,选择Apache,Subversion和Trac。
首先准备系统光盘。因为是Linux操作系统,所以准备好系统能节省一些时间,比如python-devel。但是httpd,subversion和trac还是下载源码编译吧。
下载软件包:
Genshi-0.5.1 (required by Trac-0.11.6)
Trac-0.11.6
apr-1.3.9
apr-util-1.3.9
clearsilver-0.10.5 (required by Trac-0.11.6)
httpd-2.2.14
mod_python-3.3.1
subversion-1.6.1
1. 安装Apache
$ ./configure --enable-dav --enable-so --enable-ssl --enable-maintainer-mode --prefix=/usr/local/apache2 --enable-mods-shared=all
$ make
# make install
安装目录是/usr/local/apache2。修改/usr/local/apache2/conf/httpd.conf(下面省略路径)ServerName :80。
启动Apache服务:
# /usr/local/apache2/bin/apachectl start
访问http://serverip,如果出现“It works!” ==》启动成功。不成功的话看看usr/local/apache2/log/error.log。
2.安装apr和apr-util
$ cd apr-1.3.9
$ ./configure
$ make
# make install
$ cd apr-util-1.3.9
$ ./configure --with-apr=/usr/local/apr
$ make
# make install
3.安装Subversion
$ ./configure --with-apxs=/usr/local/apache2/bin/apxs --prefix=/usr/local/subversion --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-ssl --with-zlib --enable-maintainer-mode --without-berkeley-db PYTHON=/usr/bin/python --with-swig=/usr/bin/swig --enable-shared --enable-static --enable-swig-binding=python
$ make
# make install
安装成功的话,/usr/local/apache2/modules里应该有mod_dav_svn.so 和mod_authz_svn.so。在httpd.conf中添加:
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
4.安装swig-py
$ cd subversion-1.6.1
$ make swig-py
# make install-swig-py
# echo /usr/local/subversion/lib/svn-python > /usr/lib/python/site-packages/subversion.pth
测试swig-py是否安装成功:
$ python
>>> import svn.repos
不报错就成功了。
5.配置svn