2008/05/04

Setup Subversion and Trac on CentOS 5

Recently I set up a virtual server to use as a development machine. It runs on CentOS 5 and hosts several Subversion repositories with associated Trac projects.
There are many guides and plenty of help on the net to help you setup such a system. The easiest way is to YUM it.
yum --enablerepo=rpmforge trac

But that's not it, you need to do the following post-installs.

Initialize a Trac project for your new repository

trac-admin /var/trac/project_name initenv

From there you will enter the trac-admin commands. Use the defaults if not sure.
File permissions

chown -R apache.apache /srv/svn/project_name
chown -R apache.apache /var/trac/project_name

If you don't like the location, edit the /etc/httpd/conf.d/trac.conf.
Subversion

vim /etc/httpd/conf.d/subversion.conf


Add the following directive:

<Location /svn>
DAV svn
SVNParentPath /srv/svn
AuthType Basic
AuthName "My SVN Repository"
AuthzSVNAccessFile /srv/svn/svn-acl-conf
AuthUserFile /srv/svn/.htpasswd
Require valid-user
</Location>

Add a repository user
touch /srv/svn/.htpasswd
htpasswd -m /srv/svn/.htpasswd username


Create the Access Control List for the SVN Repository

vim /srv/svn/svn-acl-conf
Add the following directives:

[project_name:/]
username =  rw
Where username represents the username of the repository user you created earlier.
Trac Config
vi /etc/httpd/conf.d/trac.conf

Edit this line:
AuthUserFile /srv/svn/.htpasswd

Give admin permissions to the Trac user you just created:
trac-admin /srv/trac/project_name permission add username TRAC_ADMIN
Where username represents the trac user you just added in htpasswd.
Restart Apache
service httpd restart
You should now have http://server/svn/ and the Trac system at http://server/trac/ associated with the repository.
What's Next?
check out http://trac-hacks.org

Resources

沒有留言:

Mercury簡易改裝

有同好有一樣的困擾 - 如何使用自己的data logging軟體,因此寫了這篇來分享我的簡易改裝。 Background 雲豆子 MERCURY roaster 烘豆機的設計是使用自行開發的軟體,來:1. 操控風門/火力; 2. data logging/自動烘焙。 ...