Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i have a situation with many trac instances. They all have the same structure in the filesystem.

PATH/trac1
PATH/trac2
PATH/trac3

i have this configuration

<Location /trac/trac1>
 SetHandler mod_python
 PythonInterpreter main_interpreter
 PythonHandler trac.web.modpython_frontend 
 PythonOption TracEnv PATH/trac1
 PythonOption TracUriRoot /trac/trac1
 PythonOption PYTHON_EGG_CACHE PATH/eggs/
</Location>
<Location /trac/trac2>
 SetHandler mod_python
 PythonInterpreter main_interpreter
 PythonHandler trac.web.modpython_frontend 
 PythonOption TracEnv PATH/trac2
 PythonOption TracUriRoot /trac/trac2
 PythonOption PYTHON_EGG_CACHE PATH/eggs/
</Location>
<Location /trac/trac3>
 SetHandler mod_python
 PythonInterpreter main_interpreter
 PythonHandler trac.web.modpython_frontend 
 PythonOption TracEnv PATH/trac3
 PythonOption TracUriRoot /trac/trac3
 PythonOption PYTHON_EGG_CACHE PATH/eggs/
</Location>

i wonder if it's possible to do something like (TracEnvParentDir is not an option)

<Location /trac/{ENV}>
 SetHandler mod_python
 PythonInterpreter main_interpreter
 PythonHandler trac.web.modpython_frontend 
 PythonOption TracEnv PATH/{ENV}
 PythonOption TracUriRoot /trac/{ENV}
 PythonOption PYTHON_EGG_CACHE PATH/eggs/
</Location>

Thank you for your time.

EDIT: TracEnvParentDir is not an option because my structure is the following

+---projs
    +---trac1
    ¦   +---public [instance]
    ¦   +---t1
    ¦   ¦   +---common [instance]
    ¦   ¦   +---g1 [instance]
    ¦   ¦   +---g2 [instance]
    ¦   ¦   +---g3 [instance]
    ¦   ¦   +---g4 [instance]
    ¦   ¦   +---g5 [instance]
    ¦   +---t2
    ¦   ¦   +---common [instance]
    ¦   ¦   +---g1 [instance]
    ¦   ¦   +---g2 [instance]
    ¦   ¦   +---g3 [instance]
    ¦   ¦   +---g4 [instance]
    ¦   ¦   +---g5 [instance]
    ¦   +---t3
    ¦       +---common [instance]
    ¦       +---g1 [instance]
    ¦       +---g2 [instance]
    ¦       +---g3 [instance]
    ¦       +---g4 [instance]
    ¦       +---g5 [instance]
    ¦  
    +---trac2
        +---public [instance]
        +---t1
        ¦   +---common [instance]
        ¦   +---g1 [instance]
        ¦   +---g2 [instance]
        ¦   +---g3 [instance]
        ¦   +---g4 [instance]
        ¦   +---g5 [instance]
        +---t2
        ¦   +---common [instance]
        ¦   +---g1 [instance]
        ¦   +---g2 [instance]
        ¦   +---g3 [instance]
        ¦   +---g4 [instance]
        ¦   +---g5 [instance]
        +---t3
            +---common [instance]
            +---g1 [instance]
            +---g2 [instance]
            +---g3 [instance]
            +---g4 [instance]
            +---g5 [instance]

I use the TracEnvParentDir on t1, t2 and t3 and TracEnv on trac1/public and trac2/public

I wonder if it's possible to define a part of the url variable.

share|improve this question
    
Can you explain why TracEnvParentDir is not an option? –  retracile Jun 4 '10 at 13:47
add comment

2 Answers

up vote 0 down vote accepted

You may want to switch to mod_wsgi instead of modpython, and see my answer here how to do what you want: http://serverfault.com/questions/111000/dynamic-subdomains-mod-python-and-trac/111320#111320

share|improve this answer
add comment

The official mod_wsgi documentation on integrating Trac with mod_wsgi tells you about how to do this. See:

http://code.google.com/p/modwsgi/wiki/IntegrationWithTrac

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.