分类: LINUX
2011-07-06 14:06:25
# install python
yum -y install python.i386 python-devel.i386 python-lxml.i386 python-sqlite.i386 python-clearsilver.i386 swig.i386 python-setuptools.noarch
3.下载安装python模板clearsilver
wget
rpm -i clearsilver-0.10.4-1.el5.rf.i386.rpm
wget
rpm -i python-clearsilver-0.10.4-1.el5.rf.i386.rpm
4.#安装Trac
wget
tar zxvf Trac-0.11.4.tar.gz
cd Trac-0.11.4
python setup.py build && python setup.py install
5.配置
a.建立svn及trac目录
mkdir /srv/svn
mkdir /srv/trac/
b.#新建svn项目
svnadmin create /srv/svn/project
#新建trac项目
trac-admin /srv/trac/project initenv
#按提示操作,`Path to repository` is: /srv/svn/project
c.#改文件所属为apache 我是改成一个普通用户,因为我用的是nfs共享.根据自己的需要更改这个用户,同时保证和httpd.conf中一致.
chown -R apache.apache /srv/svn/project
chown -R apache.apache /srv/trac/project
d.vi /etc/httpd/conf.d/subersion.conf,加入下列内容
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
#
# Example configuration to enable HTTP access for a directory
# containing Subversion repositories, "/var/www/svn". Each repository
# must be readable and writable by the 'apache' user. Note that if
# SELinux is enabled, the repositories must be labelled with a context
# which httpd can write to; this will happen by default for
# directories created in /var/ Use "restorecon -R /var/www/svn"
# to label the repositories if upgrading from a previous release.
#
#
# To create a new repository "" using
# this configuration, run as root:
#
# # cd /var/www/svn
# # svnadmin create stuff
# # chown -R apache.apache stuff
#
DAV svn
SVNParentPath /srv/svn
# # Limit write permission to list of valid users.
# # Require SSL connection for password protection.
# # SSLRequireSSL
#
AuthType Basic
AuthName "subversion repository"
AuthUserFile /srv/svn/conf/svn-auth-file
Require valid-user
AuthzSVNAccessFile /srv/svn/conf/svn-access-file
e. vi /etc/httpd/conf.d/trac.conf
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnv /srv/trac/project
SetEnv PYTHON_EGG_CACHE /tmp
PythonOption TracUriRoot /trac/project
AuthType None
AuthType Basic
AuthName "svn.xxx.com"
AuthUserFile /srv/svn/conf/svn-auth-file
Require valid-user
6.生成htppasswd文件和用户
htpasswd -cm /srv/svn/conf/svn-auth-file admin
service httpd restart
7.这时已经可以用浏览器进行测试了
8.然后也可以用 windows的svn客户端进行操作.
9.给svn服务器配置了一个域名,设置了一个自动跳转到trac页面.
在DocumentRoot下vi index.html,加入下面的内容