Trac - Multiple Projects
August 25, 2006 · 3 Comment s
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
#Alias /trac <span class='cc_value'>"d:/appservers/Python23/share/trac/htdocs"</span>
ScriptAlias /trac <span class='cc_value'>"D:/appservers/Apache Group/Apache2/cgi-bin/trac.cgi"</span>
I then commented out the following block and replaced it
#<Location /cgi-bin/trac.cgi>
#SetEnv TRAC_ENV <span class='cc_value'>"d:/svn/la.db"</span>
#SetEnv PYTHONPATH <span class='cc_value'>"d:/Subversion/bin"</span>
# 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 <span class='cc_value'>"c:/svn/trac.db/tmp"</span>
#</Location>
<Location <span class='cc_value'>"/trac"</span>>
SetEnv TRAC_ENV_PARENT_DIR <span class='cc_value'>"d:/svn/"</span>
SetEnv PYTHONPATH <span class='cc_value'>"d:/Subversion/bin"</span>
</Location>
I then updated the authentication block by doing ... and this allows us to share the same password file across all our projects.
#<Location /cgi-bin/trac.cgi/login>
# AuthType Basic
# AuthName <span class='cc_value'>"LA"</span>
# AuthUserFile passwd
# C:/svn/.htaccess
# AuthGroupFile svngroup
# Require valid-user
#</Location>
<LocationMatch <span class='cc_value'>"/trac/[^/]+/login"</span>>
AuthType Basic
AuthName <span class='cc_value'>"Trac"</span>
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. Tags: Trac

3 response s so far ↓
1 Wayne Graham // Aug 25, 2006 at 3:10 PM
<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.
2 Gucci Bag // Aug 28, 2009 at 9:36 AM
3 ed hardy mens Jeans // Sep 17, 2009 at 9:18 AM
Leave a Comment