trac 0.11b2 installed and running within $HOME

Installing applications and libraries on systems from source isnt a very pleasant experience especially when you want the very latest version of a particular application.

Back in the day it was accepted and common practice to install the libraries your application depended on plus the application from source by running './configure && make install' and hope for the best. You'd consider yourself lucky if your applications Makefile supported PREFIX= so you could use PREFIX=/opt or PREFIX=/usr/local.

Enough of that.. thank you.

Below is how ive been able to install trac with confining everything within a users $HOME directory on a debian etch system running python 2.4.

Prepare your new $PYTHONPATH and install easy_install

$ mkdir -p ~/lib/python2.4/site-packages 
$ export PYTHONPATH=~/lib/python2.4/site-packages:$PYTHONPATH
$ mkdir ~/bin
$ mkdir -p ~/src/easy_install
$ cd ~/src/easy_install
$ wget http://peak.telecommunity.com/dist/ez_setup.py
$ python ez_setup.py --prefix ~/
Add ~/bin to your path
$ export PATH=~/bin:$PATH
Install trac and related libraries
$ sudo apt-get install python-pygments python-genshi \
    python-pysqlite1.1 python-subversion \
    python-setuptools 
$ easy_install --prefix ~/ Trac
Setup a subversion repository
$ mkdir -p ~/var/repos/svn
$ svnadmin create ~/var/repos/svn
At this stage you should be right to create a trac project
$ mkdir -p ~/var/repos/trac
$ trac-admin ~/var/repos/trac/my-project initenv
Use /home/$USERNAME/var/repos/svn for the path to the svn repository. Substitute $USERNAME.

You can run the tracd daemon to view an instance of my-project within trac

$ tracd --port 8000 ~/var/repos/trac/my-project
Or you can use modpython and hook trac into Apache.

The following apache virtualhost configuration file should get you there

<VirtualHost *:80>
    ServerName $TRAC_HOSTNAME

    <Location "/">
        SetHandler mod_python
        PythonHandler trac.web.modpython_frontend
        PythonInterpreter main_interpreter
        PythonPath "sys.path + ['/home/$USERNAME/lib/python2.4/site-packages/Trac-0.11b2-py2.4.egg/']"
        PythonOption TracEnv /home/$USERNAME/var/repos/trac/my-project
        PythonDebug On
    </Location>

    <Location "/login">
        LoadModule auth_digest_module /usr/lib/apache2/modules/mod_auth_digest.so
        AuthType Digest
        AuthName "trac"
        AuthDigestDomain /trac
        AuthUserFile /home/$USERNAME/var/repos/trac/trac.htpasswd
        Require valid-user
    </Location>


    ErrorLog /home/$USERNAME/var/log/apache2/$TRAC_HOSTNAME.error.log
    CustomLog /home/$USERNAME/var/log/apache2/$TRAC_HOSTNAME.access.log combined
</VirtualHost>
Dont forget to setup your htpasswd, create your log directories and make the trac repository writable by the system user running apache. Also substitute $USERNAME with your username and $TRAC_HOSTNAME with your servers hostname.
$ mkdir -p ~/var/log/apache2/
$ sudo chown -R www-data:  ~$USERNAME/var/repos/trac/my-project
$ htdigest -c ~/var/repos/trac/trac.htpasswd trac admin 
If ive missed anything i apologise.. my head hurts.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Captcha
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
four * = 16
Solve this math question and enter the solution with digits. E.g. for "two plus four = ?" enter "6".