1.首先添加epel扩展库
2.安装subversion
yum -y install subversion
3.安装trac
yum -y install trac mod_python
4.创建subversion资源
mkdir -p /var/www/svn/foobar
svnadmin create --fs-type fsfs /var/www/svn/foobar
5.创建trac使用目录
mkdir -p /var/www/trac
trac-admin /var/www/trac/foobar initenv
6.修改目录属主为apache
chown -R apache:apache /var/www/trac/foobar
chown -R apache:apache /vaw/www/svn/foobar
7.修改apache配置文件
vim /etc/httpd/conf.d/trac.conf
- <Location /trac>
- SetHandler mod_python
- PythonHandler trac.web.modpython_frontend
- # "/var/www/svn/foobar" is the folder you gave to trac-admin initenv earlier
- PythonOption TracEnv /var/www/trac/foobar
- # "/trac" is the same as the Location above
- PythonOption TracUriRoot /trac
- # "/tmp" should be some writable temporary directory
- SetEnv PYTHON_EGG_CACHE /tmp
- # "trac" can be any string, but must be the same for all
- # Trac instances on the same Apache install
- PythonInterpreter trac
- </Location>
- <Location /trac/login>
- AuthType Basic
- AuthName "alexandria"
- AuthUserFile /var/www/trac/foobar/conf/trac.htpasswd
- Require valid-user
- </Location>
然后就可以通过ip/trac访问了。