Back To The Main Support Page

Installing and Configuring Edgewall trac on your Slingshot server

What is Trac?

"Trac is an enhanced wiki and issue tracking system for software development projects. Trac uses a minimalistic approach to web-based software project management. Our mission is to help developers write great software while staying out of the way. Trac should impose as little as possible on a team's established development process and policies." -- Edgewall Software - The Trac Project

How to Install

Enable the Dag and Dries repos for just these packages.

Create a file in /etc/yum.repos.d/Dag-KBS-Extras.repo

[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=0
includepkgs=clearsilver python-clearsilver trac

[kbs-CentOS-Extras]
name=CentOS.Karan.Org-EL$releasever - Stable
gpgcheck=1
gpgkey=http://centos.karan.org/RPM-GPG-KEY-karan.org.txt
enabled=0
baseurl=http://centos.karan.org/el$releasever/extras/stable/$basearch/RPMS/
includepkgs=python-docutils python-imaging
Let's install their GPG keys.
rpm --import http://centos.karan.org/RPM-GPG-KEY-karan.org.txt

rpm --import http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
If you get an error importing the dag key, try copy-pasting the key without the comments into a file and importing that. Note that they are not enabled, so to use them, we run:
yum --enablerepo=dag --enablerepo=kbs-CentOS-Extras install trac python-docutils python-imaging
Create an svn repository to go along with this (or use an existing one).
mkdir -p /var/svn/repos
svnadmin create /var/svn/repos/test
Set the permissions for the apache user:
chown -R apache:apache /var/svn/repos/test
Now, create the trac repository:
trac-admin /var/lib/trac/test initenv
You can answer the default by just pressing enter, or customize now. Here's what I chose, where it is blank, I accepted the default:
Project Name [My Project]> Testing 123

Database connection string [sqlite:db/trac.db]> 

Repository type [svn]> 

Path to repository [/path/to/repos]> /var/svn/repos/test

Templates directory [/usr/share/trac/templates]> 
Now, let's create a user or two. You can also opt to use your svnusers file if you're using svn over webdav:
mkdir -p /etc/tracd
htpasswd -c /etc/tracd/tracusers test@test.com
To add another user:
htpasswd /etc/tracd/tracusers bob@bob.com
Now, install this simple tracd start script to run the simple tracd server:
curl -Os http://svn.highgroove.com:8080/deployment/trunk/tracd
cp tracd /etc/init.d/tracd
chmod +x /etc/init.d/tracd
Now, you can customize it by editing the OPTIONS line, or simply add a config file named /etc/sysconfig/tracd with the single line:
OPTIONS="-s -r -d -p 9000 --basic-auth=*,/etc/tracd/tracusers,trac /var/lib/trac/test"
Where you specify where your Basic Auth user file will be stored (/etc/tracd/tracusers) and where your trac repository lives (/var/lib/trac/test). Start it:
/etc/init.d/tracd start
And set it to come up on boot:
chkconfig tracd on
Now you can setup a quick proxy server so you don't have to type your servername:9000 (port 9000) to access the repository if you'd like. The apache config file can be stuffed into the /etc/rails/ directory, named trac.conf:
<VirtualHost *:80>
    ServerName trac.yourapp.com
    ServerAlias www.trac.yourapp.com

    ProxyPass / http://localhost:9000/
    ProxyPassReverse / http://localhost:9000
    ProxyPreserveHost on
</VirtualHost>
Reload apache for the changes to take effect:
/etc/init.d/apache2 reload
Now you can access it at http://trac.yourapp.com/