//解压subversion安装包 # tar zxvf subversion-1.4.6.tar.gz # tar zxvf subversion-deps-1.4.6.tar.gz //进入解压后的目录 # cd subversion-1.4.6 //配置subversion # ./configure --with-apxs=/usr/local/apache2/bin/apxs --prefix=/usr/local/subversion --with-apr=/usr/local/apache2 --with-apr-util=/usr/local/apache2 --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
经过上面的步骤mod_dav_svn.so and mod_authz_svn.so将会被copy到/usr/local/apache2/modules/下, 同时在 /usr/local/apache2/conf/httpd.conf will be added the following section: LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so 检查一下是否都正确,如果没有的话可能就要手动加进去。
注意一下运行. /configure时加的这几个参数PYTHON=/usr/bin/python --with-swig=/usr/bin/swig --enable-shared --enable-static --enable-swig-binding=python,开始的时候编译svn的时候没有加这几个参数,单独使用svn 都没问题,但是后面安装好trac后却怎么也不行,打开网页一直有错误,从Browser访问Trac的时候,出现了下面的错误: --------------------------------------------------------------------------------------------- Python Traceback Traceback (most recent call last): File "/usr/local/lib/python2.5/site-packages/trac/web/main.py", line 387, in dispatch_request dispatcher.dispatch(req) File "/usr/local/lib/python2.5/site-packages/trac/web/main.py", line 191, in dispatch chosen_handler = self._pre_process_request(req, chosen_handler) File "/usr/local/lib/python2.5/site-packages/trac/web/main.py", line 263, in _pre_process_request chosen_handler = f.pre_process_request(req, chosen_handler) File "/usr/local/lib/python2.5/site-packages/trac/versioncontrol/api.py", line 73, in pre_process_request self.get_repository(req.authname) # triggers a sync if applicable File "/usr/local/lib/python2.5/site-packages/trac/versioncontrol/api.py", line 92, in get_repository % self.repository_type)TracError: Unsupported version control system "svn" --------------------------------------------------------------------- 上网找了半天看见一片文章上说make svn的时候要加上这几个参数"PYTHON=/usr/bin/python --with-swig=/usr/bin/swig --enable-shared --enable-static --enable-swig-binding=python"
同时执行了上面的make && make install后还要编译安装Subversion SWIG Python bindings Swig-py的安装说明在subversion-1.4.6/subversion/bindings/swig/INSTALL文件里。说的比较详细,要做的事情如下:
* Python, version >= 2.3. + Please keep in mind, that for RPM-based systems you will also need python-devel and python-xml packages. * Subversion, version >= 1.0. (>= 1.1.x recommended) * Subversion SWIG Python bindings (not PySVN). * PySQLite, version 1.x (for SQLite 2.x) or version 2.x (for SQLite 3.x) * Clearsilver, version >= 0.9.3 (0.9.14 recommended) * A web server capable of executing CGI/FastCGI scripts, or Apache HTTPD with mod_python. (Trac also comes with a standalone server, but its use is not recommended for use in a production environment.)