[mod_python] Newbie - problem running mptest.py

Karl Kobata karl.kobata at syncira.com
Fri Jun 16 17:13:51 EDT 2006


 

 

  _____  

From: Karl Kobata [mailto:karl.kobata at syncira.com] 
Sent: Tuesday, February 28, 2006 3:00 PM
To: 'mod_python at modpython.org'
Subject: Newbie - problem running mptest.py

 

I am new to mod_python.

This DSO module was included in Redhat RHEL 3, but I do not seem to be able
to get this working with the simple example test program.  See questions
below.

 

Redhat Linux RHEL 3

Apache 2.0.46

Mod_python 3.0.3

 

RHEL 3 configuration:

/etc/httpd/conf/httpd.conf

-          in this file it includes external configuration files

-          For mod_python, it httpd.conf includes
/etc/httpd/conf.d/python.conf

-          In python.conf, these directives were added:

 

LoadModule python_module modules/mod_python.so

<Directory  /<DocumentRoot path>/Python>

    AddHandler python-program .py

    PythonHandler mptest

    PythonDebug On

</Directory>

 

Example file:

Mptest.py

from mod_python import apache

 

def handler(req):

    req.write("Hello World!")

    return apache.OK

 

URL reference:

http://localhost/Python/mptest.py

 

Results:

1)    the content of mptest.py was displayed, and not executed.

2)    Error message in error.log for apache

[Tue Feb 28 14:24:35 2006] [error] make_obcallback: could not import
mod_python.apache.!

Could not find platform independent libraries <prefix>

Could not find platform dependent libraries <exec_prefix>

Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]

'import site' failed; use -v for traceback

'import site' failed; use -v for traceback

ImportError: No module named mod_python.apache

 

Question:

1)    what did I do wrong?

2)    How to you use -v for traceback

3)    Any other suggestion

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20060616/4801d1c4/attachment-0001.html


More information about the Mod_python mailing list