I'm attempting to configure two Trac instances to be able to access them via browser each with another url:

http://trac.domain.com/trac1
http://trac.domain.com/trac2

Very first time I access them Apache fact is fine, I recieve the very first Trac with /trac1, then your second one out of /trac2. However when I access /trac1 again, it keeps giving me the items in the 2nd Trac (/trac2). Basically touch the .wsgi config apply for the first (say it trac1.wsgi), then request again /trac1 with browser, I recieve the expected contents again.

The alternative situation works equal: access /trac2, then /trac1, then /trac2 keeps giving the items in /trac1 until I touch trac2.wsgi...

Therefore it appears Python, mod_wsgi and/or Apache are caching results or something like that. I'm not sysadmin and should not get further about this problem.

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 indicates an alternate configuration or whatever, it will likely be welcome too. thanks!

Hector

I discovered the answer myself, it had been around the Trac documentation ("important note" section), and I didn't event take look, fool of me :P

http://trac.edgewall.org/wiki/TracModWSGI

Move your egg cache to split up dirs

trac1.wsgi:

import os

os.environ['TRAC_ENV'] = '/home/myuser/trac/trac1' 
os.environ['PYTHON_EGG_CACHE'] = '/tmp/trac1'

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/trac2'

import trac.web.main
application = trac.web.main.dispatch_request