Woot - Trac up and running
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
Configuration
- 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
Configure Trac DB
Initialise DB
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
Add Trac to Apache
Edit httpd.conf:
Alias /trac "d:/Python23/share/trac/htdocs"
<Location /cgi-bin/trac.cgi>
SetEnv TRAC_ENV "d:/svn/trac.db"
SetEnv PYTHONPATH "d:/Subversion/bin"
# 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 "d:/svn/trac.db/tmp
</Location>
<Location /cgi-bin/trac.cgi/login>
AuthType Basic
AuthName "Creative"
AuthUserFile passwd
Require valid-user
</Location>
<Directory "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.



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.
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.
access to /trac/myproject/login failed, reason: require directives present and no Authoritative handler.
Any hints?
btw: I'm using Debian Etch and the bindings works fine.
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?
yay!