There is a problem with clearsilver on CentOS systems. I get neo_cgi.so module not found. Don’t force yourself, it would simply not work (Trac0.10.4 on CentOS, not unless we try the DAG repositories).

So, I have to use Trac 0.11, setuptools and Genshi.

Prerequisites:
- Must have python 2.3+
- Must have mod_python-3.3.1.tgz
- Must have httpd2.0.x+ or httpd2.2.x

A. Core Trac Installation

1. Install setuptools-0.6c6-py2.3.egg. Download the setuptools according to your python distribution and simply run:

sh setuptools-0.6c4-py2.3.egg

2. Install Genshi. There are numerous ways of installing Genshi.

easy_install Genshi

or


#wget http://ftp.edgewall.com/pub/genshi/Genshi-0.4.2-py2.3.egg
#chmod +x Genshi-0.4.2-py2.3.egg
#easy_install Genshi-0.4.2-py2.3.egg

3. Install Trac 0.11. We need to install trac from svn
#svn co http://svn.edgewall.org/repos/trac/trunk trac
#python ./setup.py install

This would install trac-admin and tracd in /usr/bin.

Trac Post Intall

#mkdir -p /var/www/trac
#cd /var/www/trac
#trac-admin /var/www/trac/poimgr initenv
#chown -Rf nobody:root /var/www
#chmod -Rf 755 /var/www

Just accept the defaults for now, we can change it later on /var/www/trac/poimgr/conf/trac.ini.

C. Apache Configuration

LoadModule python_module /usr/local/apache2/modules/mod_python.so
 
<location>
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnv /var/www/trac/poimgr
PythonOption TracUriRoot /trac/poimgr
#Order deny,allow
#Deny from all
#Allow from 192.168.1.0/24
AuthType Basic
AuthName "TRAC-POIMGR"
AuthUserFile "/repos/svn-auth-file"
require valid-user
</location>

Notes:
http://www.yolinux.com/TUTORIALS/LinuxSubversionAndTracServer.html

Depending on your installation, you may encounter some problems. I had problems with expat errors:


ExpatError (null): line 1,column 0.

Turns out that it was confused between the link libraries of apache and that of python.

#ps aux | grep http | head -3
#sof -p 29982 | grep expat
# strings libexpat.so.0.1.0 | grep expat_
expat_1.95.2
# strings /usr/lib/python2.3/lib-dynload/pyexpat.so | grep expat_
expat_1.95.7
 
Quickfix is to use symbolic links:
#cd /usr/local/apache2/lib/
#cp -Rf /usr/lib/libexpat.so.0.5.0 /usr/local/apache2/lib/
#ln -s libexpat.so.0.5.0 libexpat.so
#ln -s libexpat.so.0.5.0 libexpat.so.0
#su -l
#/etc/init.d/httpd restart

Configuring Trac.
1. I have to move /etc/svn-auth-file to /repos-auth-file. Change the permissions so “nobody” could access it.

2. How to configure my users? Well, since its an intranet application and my trac-users and developers is both in the svn-auth-file, I need a way to configure users easily. Follow these steps from trac-hack.

easy_install http://trac-hacks.org/svn/accountmanagerplugin/trunk

Role base authorisation in trac

trac-admin /var/www/trac/poiclient permission remove anonymous \
TICKET_CREATE TICKET_MODIFY WIKI_CREATE WIKI_MODIFY
 
for n in rupert andrew; do
trac-admin /var/www/trac/{app_name} permission add $n TRAC_ADMIN
done
 
for n in rupert andrew; do
trac-admin /var/www/trac/{app_name} permission add $n WIKI_DELETE
done
 
trac-admin /var/www/trac/poiclient permission add authenticated \
BROWSER_VIEW CHANGESET_VIEW FILE_VIEW LOG_VIEW MILESTONE_VIEW \
REPORT_SQL_VIEW REPORT_VIEW ROADMAP_VIEW SEARCH_VIEW \
TICKET_CREATE TICKET_MODIFY TICKET_VIEW TIMELINE_VIEW \
WIKI_CREATE WIKI_MODIFY WIKI_VIEW

3. Here’s my trac.ini. Things to look at is the notification and account-manager.

4. Deleting a Trac Ticket:

# sqlite3 trac.db
delete from ticket_custom where ticket = [ticketID];
delete from ticket_change where ticket = [ticketID];
delete from ticket where id = [ticketID];

Other References:
http://www.dscpl.com.au/wiki/ModPython/Articles/ExpatCausingApacheCrash
http://www.yolinux.com/TUTORIALS/LinuxSubversionAndTracServer.html
Trac and Multiple Subversion Repositories

Future Work:
http://insurrection.tigris.org/