使用svn trac mod_wsgi httpd组建版本控制和bug跟踪系统

组建一个基于subversion的版本库系统,通过trac进行bug跟踪。

安装好svn服务器和trac后,接下来就开始配置了。以下是配置脚本,略加修改后就可以使用。

svn_trac.sh

用法:./svn_trac.sh /opt/svn/workspace /opt/trac

#!/bin/bash #使用svn和trac创建存储库及bug跟踪系统 usage() { echo "usage: $0 REPOS_PATH TRAC_PATH" echo "" echo "REPOS_PATH must be a absolute path of your repository will locate." echo "TRAC_PATH must be a absolute path of trac website will locate." } if [ -z "$1" -o -z "$2" ];then usage exit 1 else REPOS_PATH=$1 TRAC_PATH=$2 fi #创建存储库目录 mkdir -p ${REPOS_PATH} mkdir -p /tmp/${REPOS_PATH} mkdir /tmp/${REPOS_PATH}/branches mkdir /tmp/${REPOS_PATH}/tags mkdir /tmp/${REPOS_PATH}/trunk #构建svn存储库 svnadmin create ${REPOS_PATH} svn import /tmp/${REPOS_PATH} file://${REPOS_PATH} -m "initial import" rm -rf /tmp/${REPOS_PATH} chown -R apache:apache ${REPOS_PATH} #初始化trac环境,这里会有一些命令交互 /opt/pyvirenv/trac117/bin/trac-admin ${TRAC_PATH} initenv chown -R apache:apache ${TRAC_PATH} #剩下的工作是配置httpd #创建httpd server的访问用户 htpasswd -c /etc/subversion/account admin #vi /etc/httpd/conf.d/subversion.conf #vi /etc/httpd/conf.d/wsgi.conf #service httpd restart #注意关闭SELinux

 

 

 

修改/etc/httpd/conf.d/subversion.conf文件的内容如下: LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so <Location /repos> DAV svn SVNParentPath /opt/svn/ AuthType Basic AuthName "svn repos" AuthUserFile /etc/subversion/account Require valid-user SVNListParentPath on </Location>  

 

修改/etc/httpd/conf.d/wsgi.conf文件的内容如下:

LoadModule wsgi_module modules/mod_wsgi.so WSGIScriptAlias /trac /opt/trac/trac.wsgi <Directory /opt/trac> WSGIApplicationGroup %{GLOBAL} Order deny,allow Allow from all </Directory> <Location /trac> AuthType Basic AuthName "svn repos" AuthUserFile /etc/subversion/account Require valid-user </Location>

之后重启httpd server,就可以通过http://server_ip/trac 和http://server_ip/repos 来访问了。

你可能感兴趣的:(apache,SVN,Module,subversion,Path,import)