Setting up a Trac Server Under OS X 10.6

Trac is an excellent open source tool that allows you to manage a software project;s development life cycle, incorporating a wiki with issue/bug tracking while integrating with a source control service such as subversion. Months ago I had set up a subversion server which was working great on my iMac. I then wanted to setup a Trac server to go along with it so I could manage all aspects for my projects properly. Here's how I did it.

Installing and setting up Trac

Trac is written in the python scripting language, also requiring a number of other third party libraries. While a compatible version of python comes pre-shipped with OS X 10.6, these prequisite libraries do not. However its extremely easy to install trac along with all its prequisites by using python's great 'easy_install' feature. Simply fire up a command line by launching Terminal.app and run the following command:

sudo easy_install trac

This will download and install everything you need for you without further input, so let it do its thing and when its finished we are ready to create our Trac environment. Because I had previously set up my subversion server under a dedicated OS X user 'svn', I wanted to run trac under the same user. Thus I was going to create my trac environment in the /Users/svn/trac/newproject directory and do so by ensuring it was created with appropriate permissions for the svn user. This can be done by prefixing any command with 'sudo -u svn', which will run the command as the svn user. For steps on setting up a dedicated user for this purpose see my previous subversion howto. Run the following command (after ensuring /Users/svn/trac/ has been created) in the terminal:

sudo -u svn trac-admin /Users/svn/trac/newProject initenv

This will create a whole bunch of directories and files and you can then run the standalone Trac server manually to check that these first steps have worked:

sudo -u svn tracd --port=8000 /Users/svn/trac/newProject

This will make the trac server listen on TCP port 8000, so we can then browse in Safari or the browser of choice to http://127.0.0.1:8000 and see that we have a trac server running. Its not terribly useful yet however, as we still need to create users, assign administrator privileges to somebody and …

Read More