PHP, MySQL, JavaScript, Windows 7, Linux
Setting up tracd for multiple projects in Windows XP
I have a few ongoing projects that I wanted to use Trac for, but I only had tracd setup for one project. Yesterday, I spent a very long time working with my local development environment trying to get mod_python work with Apache 2.2.13, which led me to ultimately abandon the module and use the lightweight, standalone server for Trac, tracd. After installing mod_python using the MSI, I noticed I could no longer start Apache. I kept getting this error:
httpd.exe: Syntax error on line 113 of C:/Program Files/Zend/Apache2/conf/httpd.conf: Cannot load C:/Program Files/Zend/Apache2/modules/mod_python.so into server: The specified module could not be found.
I finally solved that problem by copying C:\Python25\python25.dll into C:\Windows. This may not have been the “perfect” fix, but it worked so I was happy. Next, I was plagued with getting Trac setup with Apache and mod_python… which never happened. I did, however, get it to work using CGI (Trac’s FastCGI won’t work on Windows), which was horrendously slow.
I finally decided to use the standalone server, which was a billion times better than using the CGI setup. Below are the steps to setup Trac’s standalone server as a service on Windows XP.
- Install Trac/SVN using the instructions on Trac’s web site.
- Download and install the Windows Server 2003 Resource Kit Tools. (Note: Even though it says Windows Server, it is compatible with Windows XP, which it plainly says in the System Requirements.)
- Document the location of the Windows Resource Kits’ srvany.exe file. The default directory is C:\Program Files\Windows Resource Kits\Tools.
- Open up the Command Prompt. To do this, go to the Start menu and click Run. Type in cmd and press enter.
- Type the following and then press enter: instsrv tracd “C:\Program Files\Windows Resource Kits\Tools\srvany.exe”
- Type exit to close the Command Prompt.
- Go back to the Start menu and click Run. Type in regedit and press enter.
- Open HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\tracd.
- Right-click on tracd and click New > Key. Name the key, Parameters.
- Under Parameters, create two new string values—Application, and AppParameters. String values can be created by right-clicking Parameters, and clicking New > String Value.
- Edit Application and type in the full path to your python.exe file. This will typically be C:\Python25\python.exe. (Note: To edit a value, right-click on the name and click Modify.)
- Next, edit AppParameters and type the following: C:\Python25\Scripts\tracd-script.py –port 8000 –env-parent-dir=C:\projects\trac. Please keep in mind that your projects’ parent directory may differ from the one I used. The port can also be changed to whatever your heart desires, as long as there are no conflicts.
(Note: For Trac installations where you will only ever have one project, delete –env-parent-dir= … and replace it with the directory of your Trac project—for example, …port 8000 C:\path\to\trac\project.)
- Go to Control Panel, click Administrative Tools > Services. Find tracd in the Services window and click Start. If you are having trouble, feel free to post a comment, and we will do our best to help you.
Not too bad, right? While I would prefer to have Trac integrated with Apache, it took much longer than it was worth to me. I’d rather spend that time developing. I can’t say much about the performance of tracd compared with mod_python on Apache, but I can tell you that tracd is very lightweight and fast.




