For reasons that I won't get into in this thread, I've built a webserver that runs out of my homedir (with php & sqlite to boot). Now, however, I need python, so I'm trying to build/install mod_python. To get the build to work, I needed to also build/install python, which I've done (all running out of my homedir). I can build & install mod_python fine now. I've edited my httpd.conf to load up the mod_python.so from my homedir.
Watching apache's logs on startup, I can see it loading up mod_python:
Code:
[Thu Sep 27 14:56:32 2007] [notice] mod_python: Creating 8 session mutexes based on 256 max processes and 0 max threads.
[Thu Sep 27 14:56:32 2007] [notice] mod_python: using mutex_directory /tmp
[Thu Sep 27 14:56:32 2007] [notice] Apache/2.2.6 (Unix) PHP/5.2.4 mod_python/3.3.1 Python/2.5.1 configured -- resuming normal operations
but when I try to load up a simple hello_world.py:
Code:
from mod_python import apache
def handler(req):
req.content_type = 'text/plain'
req.write("Hello World!")
return apache.OK
I get this message showing up in the apache logs:
Code:
[Thu Sep 27 14:56:48 2007] [error] make_obcallback: could not import mod_python.apache.\n
ImportError: No module named mod_python.apache
[Thu Sep 27 14:56:48 2007] [error] make_obcallback: Python path being used "['/usr/lib/python25.zip', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages', '/var/lib/python-support/python2.5', '/var/lib/python-support/python2.5/HTMLgen']".
[Thu Sep 27 14:56:48 2007] [error] get_interpreter: no interpreter callback found.
[Thu Sep 27 14:56:48 2007] [error] [client 10.4.1.97] python_handler: Can't get/create interpreter.
any ideas on why this is happening? Could it be that the python in my homedir is not listed in the pythong path in the above error message? If so, how do I get it in there?
FWIW, I configured mod_python like so:
./configure --prefix=$HOME/local --with-apxs=$HOME/local/bin/apxs --with-python=$HOME/local/bin/python
Any help would be much appreciated.