Nov 29 2008
Trac on Windows
I needed to install Trac on my laptop. Trac is an enhanced wiki and issue tracking system for software development projects. I had used it about 2 years back and had liked it then. However, I had never installed it myself. I assumed it will be like any other installation. But just after starting out, I realized that I was grossly mistaken. Installing Trac and getting it running with the webadmin plugin and users configured for your projects is a little more than a post-work headache.
I have the following setup:
- OS: Vista business 32-bit
- Python: Not already installed on my system
After installation, we will be running Trac 0.10.4 with webadmin plugin and users configured for a project. This installation will be running on Apache and we won’t be using Trac’s standalone webserver (tracd). I am not using Trac’s subversion feature since I am already running VisualSVN server (and I love its ease of use). Ill try to switch sometime later if thats not another royal pain.
It turns out that the steps are quite simple … if you happen to know them.
- Install Bitnami Trac stack
Bitnami’s stacks are very handy. They take care of the dependencies required for a piece of software to run. So this will take care of Python, sqlite database and Apache for us. For Trac 0.10, the webadmin plugin needs to be installed separately. 0.11 includes it in the core package itself. However, Bitnami’s stack hasn’t been upgraded yet.
While installing the Trac stack, select yes when prompted to create a project and provide the details. I will assume installation at “C:\Program Files\BitNami Trac Stack” and first project as Project1.
- Install webadmin plugin
Download from the link that says “Download for Trac 0.9.3 or later (Python 2.4)”. (despite the notice that says for 0.10.x, you must build from SVN). After downloading it, remove the .zip extension and drop the resulting .egg file in C:\Program Files\BitNami Trac Stack\projects\Project1\plugins. This will install the webadmin plugin so that we don’t have to resort to the command line every now and then. The plugin will be installed only for this project. To install it for all projects, follow the instructions here.
- Create users
Wait, the webadmin plugin doesn’t allow you to create users! Trac uses the authentication provided by the web server. In our case, we need to create users for Apache. We can then assign roles to these users via the Trac webadmin interface.
Navigate to C:\Program Files\BitNami Trac Stack\trac\conf and locate the htpasswd file. This file holds the usernames and passwords. Bitnami makes the appropriate configuration changes to have Apache authenticate users against this file. Users added to this file will be available across all your projects. For adding a user “abhijeet” to this file, open a command prompt, cd to C:\Program Files\BitNami Trac Stack\apache2\bin and execute the command:
htpasswd "C:\Program Files\BitNami Trac Stack\trac\conf\htpasswd" abhijeet
Supply the password when prompted and the new user should be created.
- Assign roles and permissions
Restart “tracApache” service from the Windows Services management console and verify that you can login using the newly created username. For assigning permissions to this user, login again as the admin user using the password you supplied during installation. Locate the admin link near the top right corner and click on Permissions on the left. Add a group “developer” and grant permissions for the same. Then add your developers to this group. A screenshot could help (I have edited this image. It was too wide).
You should have the Trac installation running now. Backup is as simple as creating a copy of the “projects” folder. If you can’t see the admin link on the upper right corner after all this, be prepared to spend the night getting it to show up. Start here!
Finally, if you have any Trac tips up your sleeve, I would love to read them. Things such as setting up multiple projects, having different sets of users for projects …
