subversion svn


trac, subversion and apache on Fedora

trac, subversion and apache on Fedora 8

# yum install svn mod_dav_svn trac

# useradd svn -d /svn
# chmod g+rwx /svn
# su svn
$ cd
$ mkdir repos trac .conf
$ cd repos
$ mkdir proj0
$ svnadmin create --fs-type fsfs proj0

The commands start with "#" should be excuted as root. About the repository filesystem type, you can choose either FSFS or Berkelay-DB, I'd like the simple one...

$ cd ~/trac
$ mkdir proj0
$ cd proj0
$ trac-admin proj0 initenv

Then the program will ask you some questions about the project, if you are using SQLite as the DB, just make sure the path of subversion repository is correct, /svn/repos/proj0 in this example.

$ su
# cd /etc/httpd

Setup svn:

# vim conf.d/subversion.conf

Modify the Location section:

<Location /svn>

DAV svn
SVNParentPath /svn/repos
AuthType Basic
AuthName "SVN repos"
AuthUserFile /svn/.conf/userlist
AuthzSVNAccessFile /svn/.conf/authfile
Require valid-user


Setup trac:

# vim conf.d/trac.conf

Comment all settings and modify the Location section:

<Location /trac>

SetEnv TRAC_ENV /svn/trac
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonInterpreter main_interpreter
PythonOption TracEnvParentDir /svn/trac
AuthType Basic
AuthName "Trac Projects"
AuthUserFile /svn/.conf/userlist


Because I will manage the accouts with the trac plugin, the "Require valid-user" option doesn't need be here.

Then, setup the httpd:

# usermod -G svn apache
# chkconfig --level 5 httpd on
# htpasswd -c /svn/.conf/userlist test

Account Management:
# su svn
$ cd ~/.conf
$ vim authfile

For more details about the svn authz module, please read the svn-book.pdf in official web site, it's pretty good. Now make the authfile looked like this:

* = r
test = rw

At last, we need install easy_install to install the trac plugins packaged as the python eggs:

$ cd
$ wget
$ su
# python -U setuptools
# easy_install
# easy_install
# vim trac/proj0/conf/trac.ini

Add these:

webadmin.* = enabled
trac.web.auth.LoginModule = disabled
acct_magr.* = enabled

Then start the httpd service:

# service httpd restart

Open your browser and type the address: http://localhost/trac/proj0, DO HAVE FUN.

posted on 2008-05-15 23:41 subversion 阅读(961) 评论(0)  编辑 收藏 引用