From RedBrick Wiki
Jump to: navigation, search

Trac is a popular project/code management system. It's also easy to use on your Redbrick webspace.

Starting a new project

First, log onto carbon. Carbon is redbrick's development server. Change directory to your home directory, or wherever you want the subversion repo for your project to be. Then create it:

svnadmin create myrepo

Next, create a trac environment for the project:

trac-admin myproj initenv

This will create a folder called "myproj", with your trac environment inside it.

When you're asked for a database type, it's probably easiest to just hit enter and continue, unless you know what you're doing. When asked about the subversion repository, enter the full path of the repository you just created - e.g. /home/member/u/username/myrepo. Press enter when asked about templates.

Setting up the web interface

Now, change to your public_html directory and create a new directory. This will form part of the trac web URL. Set permissions to 711 or 755.

mkdir tracweb
chmod 711 tracweb
cd tracweb

Inside this directory, create a .htaccess file. Place the following inside it:

AuthType pubcookie
PubcookieAppId "usernamestracweb"
require user username

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /~username/tracweb/index.cgi/$1 [QSA,L]

Change the bits in bold to your own username. Save this, and set permissions to 644:

chmod 644 .htaccess

Now create another file, index.cgi. Inside it, put:

export TRAC_ENV=/home/member/u/username/myproj
exec /usr/share/trac/cgi-bin/trac.cgi

Change the TRAC_ENV variable to point to the trac environment you created earlier (not the subversion repository).

Save this, and set the permissions to 700:

chmod 700 index.cgi

Finally, set yourself up as an admin:

trac-admin /home/member/u/username/myproj permission add username TRAC_ADMIN

Again, change "username" to your username, and replace the path there with the path to your trac environment.

Now go to the URL you created: And it should just work!