Michael Goettsche wrote:
Hi there,
I'm setting up a complex Trac setup with many projects and thus am using
TracEnvParentDir.
My approach works except that a broken Trac project is displayed where at most
the project listing should be shown.
Here are the Trac related lines of my apache config:
<Macro TracProjects $projectname>
<Location /trac/$projectname>
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /var/projects/$projectname/trac
PythonOption TracUriRoot /trac/$projectname
</Location>
<LocationMatch "/trac/$projectname/[^/]+/login">
AuthType Basic
AuthName "$projectname"
AuthUserFile /var/projects/$projectname/$projectname.passwd
Require valid-user
</LocationMatch>
</Macro>
Is this really what you want? Do you have multiple projects under the
/var/projects directory? or do you have multiple projects under the
/var/projects/$projectname/trac directory?
If the Macro part confuses you, just replace the $projectname part with a real
name in mind.
Assume the project name is 134117 and there's a Trac instance called 134117 in
the /var/projects/134117/trac directory.
If this is that case (that the project directory is .../trac) then you
want to be using TRAC_ENV instead of TRAC_ENV_PARENT_DIR.
If you are trying to do what I think you are trying to do, then you
don't need the macro bit. Here is how I have trac setup:
I have multiple projects, they all live on the filesystem under
/var/projects/trac. So I have /var/projects/trac/project1 and
/var/projects/trac/project2, etc.
The URL that I use to access these projects is:
http://some.domain/projects/project1 and
http://some.domain/projects/project2, etc.
Here is the relevant trac configuration:
<Location /projects>
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracUriRoot /projects
PythonOption TracEnvParentDir "/var/projects/trac"
SetEnv PYTHON_EGG_CACHE "/var/projects/egg_cache"
</Location>
<LocationMatch ^/projects/[[:graph:]]+/login>
AuthType Basic
AuthName "Project Login"
AuthUserFile /var/projects/conf/projectusers
Require valid-user
</LocationMatch>
The only thing that this doesn't do, is have a separate htpasswd file
for each project. You could probably modify your macro hack to
accommodate that.
I hope this helps. I don't think that I really understand what you are
trying to accomplish, but to me, it looks as though you are using the
TRAC_ENV_PARENT_DIR wrong. Remember, it is supposed to point the parent
directory of your trac project, not the trac project itself.
-John
_______________________________________________
Trac mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac