Edgewall Software

Version 91 (modified by anonymous, 12 years ago) ( diff )

Installing and Running Trac on Debian

Note from mgood: I am currently in the process of rewriting this page. It is not currently complete, but should cover the most common topics already. If you have more questions you may want to refer back to the previous revision of this page I have finished.

Note from vinay: Having just installed python2.4 on my debian box (I have an x86-64 box and as such python2.3 has bugs in it for the platform), I went through hell and high water (mainly because of a lack of documentation) to get trac running again (as sarge does not support the python bindings at this time). The short of it is, after upgrading to python2.4, and building my own trac package (just download it and install it manually), I had to download the subversion package (from http://subversion.tigris.org/) and compile the swig-py package:

./configure; make; make install; make swig-py; make install-swig-py

Once that was done, I had to do the following.

echo "/usr/local/lib/svn-python" > /usr/lib/python2.4/site-packages/svn.pth

. To whom it may concern (probably mgood): move this information to wherever it's necessary.

Note from eric: on debian, I installed python2.3-subversion, then it could import svn, hopefully it will work now.

Note from whylee@whylee.at: on debian sarge, after installing trac i had to edit /usr/bin/trac-admin and /usr/lib/python2.3/site-packages/trac/sync.py and eliminate 'util' from some import lines to get trac-admin working. Does not seem to be a really stable package. At the end it did not work out and i added a line in /etc/apt/source.list as described in http://projects.edgewall.com/trac/wiki/TracOnDebianSarge and did an 'apt-cache update' and 'apt-get install trac'. The package from edgewall now works fine.

Note from jesus.climent () hispalinux.es: on debian sarge, you can use https://debian.pumuki.org/trac/trac_0.10.3-0sarge1_all.deb and get a backported, fully functional (with apache2) package, made by me as one of the maintainers of Trac in Debian.

Note: This page does not provide step-by-step instructions for installing and configuring all of Trac. Use this page as a reference for installing the Debian software packages and the locations of configuration files, but you will need to read TracInstall and the other documentation sections for complete instructions on running and configuring Trac.

These instructions require the Debian Sarge release or newer. There are instructions below for installing Trac on Woody. Check http://packages.debian.org/trac to see the latest available Trac version for your Debian release.

These instructions use the commandline tool apt-get to install the packages which you will need to run as the root user. If you prefer to use a graphical tool such as synaptic you can search for the package names mentioned to install them.

Required Packages

 apt-get install trac

Apache

Trac can be run in standalone mode, or with a web server of your choice. Apache is a recommended choice and packages are available for Debian:

 apt-get install apache2

In addition to installing the server itself you will need to install one of the Apache modules mentioned below to allow the Trac application to run under Apache. Each subsection refers to the general Trac documentation for the Apache configuration necessary for that module. On Debian it is recommended to put your Trac Apache configuration statements into a new file called "/etc/apache2/sites-available/trac". Then use the following command to enable your Trac site:

 a2ensite trac

More detailed Apache documentation can be found in the package apache2-doc.

For Trac versions 0.8.x mod_python is recommended. Trac 0.9 also supports FastCGI. CGI instructions are provided, but this is not recommended since mod_python or FastCGI will give significantly better performance.

mod_python

 apt-get install libapache2-mod-python
 a2enmod mod_python

See TracModPython for further instructions.

FastCGI

Note: FastCGI requires Trac 0.9 or higher.

 apt-get install libapache2-mod-fcgid
 a2enmod fcgid

See TracFastCgi for further instructions.

CGI

The CGI module is included with the Apache2 packages, but you will need to ensure that the module is loaded in order to run CGI scripts:

 a2enmod cgi

See TracCgi for further instructions.

SVN

To install subversion mods for Apache, you must run nex:

apt-get install subversion libapache2-svn subversion-tools

Suggested Packages

TracSyntaxColoring requires enscript and WikiRestructuredText requires python-docutils:

    apt-get install enscript python-docutils

Woody (oldstable)

TODO

Comments

I have found that in Ubuntu, a2ensite trac complains about trac site being unexistent. Manu.

This is because you missread (or didn't read) the text (as I did in my first install attempt :-) ) <Quote>On Debian it is recommended to put your Trac Apache configuration statements into a new file called "/etc/apache2/sites-available/trac". Then use the following command to enable your Trac site:</Quote> HTH Marcel

Whilst trying to get Trac working on Debian Sarge with Python 2.3, I got the following error:

PythonHandler trac.web.modpython_frontend: ImportError: No module named web

I found that I had to use this line in the Apache2 config rather than the one given:

    # PythonHandler trac.web.modpython_frontend
    PythonHandler trac.ModPythonHandler

This is because you installed the old/stable 0.8x version of trac, but the pythonhandler trac.web.modpython_frontend is for 0.9x which you get as unstable/testing!

I always have trouble finding this page so I'll post a link here. It's relevent enough that someone could merge it in… latest trac on sarge

Note: See TracWiki for help on using the wiki.