Edgewall Software
Modify

Opened 14 years ago

Closed 12 years ago

#2713 closed enhancement (fixed)

Enhance Mod Python documentation regarding multiple Trac instances in a single virtualhost

Reported by: gergely.kis@… Owned by: Christopher Lenz
Priority: normal Milestone: not applicable
Component: web frontend/mod_python Version: 0.9.3
Severity: normal Keywords: documentation
Cc: Branch:
Release Notes:
API Changes:

Description

If you use multiple Trac instances (e.g. different trac versions) in a single virtualhost, then you will need to add a

PythonInterpreter  myproject_python

directive into the Location section. For example:

<Location /projects/myproject1>
   SetHandler mod_python
   PythonHandler trac.web.modpython_frontend 
   PythonOption TracEnv /var/trac/myproject
   PythonOption TracUriRoot /projects/myproject
   PythonPath "sys.path + ['/path/to/trac-version1/lib/python2.3/site-packages']"
   PythonInterpreter myproject1_python
</Location>

<Location /projects/myproject2>
   SetHandler mod_python
   PythonHandler trac.web.modpython_frontend 
   PythonOption TracEnv /var/trac/myproject
   PythonOption TracUriRoot /projects/myproject
   PythonPath "sys.path + ['/path/to/trac-version2/lib/python2.3/site-packages']"
   PythonInterpreter myproject2_python
</Location>

The value of PythonInterpreter does not matter as long as it is unique in a virtual host.

The idea was taken from the Django documentation: http://www.djangoproject.com/documentation/modpython/

Attachments (0)

Change History (4)

comment:1 by Christian Boos, 13 years ago

Caveat: using different "PythonInterpreter" may introduce issues, like trigerring segfaults in the Subversion python bindings. See #3455.

comment:2 by Christian Boos, 13 years ago

Milestone: none

As using different Python interpreters is not recommended when using Subversion and might be problematic for other C extensions, we shouldn't advise to use that setup, quite the opposite.

Those caveats should be more clearly exposed in the TracModPython page though.

in reply to:  2 comment:3 by osimons, 12 years ago

Replying to cboos:

Those caveats should be more clearly exposed in the TracModPython page though.

Isn't the current wiki:TracModPython#Subversionissues (and the page as a whole) a balanced treatment of the issue for this ticket? Close?

comment:4 by Christian Boos, 12 years ago

Resolution: fixed
Status: newclosed

Right, it looks like the PythonInterpreter main_interpreter directive is now written all over the place there ;-)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to as closed The owner will be changed from Christopher Lenz to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.