Installing Trac

Gregg Pollack (gregg at patchedsoftware dot com) contributed this walkthrough.

The following are the commands will get trac running on your server.

  1. sudo vi /etc/sysconfig/rhn/sources
    1. add ‘yum rpmforge http://apt.sw.be/redhat/el4/en/i386/dag/’ at the end of this file
  2. sudo rpm —import http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
  3. wget http://dag.wieers.com/packages/rpmforge-release/rpmforge-release-0.3.4-1.el4.rf.i386.rpm
  4. rpm -Uvh rpmforge-release-0.3.4-1.el4.rf.i386.rpm
  5. sudo up2date -i trac
  6. sudo yum install httpd-devel
  7. wget http://apache.mirrors.tds.net/httpd/modpython/mod_python-3.2.10.tgz
  8. tar -xzvf mod_python-3.2.10.tgz
  9. cd mod_python-3.2.10
  10. ./configure —with-apxs2=/usr/sbin/apxs
  11. sudo yum install python-devel
  12. make
  13. su
  14. make install
  15. sudo vi /etc/httpd/conf/httpd.conf
  16. Add LoadModule python_module /usr/lib/httpd/modules/mod_python.so
  17. Make a trac directory – mkdir /var/www/apps/trac
  18. Create a trac project – trac-admin /var/www/apps/trac/ProjectA initenv
  19. Added to httpd.config
<VirtualHost *:80>
  ServerName trac.projectA.com
   <Location />
   SetHandler mod_python
   PythonHandler trac.web.modpython_frontend
   PythonOption TracEnv /var/www/apps/trac/ProjectA
   PythonOption TracUriRoot /
 </Location>
 <Location "/login">
   AuthType Basic
   AuthName "trac"
   AuthUserFile /etc/svn-auth-file
   Require valid-user
 </Location>
</VirtualHost>

As you can see, we’re using and svn-auth-file to do security. Checkout the mod_dav_svn tutorial if you don’t know how.

Restart Apache, and you should be golden. If you want more security (since the default trac allows anyone to go in and post stuff), move all the Auth lines in the second location tag into the first, so that Basic Authentication is needed to view the site at all.

Meta