views:

215

answers:

1

Is there some way to run .psp (python server pages) code under apache + mod_wsgi? While we are moving towards newer wsgi based frameworks we still have some legacy code written in psp which runs under mod_python.

We'd like to be able to run it on the same server that hosts other wsgi based python code. In short - is there a way to support psp under mod_wsgi? Or are there any other tricks to at least allow mod_wsgi and mod_python to play nice in the same server?

-S

+1  A: 

No, there is no port of mod_python PSP for mod_wsgi.

Yes, you can run mod_python and mod_wsgi on same server so long as both use same version of Python and both link dynamically with Python library. See:

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

It isn't recommended to run both together though as mod_wsgi then gets afflicted by the memory leaks due to mod_python, plus some other configurability in mod_wsgi is restricted due to mod_python controlling Python interpreter initialisation.

Graham Dumpleton
Wouldn't running the WSGI apps in daemon mode mitigate the initialization issues?
Ignacio Vazquez-Abrams
No, daemon mode processes are a fork of Apache parent and not a fork/exec like in FASTCGI. Thus there isn't the total isolation there is in FASTCGI. Being only a fork provides other benefits though as far as better integration with Apache and better process management. So, where you gain in one area, you loose in others.
Graham Dumpleton
Thanks Graham - will play with the dual install and see what happens.
shreddd
As described in the link, the issue was a mod_wsgi that had a dynamically linked libpython and a mod_python that had it statically linked. Recompiled mod_python to link against libpython dynamically and it seems to be working now. Thanks again.One more side note: mod_python won't link dynamically against libpython by default. Had to change the configure script to get this to work right. Need to change LDFLAGS="${LDFLAGS} -L${PyLIBPL}" to LDFLAGS="${LDFLAGS}"
shreddd