Trac Integrated SCM and Project Management
Edgewall Software
Trac is an Open Source Issue Tracking system that integrates into the Subversion VCS. This makes it an intriguing solution for CTSC.
The current version of Trac is 0.7.1 and it is built upon several other Open Source software products.
Due in part to the number of dependencies, the installation of Trac is a little bit involved.
This document will take you though the installation onto a Windows environment.
If Subversion is not already installed and running in your environment, please see the documentation for setting up
Subversion prior to continuing with this installation. Make sure the release numbers are the same as those listed above.
The Subversion installation requires Apache, Python and Subversion. This leaves SQLite, PySQLite, SilverCity and Trac
for this document to cover.
Subversion Python Bindings
For some reason, the Python bindings for Subversion were not installed during the Subversion installation.
Evidently, Subversion does not need these bindings but Trac does. The bindings are available in the same page that the
Subversion binaries were found. They include two folders; /libsvn and /svn. Copy these two folders to the \Python23\Lib folder
of your Python installation.
SQLite
Install SQLite to your Program Files\SQLite folder. Ensure this directory is in your PATH
environment variable.
PySQLite
Execute the PySQLite installer.
Trac
Trac requires two installations due to a problem with the current installer. First, install version 0.7 and then
install version 0.7.1. The installation is a wizard and all questions are straight forward. Be sure to mark down the drive and directory into
which you install Trac as you will need to do some custom configuration later armed with this info.
Post Installation Configuration
- Ensure the Python23\lib\site-packages\trac\siteconfig.py file uses the correct path for your Python installation.
# PLEASE DO NOT EDIT THIS FILE!
# This file was autogenerated when installing Trac 0.7.
#
__default_templates_dir__ = 'c:\\Python23\\share\\trac\\templates'
__default_htdocs_dir__ = 'c:\\Python23\\share\\trac\\htdocs'
__default_wiki_dir__ = 'c:\\Python23\\share\\trac\\wiki-default'
The double backslash is required for windows installations. Do edit this file to use the correct drive and base path to the Python 2.3 installation.
- Edit the first line of the file Python23\scripts\trac-admin to use the correct path and
to begin with the symbols #!
This informs Apache what program to use to open the files.
e.g. #!c:\Python23\python.exe
- Edit the first line of the file Python23\share\trac\cgi-bin\trac.cgi to also begin with #!
and point to the correct path
e.g. #!c:\Python23\python.exe
- Copy the file python23\share\trac\cgi-bin\trac.cgi to Program Files\Apache Group\Apache2\cgi-bin
Configure the Trac DB
- From the DOS command prompt, CD to the \Python23\Scripts directory and enter the command:
C:\Python23\Scripts> python trac-admin c:\svn\trac.db
where c:\svn\trac.db is the location you desire for the trac database. This database will store all the issues and their histories.
- Next, initialize the database by entering the command: initdb at the prompt:
Trac [c:\svn\trac.db]> initdb
You will be prompted for project name, the path to the subversion repository to which this project is associated (d:\svn\repo1) and the path to the
templates (select the default).
- The documentation I followed requested that the Wiki be loaded next. My response from this was that they were already loaded but I suppose no harm in ensuring they are. From the prompt, enter the command wiki load
Trac [c:\svn\trac.db]> wiki load
- Add administrative permissions. Do this by executing the following commands at the prompt, Trac [c:\svn\trac.db]>
permission add admin TRAC_ADMIN
permission add admin TICKET_ADMIN
permission add admin REPORT_CREATE
permission add admin REPORT_MODIFY
permission add admin REPORT_DELETE
permission add admin REPORT_ADMIN
permission add admin WIKI_DELETE
permission add admin WIKI_ADMIN
permission add admin CONFIG_VIEW
permission add admin TRAC_ADMIN
permission add anonymous REPORT_ADMIN
When adding permissions to logins via NT Authentication, use the domain as well. e.g.
permission add DDMES\\wimlach TRAC_ADMIN
It is case sensitive and the double backslash is necessary to escape the backslash.
- Add this Trac support to the Apache httpd.config file found in the
\Program Files\Apache Group\Apache2\conf folder.
# trac support
Alias /trac "c:/Python23/share/trac/htdocs"
<Directory "c:/Python23/share/trac/htdocs">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Location "/cgi-bin/trac.cgi">
SetEnv TRAC_DB "c:/svn/trac.db"
SetEnv TRAC_ENV "c:/svn/trac.db"
</Location>
<Location "/cgi-bin/trac.cgi/login">
#NT Domain auth configuration
AuthType SSPI
SSPIAuth On
SSPIAuthoritative On
SSPIDomain ddmes
SSPIOfferBasic On
AuthName "Trac Sample Project on DBA"
Require valid-user
</Location>
The items in Green above are specific to your installation.
- Now restart the Apache service and test the Trac install by navigating to this URL
http://[hostname]:80/cgi-bin/trac.cgi
Other documentation exists for the Trac installation. Look at the file
TracOnWindows in the \Python23\share\trac\wiki-default folder.
As you begin to work with Trac, you may wish to rename or add/delete categorization terms such as
- Component
- Version
- Severity
- Milestone
- Priority
To manage these lists, use the DOS command as before
c:\Python23\scripts> python trac-admin c:\svn\trac.db
Trac [c:\svn\trac.db]> {component|priority|severity|version|milestone} {add|remove|list|rename} <value> <newvalue>
Or simply type Help at the Trac [c:\svn\trac.db]> prompt.
Also, a nice customization is to use the CTSC logo on the header, replacing the Trac logo.
To do this, copy the ctsc.png file to the \Python23\share\trac\htdocs
directory. Next, edit the trac.ini file in the c:\svn\trac.db\conf
directory. Replace the [header] block with the following:
[header_logo]
src = ctsc.png
alt = Chenega Technology Services Corporation
height = 67
link = http://ctsc.net/
width = 246
If you would like the Trac system to send emails, edit the trac.ini file. This time, change the
smtp_enabled from false to true
[notification]
smtp_replyto = <email of account of admin. e.g. Bill.Shary@ctsc.net>
smtp_always_cc =
smtp_server = <email server, e.g. smtp.gci.net>
smtp_enabled = true
smtp_from = Trac Issue Tracking System