Trac - Multiple Projects
In my previous entry I quickly went through the process of setting up Trac. This set up basically worked with a single project.
You can of course support multiple projects via a single trac installation and that's what I'm going to show below.
The first thing I did was get rid of the following Alias, and replace it with ScriptAlias
ScriptAlias /trac "D:/appservers/Apache Group/Apache2/cgi-bin/trac.cgi"
I then commented out the following block and replaced it
#SetEnv TRAC_ENV "d:/svn/la.db"
#SetEnv PYTHONPATH "d:/Subversion/bin"
# if you are running Apache as a user other than System, the TMP variable
# needs to be set to a place where that user can write scratch files. Make
# sure that this directory is created and writable by that user.
#SetEnv TMP "c:/svn/trac.db/tmp"
#</Location>
<Location "/trac">
SetEnv TRAC_ENV_PARENT_DIR "d:/svn/"
SetEnv PYTHONPATH "d:/Subversion/bin"
</Location>
I then updated the authentication block by doing ... and this allows us to share the same password file across all our projects.
# AuthType Basic
# AuthName "LA"
# AuthUserFile passwd
# C:/svn/.htaccess
# AuthGroupFile svngroup
# Require valid-user
#</Location>
<LocationMatch "/trac/[^/]+/login">
AuthType Basic
AuthName "Trac"
AuthUserFile passwd
AuthGroupFile svngroup
Require valid-user
</LocationMatch>
Restart Apache and you're off...
http://mysite/trac/
Doing this will get you a list of projects you can choose from, or you can just do
http://mysite/trac/<projectname>
I should point out that there are other ways of running Trac, and different ways of supporting multiple projects. Also as I'm still learning all this stuff myself, I may not be getting everything "right", so feel free to shout in if you have suggestions.
I think I'll follow this up by talking about users and permissions ... though I believe I need to write the next entry for my AdminAPI series.



<Location /trac>
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir c:/svn/trac.db/tmp
PythonOption TracUriRoot /trac
</Location>
For more complete instructions, check out http://trac.edgewall.org/wiki/TracModPython.