Quick Trac : A Quick Installation

The Trac is a software project management and issue tracking system oriented for development projects. It comes with an integrated Wiki, an interface to version control systems and a number of convenient ways to keep in track of changes within a project. Trac was in fact inspired by the CVSTrac, another project management and issue tracking system.

Trac is written employing the Python programming language and requires a database (SQLite, PostgreSQL or MySQL) for its implementation. For HTML rendering, this software uses the Genshi templating system.

The following URL gives a listing of its supported platforms and also its various distributions :

This article focuses on a simple and quick method to install Trac in CentOS distribution.


First, you need to download the MySQL python bindings from :

1. Install Python and its related binding using yum.

yum install python

2. In order to run python scripts as a module using apache, you will need to install mod_python using :

yum install mod_python

3. Install MySQL-python in order that python can interact with MySQL

wget http://downloads.sourceforge.net/mysql-python/MySQL-python-1.2.2.tar.gz
tar xzf MySQL-python-1.2.2.tar.gz
cd MySQL-python-1.2.2
python setup.py build && python setup.py install

OR you can also try installing it using yum as follows :

yum install MySQL-python.i386

4. Install the devel packages that are required for compilation of trac and svn integration as follows :

yum install neon neon-devel python-devel swig

5. Trac requires Clearsilver, a templating package in order to serve HTML rendering. To install it, use the following steps :

wget http://www.clearsilver.net/downloads/clearsilver-0.10.5.tar.gz
tar xzf clearsilver-0.10.5.tar.gz
cd clearsilver-0.10.5
./configure && make && make install

6. Finally to install Trac, do the following :

wget http://ftp.edgewall.com/pub/trac/Trac-
tar xzf Trac-
cd Trac-
python setup.py install

There are chances that this may produce the following error :

“ImportError: No module named setuptools”

In this case, you will need to install the “setuptools” to resolve the issue:

wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c8.tar.gz
tar xfvz setuptools-0.6c8.tar.gz
cd setuptools-0.6c8
python setup.py build
python setup.py install

7. Initialize your first Trac project using the command :

trac-admin /srv/trac/ initenv

8. Add proper “SetHandler”, “PythonHandler” and “PythonOption” tags in the Location section (“Location /”) of the Apache configuration file.

An example is as mentioned below:

SetHandler mod_python
PythonHandler trac.web.mod python_frontend
PythonOption TracEnv $pathtoyourtracproject
PythonOption TracUriRoot /trac/

In my case, I added the following, since my ‘pathtoyourtracproject’ is /srv/trac :

SetHandler mod_python
PythonHandler trac.web.mod python_frontend
PythonOption TracEnv /srv/trac/
PythonOption TracUriRoot /trac/

Now, restart Apache for the changes to take effect.

The output of “trac-admin /srv/trac/ initenv” will be as follows:

Warning: couldn't index the repository.

This can happen for a variety of reasons: wrong repository type,
no appropriate third party library for this repository type,
no actual repository at the specified repository path...

You can nevertheless start using your Trac environment, but
you'll need to check again your trac.ini file and the [trac]
repository_type and repository_path settings in order to enable
the Trac repository browser.

Project environment for 'First project Joseph Symon' created.

You may now configure the environment by editing the file:

/srv/trac/conf/trac.ini =>
default_charset = UTF-8

If you'd like to take this new project environment for a test drive,
try running the Trac standalone web server `tracd`:

  tracd --port 8000 /srv/trac

root@josephsym//usr/src/trac/Trac-  tracd --port 8000 /srv/trac
Server starting in PID 23684.
Serving on view at

IP - - [03/Feb/2009 14:51:49] "GET /trac HTTP/1.1" 200 -
IP - - [03/Feb/2009 14:51:50] "GET /trac/chrome/common/css/trac.css HTTP/1.1" 200 -
IP - - [03/Feb/2009 14:51:50] "GET /trac/chrome/common/css/wiki.css HTTP/1.1" 200 -
IP - - [03/Feb/2009 14:51:50] "GET /trac/chrome/common/css/code.css HTTP/1.1" 200 -
IP - - [03/Feb/2009 14:51:50] "GET /trac/chrome/common/js/jquery.js HTTP/1.1" 200 -
IP - - [03/Feb/2009 14:51:50] "GET /trac/chrome/common/trac.ico HTTP/1.1" 200 -
IP - - [03/Feb/2009 14:51:50] "GET /trac/chrome/common/js/trac.js HTTP/1.1" 200 -
IP - - [03/Feb/2009 14:51:50] "GET /trac/chrome/common/js/search.js HTTP/1.1" 200 -
IP - - [03/Feb/2009 14:51:50] "GET /trac/chrome/common/trac_logo_mini.png HTTP/1.1" 200 -
IP - - [03/Feb/2009 14:51:51] "GET /trac/chrome/common/topbar_gradient.png HTTP/1.1" 200 -
IP - - [03/Feb/2009 14:51:51] "GET /trac/chrome/common/dots.gif HTTP/1.1" 200 -
IP - - [03/Feb/2009 14:51:51] "GET /trac/chrome/common/extlink.gif HTTP/1.1" 200 -
IP - - [03/Feb/2009 14:51:51] "GET /trac/chrome/site/your_project_logo.png HTTP/1.1" 404 -
IP - - [03/Feb/2009 14:51:53] "GET / HTTP/1.1" 200 -
IP - - [03/Feb/2009 14:51:53] "GET /favicon.ico HTTP/1.1" 404 -
IP - - [03/Feb/2009 14:51:56] "GET /trac HTTP/1.1" 200 -
IP - - [03/Feb/2009 14:51:57] "GET /trac/chrome/site/your_project_logo.png HTTP/1.1" 404 -
IP - - [03/Feb/2009 14:52:00] "GET /trac/wiki HTTP/1.1" 200 -
IP - - [03/Feb/2009 14:52:00] "GET /trac/chrome/site/your_project_logo.png HTTP/1.1" 404 -
Now, point your browser to http://IP:8000/trac to access the installed software.




Currently, only the Subversion versioning system is supported in Trac. In future, Trac will probably support other systems like CVS. You can keep track of this at http://trac.edgewall.org/wiki/VersioningSystemBackend. Meanwhile, Trac is an excellent tool for tracking software development projects and SVN integration. It’s ease of use helps your clients also use the system to find out how far along you are. This in fact, saves times that would otherwise be spent in meetings, phone calls and emails, and thereby increases productivity and efficiency easily and with minimum fuss.



About the Author :

Joseph Symon has been with Bobcares for more than two years. He has marked his presence in the company through his contributions towards enriching the knowledge level in the company. He is a Linux expert, and specializes in installing and configuring systems and customizing them for specific needs. Joseph is highly passionate about learning new technologies.

Bobcares is a server management company that helps businesses deliver uninterrupted and secure online services. Our engineers manage close to 51,500 servers that include virtualized servers, cloud infrastructure, physical server clusters, and more.

Related Posts