日期:2014-05-16  浏览次数:20871 次

Linux下SubVersion及Trac设置

httpd所在目录 /etc/httpd
svn所在目录 /usr/local/svn
trac所在目录 /usr/local/trac


创建StrongWEB的svn仓库
[root@gz-strong svn]# svnadmin create StrongWEB
设置StrongWEB的所有者为httpd的用户
[root@gz-strong svn]# chown -R apache.apache StrongWEB/

创建StrongWEB的Trac模块

[root@gz-strong trac]# trac-admin StrongWEB initenv

。。。省略配置向导 基本按照默认即可

对StrongWEB的Trac进行配置

[root@gz-strong trac]# trac-admin StrongWEB
Welcome to trac-admin 0.10.4
Interactive Trac administration console.
Copyright (c) 2003-2006 Edgewall Software
Type:? '?' or 'help' for help on commands.
Trac [/usr/local/trac/StrongWEB]>

删除默认的匿名用户及其所有权限
Trac [/usr/local/trac/StrongWEB]> permission remove anonymous *

增加一个具有TRAC_ADMIN权限的用户组admin

Trac [/usr/local/trac/StrongWEB]> permission add admin TRAC_ADMIN

将用户simen增加到admin用户组

Trac [/usr/local/trac/StrongWEB]> permission add simen admin

修改svn权限管理文件,将simen的权限设置为StrongWEB可读写

[root@gz-strong trac]# vi /etc/svn-authz-conf
?
[groups]
managers = simen,jby,xmaya
developers = cdy
?
[/]
# @managers = rw
simen = rw

[StrongWEB:/]
simen = rw

?

编辑trac的配置文件,将svn的用户管理应用到StrongWEB的trac模块中

[root@gz-strong trac]# vi /etc/httpd/conf.d/trac.conf
?
Alias /trac/chrome/common /usr/share/trac/htdocs
<Directory "/usr/share/trac/htdocs">
??????? Order allow,deny
??????? Allow from all
??????? # Deny from all
</Directory>
ScriptAlias /trac /usr/share/trac/cgi-bin/trac.cgi
<Location "/trac">
??????? # SetEnv TRAC_ENV "/usr/local/trac/simen"
??????? SetEnv TRAC_ENV_PARENT_DIR "/usr/local/trac"
</Location>
<Location "/trac/StrongWEB/login">
????? # 设置Trac用户验证通过htpasswd添加/etc/apache2/trac.passwd和用户
????? AuthType Basic
????? AuthName "Strong_WIKI"
????? AuthUserFile /etc/svn-auth-conf
????? Require valid-user
</Location>

重启httpd服务

[root@gz-strong trac]# service httpd restart