User Tools

Site Tools


project_management:trac

Trac

Create a new Trac project

$ sudo trac-admin /var/lib/trac/myproject initenv

Change the permissions so the Apache user can manage the Trac environment:

$ sudo chown -R www-data:www-data /var/lib/trac/myproject

Configure Apache

Configure Apache to use Python for '/trac' URLs. Put settings in a new configuration file, /etc/apache2/conf.d/trac.conf:

<Location /trac>
     SetHandler mod_python
     PythonHandler trac.web.modpython_frontend
     PythonOption TracEnvParentDir /var/lib/trac
     PythonOption TracUriRoot /trac
</Location>

The TracEnvParentDir option tells it to allow access to all Trac instances in the specified directory.

Active Directory authentication

Add Active Directory support for login URLs:

<Location /trac/myproject/login>
   AuthName "Microsoft Active Directory Authentication"
   AuthType Basic
   
   PerlAuthenHandler Apache2::AuthenMSAD
   PerlSetVar MSADDomain ilri.cgiarad.org
   PerlSetVar MSADServer 172.26.0.218
   
   #require valid-user
   require user aorth akihara jmagochi
</Location>

This will tie Active Directory authentication into the login system for Trac. We use the same scheme for SVN too, so users will be able to log in as the same user they are submitting code as.

Add a user as an admin in a particular Trac project:

$ sudo trac-admin /var/lib/trac/myproject permission add aorth TRAC_ADMIN

Resync Trac/SVN

If your Trac gets out of sync with your SVN repository you will have to resync them:

$ sudo trac-admin /var/lib/trac/myproject resync
Resyncing repository history... 
1 revision cached.
Done.
project_management/trac.txt · Last modified: 2010/06/09 15:10 by 172.26.14.218