Woot - Trac up and running
August 23, 2006 · 21 Comment s
Here at work we've been using Subversion since I joined. There was no version control in place and it was the first change I made.
For some time now I've wanted to get Trac up and running as I've seen it in action, and it's integration with Subversion is nothing short of astounding.
Due to lack of time and resources, and because I heard Trac was a killer to set up on Windows, we went with Ray Camden's Lighthouse as our bug tracker until I could find a spare day or two.
Well today I finally decided to bite the bullet and install Trac. And you know what, in about 30 mins, it was up and running... and even then most of that was downloading files.
In fact, the only complication I had was forgetting to edit trac.cgi to find the python.exe file.
So, whilst not an extensive guide to getting Trac installed here's what I did.
Files to Download
Bear in mind I already had Subversion up and running with Apache on Windows 2003, so I won't be covering this step
Installation Notes
- Install Python - You must use Python 2.3.x - the Subversion bindings are not available for Python 2.4
- Copy the libsvn and svn folders in the Python Bindings to <python>\lib\site-packages
- Install PySQLite
- Extract neo_cgi.pyd from your Clearsilver download to <python>\lib\site-packages
- Install Trac
- Copy <python>\share\trac\cgi-bin\trac.cgi to <apache>\cgi-bin
- Edit the trac.cgi file so that the first line points to your python.exe file
d:\python23>python scripts\trac-admin d:/svn/trac.db
Initialise DB
Trac [d:/svn/trac.db]> initenv
Trac will now ask you for a Project Name, Database Connection String, Subversion Repository, and the Path to Templates
So as an example:
Project Name: Creative
Connection String: (just hit enter to accept default)
Subversion Repository: d:\svn\creative
Path to Templates: (just hit return)
Add Administrative Permissions
Trac [d:/svn/trac.db]> permission add admin TRAC_ADMIN
Add Trac to Apache
Edit httpd.conf:
# TRAC
Alias /trac <span class='cc_value'>"d:/Python23/share/trac/htdocs"</span>
<Location /cgi-bin/trac.cgi>
SetEnv TRAC_ENV <span class='cc_value'>"d:/svn/trac.db"</span>
SetEnv PYTHONPATH <span class='cc_value'>"d:/Subversion/bin"</span>
# if you are running Apache as a user other than System, the TMP variable
# needs to be set to a place where that user can write scratch files. Make
# sure that this directory is created and writable by that user.
# SetEnv TMP <span class='cc_value'>"d:/svn/trac.db/tmp
</Location>
<Location /cgi-bin/trac.cgi/login>
AuthType Basic
AuthName "</span>Creative<span class='cc_value'>"
AuthUserFile passwd
Require valid-user
</Location>
<Directory "</span>d:/Python23/share/trac/htdocs">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Now you want to restart Apache.
Finally, hit http://yourdomain/cgi-bin/trac.cgi and log in via the username/password combinations you have set up in "passwd" for accessing Subversion.
Final Words
I know I've not covered everything, and I've certainly not mentioned any error messages you may potentially come across, but if you do have any issues, leave a comment here and I'll try and help out. Tags: Trac · Subversion

21 response s so far ↓
1 Christian Ready // Aug 24, 2006 at 5:00 AM
I ask because I don't want to pull my hair out trying to get Trac to work only to find that I'm using the wrong version of Apache.
2 Andy Allan // Aug 24, 2006 at 10:24 AM
3 Stephen Moretti // Aug 24, 2006 at 10:59 AM
4 Andy Allan // Aug 24, 2006 at 11:41 AM
5 Christian Ready // Aug 24, 2006 at 3:22 PM
6 Rob Wilkerson // Aug 25, 2006 at 1:09 PM
To share some of what I've learned, the only Apache conflict is on Windows. My Linux install is running on Apache 2.2.2 just fine. From what I understand, the Windows mod_python release doesn't play nice with Apache 2.2.x on Windows yet.
This is a great system. I love Subversion (we were using VSS) and Trac has been a huge productivity tool. Even removing the integrated ticketing from this thought, the wiki availability for collaborative documentation is outstanding. I couldn't be happier with what we've gotten out of it in just a few short weeks.
7 pinxo // Nov 8, 2006 at 12:05 PM
access to /trac/myproject/login failed, reason: require directives present and no Authoritative handler.
Any hints?
8 Andy Allan // Nov 8, 2006 at 12:19 PM
9 pinxo // Nov 8, 2006 at 2:35 PM
btw: I'm using Debian Etch and the bindings works fine.
10 Andy Allan // Nov 8, 2006 at 2:41 PM
11 Rob Wilkerson // Nov 8, 2006 at 2:51 PM
12 Ali Muzaffar Khan // May 18, 2007 at 12:58 PM
13 Dave Shuck // May 24, 2007 at 6:48 PM
I walked all the way through the instructions without error, but when I went to the browser and hit the page I got an apache error. When looking through the logs, I found this:
__________
[Thu May 24 11:57:10 2007] [error] [client 216.50.229.162] C:/Program Files/Apache Group/Apache2/cgi-bin/trac.cgi is not executable; ensure interpreted scripts have "#!" first line
[Thu May 24 11:57:10 2007] [error] [client 216.50.229.162] (9)Bad file descriptor: don't know how to spawn child process: C:/Program Files/Apache Group/Apache2/cgi-bin/trac.cgi
__________
On the first line of the trac.cgi. I have...
#!C:\Python23\python.exe
... which is the correct path to the python.exe Is there something obvious that I am missing here?
14 Dave Shuck // May 24, 2007 at 7:19 PM
yay!
15 Thijs Kruithof // Jul 29, 2007 at 5:53 PM
16 SEo Companies // Aug 6, 2009 at 8:55 AM
17 Transition management // Aug 6, 2009 at 1:49 PM
Regards
Harry
18 blank calendar // Aug 8, 2009 at 9:11 AM
thanks
Zane
19 rubbish clearance // Aug 11, 2009 at 5:03 PM
20 swimming pools designs // Aug 28, 2009 at 9:53 AM
21 ed hardy mens Jeans // Sep 17, 2009 at 9:06 AM
Leave a Comment