After googling the internet for hours I managed to get the perfect trac + svn setup. Because we use contractors at work, I needed a setup where the security is global but at the same time based on project by project basis. Therefore trac uses a global .htaccess and svn uses the authz file for authentication. At the moment this is working greate. To set up a new trac project is simply a case of creating the project, copying a base projects database and config file and then editing the new project’s config file.

We use a base project that is configured for all our core developers, which means im not adding the same permissions and groups all the time.

How I configured it:

apache svn config:

<Location /projects/test2>
DAV svn

# Set this to the path to your repository
SVNPath /var/svn/test2

AuthType Basic
AuthName “Test2 Project”
AuthUserFile /var/trac/.htpasswd
AuthzSVNAccessFile /var/svn/authz
Require valid-user
</Location>

apache trac config:

<VirtualHost *:80>
RewriteEngine on
RewriteCond /var/trac/$1 -d
RewriteRule ^/([^/.]+)(/?.*) /trac.cgi$2 [S=1,E=TRAC_ENV:/var/trac/$1]

ServerAdmin tim@domain.com
ServerName trac.domain.com

DocumentRoot /usr/share/trac/cgi-bin/

AddHandler cgi-script .cgi

<Directory /usr/share/trac/cgi-bin/>
Options Indexes FollowSymLinks MultiViews ExecCGI
AllowOverride All
Order allow,deny
allow from all
</Directory>

Alias /trac “/usr/share/trac/htdocs”

<Location />
SetEnv TRAC_ENV_PARENT_DIR “/var/trac”
SetEnv PYTHON_EGG_CACHE /var/trac/egg_cache
</Location>

DirectoryIndex trac.cgi
ErrorLog /var/log/apache2/error.trac.log
CustomLog /var/log/apache2/access.trac.log combined

</VirtualHost>

The above configuration means that all users are in one file, and can be controlled globally. Below are the plugins which i have installed and consider very helpful.

Plugins - Below are some of the plugin which I think really help

iniadmin

trac account manager

trac svn authz

trac web admin

timing and estimatation

pagetopdf

Trac table of contents macro

XMLRPC

One Response to “Trac + SVN”
  1. Kip says:

    Fantastic. Trac has had me pulling my hair out for a week. Thanks. What helped me most is your list of plugins.

Leave a Reply