On Mar 31, 2006, at 2:22 PM, Brad Fuller wrote:
Matthew Gillen wrote:
Brad Fuller wrote:
Matthew Gillen wrote:
Brad Fuller wrote:
I've googled for this and can't find the answer. I would think
this would be a common config, but so far have found nothing.
Apologies if it's out there and I just haven't found it yet. I
would like to set up multiple, separate projects thru a virtual
host that uses a specific port. Can that be done?
I don't see why not. See http://projects.edgewall.com/trac/wiki/
TracModPython (the "Setting up multiple projects" section) You
can use the Location directive specified within a Virtual Host.
Ok, how do you use a location directive specific to a virtual
host? Can the directive be _inside_ the directive? I thought it
had to be outside.
The link above to the Trac Guide has an example:
--------------------- Virtual Host Configuration Below is the
sample configuration required to set up your trac as a virtual
server (i.e. when you access it at the URLs like http://
trac.mycompany.com): DocumentRoot /var/trac/myproject ServerName
trac.mycompany.com SetHandler mod_python PythonHandler
trac.web.modpython_frontend PythonOption TracEnv /var/trac/
myproject PythonOption TracUriRoot / AuthType Basic AuthName
"MyCompany Trac Server" AuthUserFile /var/trac/myproject/.htusers
Require valid-user
Thanks for the help, I appreciate it. Here's what I've tried that
doesn't work:
<VirtualHost *:8000>
DocumentRoot /var/trac
ServerName my.domain.com
<Directory />
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnv /var/trac
PythonOption TracUrlRoot /
</Directory>
<Location /project>
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /var/trac/project
PythonOption TracUriRoot /var/trac <--- tried
removing option- didn't help
</Location>
</VirtualHost>
/var/trac is just an empty dir
/var/trac/project is a trac enabled project
svn is at: /var/svn/project
If I try to access: http://my.domain.com:8000/ or http://
my.domain.com:8000/project I get internal server error 500.
tried removing, butdidn't help
PythonOption TracUriRoot /var/trac
If I change DocumentRoot to /var/trac/project it works. But, of
course, then I wouldn't be able to have multiple projects.
Note that I have several <VirtualHost *:80> above this.
This style works for me, and I don't think the :80 matters--could be :
8000 as well:
<VirtualHost *:80>
ServerName project.emsoftware.com
ServerAlias trac.emsoftware.com
DocumentRoot "/Users/trac/"
<Location />
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /Users/trac
PythonOption TracUriRoot /
Allow from all
AuthType Basic
AuthName "Trac repository"
AuthUserFile /usr/local/etc/passwd
Require valid-user
</Location>
</VirtualHost>
Cheers!
--Chris Ryland / Em Software, Inc. / www.emsoftware.com
_______________________________________________
Trac mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac