Trac – Configure New Environment


Trac allows the hosting of multiple environments/projects using a single install.

However, setting it up is not so straight-forward.

Configure your new Trac environment

The trac-admin tool is used to configure Trac. The following will create a new environment skeleton directory amongst the other Trac environments:

trac-admin /svn/trac/isg12-012

Add an admin user

trac-admin /svn/trac/isg12-012/ permission add jkalawe TRAC_ADMIN

Modify Apache

The Trac server is configured to use a vhost for each environment. Copy and existing the trac-x and svn-x to get started:

cd /etc/httpd/conf.d/ssl

cp trac-trap.conf trac-isg12-012.conf
cp svn-trap.conf svn-isg12-012.conf

Replace all instances of the copied environment with values for your new environment. Restart apache.

Configure SVN

Create a new repo for your project:

svnadmin create /svn/repo/isg12-012

chown -R apache:apache /svn/repo/isg12-012

<h3>Setup SVN With Trac</h3>
<p>Login to the admin panel and create a new repo under the version control view.</p>

<p>You must now sync trac up to the repo:</p>
trac-admin /svn/trac/isg12-012/ repository resync "isg12-012"

Modify the repo’s post-commit hook and add the previous trac-admin command to the last line of the file:

cd /svn/repo/isg12-012/hooks

cp post-commit.tmpl post-commit

vi post-commit

Change the ownership of post-commit to apache and make it executable. Otherwise, it won’t work:

chown apache:apache post-commit
chmod 755 post-commit