subversion svn

subversion

trac, subversion and apache on Fedora

trac, subversion and apache on Fedora 8

Prepare:
# yum install svn mod_dav_svn trac

Subversion:
# 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...

Trac:
$ 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.

Apache:
$ 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

</Location>

Setup trac:

# vim conf.d/trac.conf

Comment all settings and modify the Location section:

<Location /trac>

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

</Location>

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:

[proj0:/]
* = r
test = rw

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

$ cd
$ wget http://peak.telecommunity.com/dist/ez_setup.py
$ su
# python ez_setup.py -U setuptools
# easy_install http://trac-hacks.org/svn/accountmanagerplugin/0.10
# easy_install http://svn.edgewall.com/repos/trac/sandbox/webadmin
# vim trac/proj0/conf/trac.ini

Add these:

[components]
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 阅读(964) 评论(0)  编辑 收藏 引用