Code

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#9434 closed (fixed)

mod_python and unique PythonInterpreters

Reported by: lifewithryan Owned by: nobody
Component: Documentation Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The documentation for PythonInterpreter when using mod_python appears to be mis-stated. The experience I had was running 2 django instances but in two different virtual hosts. The docs state you need to add a python intrepreter if you are running two django instances in the same virtual host. However, by not having a PythonInterpreter setup the python cache still appeared to be getting messed up. As soon as I added the PythonInterpreter, things started working as expected.

The text in question is: "If you need to put two Django installations within the same VirtualHost, you'll need to take a special precaution to ensure mod_python's cache doesn't mess things up. Use the PythonInterpreter directive to give different <Location> directives separate interpreters:"

Again, as stated above, the docs lead you to believe that if you are running two django instances in different virtual hosts, you don't need this. Perhaps I'm wrong and something else was at play, but to me, this did the trick.

Attachments (0)

Change History (4)

comment:1 Changed 5 years ago by grahamd

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

What probably matters is whether the virtual hosts are distinguished by server name. If the virtual hosts are for the same server name but on different ports, then there may be an issue. This is because mod_python defaults to naming sub interpreter based on server name only and doesn't use the port. Thus two virtual hosts on different ports with same server name will shared same sub interpreter. Another mistake which can also cause mod_python to appear to share sub interpreters across virtual hosts, is not defining NameVirtualHost directive in Apache configuration.

So it is clear how your system is setup, provide how your virtual hosts are configured.

comment:2 Changed 5 years ago by lifewithryan

Thats EXACTLY it. IP based virtual hosts (actually only listening on localhost ports 8080 and 8081). So adding the PythonInterpreter directive worked. The docs just didn't mention that. (So naturally I got chastised in the IRC channel for even askin...but i"m used to that).

Might be something we want to add that to the docs. But thanks for the info, you've verified what I discovered today. Thanks

comment:3 Changed 5 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(In [9268]) Fixed #9434 -- Added a note to the mod_python docs regarding requiring
PythonInterpreter in different VirtualHost blocks that share the same server
name. Thanks to Graham Dumpleton for the clarification.

comment:4 Changed 5 years ago by mtredinnick

(In [9271]) [1.0.X] Fixed #9434 -- Added a note to the mod_python docs regarding requiring
PythonInterpreter in different VirtualHost blocks that share the same server
name. Thanks to Graham Dumpleton for the clarification.

Backport of r9268 from trunk.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.