#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: | no | UI/UX: | no |
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.
Change History (4)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
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 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
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.