I am trying to configure two Trac instances in order to access them via browser each one with a different url:
http://trac.domain.com/trac1
http://trac.domain.com/trac2
First time I access them Apache response is fine, I get the first Trac with /trac1, then the second one in /trac2. But when I access /trac1 again, it keeps giving me the contents of the second Trac (/trac2). If I touch the .wsgi config file for the first one (say it trac1.wsgi), then request again /trac1 with browser, I get the expected contents again.
The opposite case works equal: access /trac2, then /trac1, then /trac2 keeps giving the contents of /trac1 until I touch trac2.wsgi...
So it seems Python, mod_wsgi and/or Apache are caching results or something. I am not sysadmin and can't get further on this issue.
The .wsgi files and http.conf for Apache:
trac1.wsgi:
import os
os.environ['TRAC_ENV'] = '/home/myuser/trac/trac1'
os.environ['PYTHON_EGG_CACHE'] = '/tmp/'
import trac.web.main
application = trac.web.main.dispatch_request
trac2.wsgi:
import os
os.environ['TRAC_ENV'] = '/home/myuser/trac/trac2'
os.environ['PYTHON_EGG_CACHE'] = '/tmp/'
import trac.web.main
application = trac.web.main.dispatch_request
http.conf:
<VirtualHost trac.domain.com:8080>
WSGIScriptAlias /trac1 /home/myuser/public_html/trac1/apache/trac1.wsgi
WSGIScriptAlias /trac2 /home/myuser/public_html/trac2/apache/trac2.wsgi
<Directory /home/myuser/public_html/trac1/apache>
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
<Location "/trac1">
AuthType Basic
AuthName "Trac1 Trac Auth"
AuthUserFile /home/myuser/public_html/trac1/apache/trac1.htpasswd
Require valid-user
</Location>
<Directory /home/myuser/public_html/trac2/apache>
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
<Location "/trac2">
AuthType Basic
AuthName "Trac2 Trac Auth"
AuthUserFile /home/myuser/public_html/trac2/apache/trac2.htpasswd
Require valid-user
</Location>
</VirtualHost>
If anybody suggests an alternative configuration or whatever, it will be welcome as well. thanks!
Hector