欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

CentOS + SVN + Trac 安装笔记 博客分类: Other SVNCentOSJavaChromePython 

程序员文章站 2024-03-08 21:49:28
...
安装SVN
yum install subversion


创建SVN库
svnadmin create /var/svn
chown -R apache.apache /var/svn


下载mod_dav_svn模块
yum install mod_dav_svn


修改httpd.conf,通过Apache访问SVN
LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so
<Location /svn>
   DAV svn
   SVNPath /var/svn
   AuthType Basic
   AuthName "Authorization Realm"
   AuthUserFile /var/svn/.htpasswd
   AuthzSVNAccessFile /var/svn/conf/authz
   Require valid-user
</Location>


修改/var/svn/conf/authz
[groups]
admin = root
user = user1,user2,user3

[/]
@admin = rw
* = r

[/svn/project1]
@admin = rw
@user = r

[/svn/project2]
@admin = rw
@user = rw


安装Trac
sh setuptools-0.6c9-py2.4.egg
easy_install Genshi
easy_install Babel==0.9.5
easy_install Trac


创建Trac库,并生成CGI文件和静态资源
trac-admin /var/trac initenv
chown -R apache.apache /var/trac
trac-admin /var/trac deploy /var/www/trac
chmod 755 /var/www/trac/cgi-bin/trac.fcgi


下载mod_fcgid模块
yum install mod_fcgid


修改httpd.conf,通过mod_fcgid模块运行trac
LoadModule fcgid_module modules/mod_fcgid.so

Alias /trac/chrome/common /var/www/trac/htdocs/common
Alias /trac/chrome/site /var/www/trac/htdocs/site

<Directory "/var/www/trac/htdocs">
  Order allow,deny
  Allow from all
</Directory>

ScriptAlias /trac /var/www/trac/cgi-bin/trac.fcgi/
DefaultInitEnv TRAC_ENV /var/trac/

<Location "/trac/login">
  AuthType Basic
  AuthName "Trac"
  AuthUserFile /var/svn/.htpasswd
  Require valid-user
</Location>


修改/var/trac/conf/trac.ini
default_charset = utf-8
repository_dir = /var/svn


给root用户赋管理权限
trac-admin /var/trac permission add root TRAC_ADMIN


自动关闭ticket

在admin页面开启
tracopt.ticket.commit_updater.* = enabled

添加/var/svn/hooks/post-commit文件
#!/bin/sh
export PYTHON_EGG_CACHE="/tmp"
/usr/bin/trac-admin /var/trac changeset added "$1" "$2"


添加/var/svn/hooks/post-revprop-change文件
#!/bin/sh
export PYTHON_EGG_CACHE="/tmp"
/usr/bin/trac-admin /var/trac changeset modified "$1" "$2"


修改trac模板

添加/var/trac/templates/site.html
添加CSS文件,例如/var/www/trac/htdocs/site/style.css