Trac setup

From DiLab
Revision as of 16:28, 8 October 2008 by Leo (talk | contribs) (Upgrade)
Jump to: navigation, search

Look at the Trac website for more: TracInstall

Installation

This was used for Trac 0.11

The easy way, but not necessarily the latest stable version:

sudo apt-get install trac

For the latest stable version do the following:

Get the dependencies

sudo apt-get install subversion python sqlite 
sudo apt-get install python-clearsilver python-sqlite python-subversion

Get the "setuptools" and "easy_install" unless you have them already

wget http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c9-py2.6.egg
sudo sh ./setuptools-0.6c9-py2.5.egg

Install the latest Trac (use only one method from below)

sudo easy_install trac

...or for a specific version (0.11)

sudo easy_install http://svn.edgewall.org/repos/trac/tags/trac-0.11

...or download the source and run setup.py:

wget http://ftp.edgewall.com/pub/trac/Trac-0.11.1.tar.gz
tar -xvvzf Trac-0.11.1.tar.gz
cd Trac-0.11.1
sudo python ./setup.py install


Setup

First, set up your subversion repository, if any. Then, create a new trac project environment, e.g.

trac-admin /var/lib/trac/projenv initenv

Now setup your webserver (apache2 in my case) and restart it. Alternatively you can run tracd for the trac envirionment (see the trac wiki)


Configure

Lots of things to configure. Add project picture to the web interface in trac.ini. Add users, setup permissions under the Admin tab. Configure milestones and other parameters. See Trac wiki for more.


Upgrade

You may want to upgrade your earlier trac version tickets and wiki. First, back up the old trac project environment (repository) using

trac-admin /var/lib/trac/projenv hotcopy <backup-directory>

Then remove the previous trac version and install the new version. Finally, upgrade the trac project

trac-admin /path/to/projenv upgrade
trac-admin /path/to/projenv wiki upgrade

Now test it!


Multiple Projects

More info: http://trac.edgewall.org/wiki/TracUbuntuMultipleProjects

sudo apt-get install libapache2-mod-python

Set the location for your projects

sudo mkdir /var/lib/trac
sudo chown www-data:www-data /var/lib/trac

Add this in your /etc/apache2/sites-available/... site configuration file for trac

<Location /proj>

    SetHandler mod_python    
    PythonHandler trac.web.modpython_frontend    
    PythonOption TracEnvParentDir /var/lib/trac    
    PythonOption TracUriRoot /proj    

</Location>