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/ into server: The specified module could not be found.

I finally solved that problem by copying C:Python25python25.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.

  1. Install Trac/SVN using the instructions on Trac’s web site.
  2. 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.)
  3. Document the location of the Windows Resource Kits’ srvany.exe file.  The default directory is C:Program FilesWindows Resource KitsTools.

    Default location of srvany.exe
    Default location of srvany.exe
  4. Open up the Command Prompt.  To do this, go to the Start menu and click Run.  Type in cmd and press enter.
  5. Type the following and then press enter:  instsrv tracd “C:Program FilesWindows Resource KitsToolssrvany.exe”

    Creating a service in Windows XP
    Creating a service in Windows XP
  6. Type exit to close the Command Prompt.
  7. Go back to the Start menu and click Run.  Type in regedit and press enter.
  8. Open HKEY_LOCAL_MACHINESystemCurrentControlSetServicestracd.
  9. Right-click on tracd and click New > Key.  Name the key, Parameters.
    Adding Keys for tracd in RegEdit
  • 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:Python25python.exe.  (Note:  To edit a value, right-click on the name and click Modify.)
  • Next, edit AppParameters and type the following: –port 8000 –env-parent-dir=C:projectstrac.  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.
    Editing AppParameters in RegEdit for tracd
    Editing AppParameters in RegEdit for tracd

    (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:pathtotracproject.)

  • 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.

    Starting the tracd service
    Starting the tracd service
  • 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.