[mod_python] Troubles with mod_python and Apache for Win xp

Joseph Sliz jsliz at fluentenergy.com
Mon Mar 17 14:09:43 EDT 2008


I am new to mod_python and Apache.

 

My environment is:
 
Windows XP Prof sp2
Python 2.4
Apache 2.2.8
Mod_python 3.3.1
 
I've already added the following to the Apache httpd.conf
 
LoadFile "c:/python24/python24.dll"
LoadFile "c:/python24/msvcr71.dll"
LoadFile "c:/python24/msvcp71.dll"
LoadModule python_module modules/mod_python.so
 
 
I have left my DocumentRoot Directory as follows:

 

DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"

 

<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">

    AddHandler python-program .py

    SetHandler mod_python 

    PythonHandler hello

    Options FollowSymLinks

    AllowOverride None

    Order deny,allow

    Deny from all

</Directory>

 

I have moved my "hello.py" file into this directory.  The hello.py script
looks like:

 

from mod_python import apache

 

def handler(req):

     req.content_type = "text/plain"

     req.send_http_header()

     req.write("Hello, Welcome to my World!")

     return apache.OK

 

 

When I enter the request  <http://localhost/hello.py>
http://localhost/hello.py into my browser, I get the following error:

 

Internal Server Error

The server encountered an internal error or misconfiguration and was unable
to complete your request.

Please contact the server administrator, admin at localhost and inform them of
the time the error occurred, and anything you might have done that may have
caused the error.

More information about this error may be available in the server error log.

 

When I check the server error log, I receive the following:

 

ImportError: No module named mod_python.apache

[Mon Mar 17 13:48:11 2008] [error] make_obcallback: Python path being used
"['C:\\\\Python24\\\\python24.zip', '.\\\\DLLs', '.\\\\lib',
'.\\\\lib\\\\plat-win', '.\\\\lib\\\\lib-tk', 'C:\\\\Program Files\\\\Apache
Software Foundation\\\\Apache2.2\\\\bin']".

[Mon Mar 17 13:48:11 2008] [error] get_interpreter: no interpreter callback
found.

[Mon Mar 17 13:48:11 2008] [error] [client 127.0.0.1] python_handler: Can't
get/create interpreter.

[Mon Mar 17 13:50:55 2008] [notice] Parent: Received restart signal --
Restarting the server.

[Mon Mar 17 13:50:55 2008] [notice] Child 3324: Exit event signaled. Child
process is ending.

[Mon Mar 17 13:50:55 2008] [notice] Apache/2.2.8 (Win32) configured --
resuming normal operations

[Mon Mar 17 13:50:55 2008] [notice] Server built: Jan 18 2008 00:37:19

[Mon Mar 17 13:50:55 2008] [notice] Parent: Created child process 3936

[Mon Mar 17 13:50:55 2008] [notice] mod_python: Creating 8 session mutexes
based on 0 max processes and 64 max threads.

[Mon Mar 17 13:50:55 2008] [notice] Child 3936: Child process is running

[Mon Mar 17 13:50:56 2008] [notice] Child 3324: Released the start mutex

[Mon Mar 17 13:50:56 2008] [notice] Child 3936: Acquired the start mutex.

[Mon Mar 17 13:50:56 2008] [notice] Child 3936: Starting 64 worker threads.

[Mon Mar 17 13:50:57 2008] [notice] Child 3324: All worker threads have
exited.

[Mon Mar 17 13:50:57 2008] [notice] Child 3324: Child process is exiting

[Mon Mar 17 13:50:57 2008] [notice] Child 3936: Starting thread to listen on
port 80.

[Mon Mar 17 13:51:15 2008] [error] make_obcallback: could not import
mod_python.apache.\n

'import site' failed; use -v for traceback

'import site' failed; use -v for traceback

ImportError: No module named mod_python.apache

[Mon Mar 17 13:51:15 2008] [error] make_obcallback: Python path being used
"['C:\\\\Python24\\\\python24.zip', '.\\\\DLLs', '.\\\\lib',
'.\\\\lib\\\\plat-win', '.\\\\lib\\\\lib-tk', 'C:\\\\Program Files\\\\Apache
Software Foundation\\\\Apache2.2\\\\bin']".

[Mon Mar 17 13:51:15 2008] [error] get_interpreter: no interpreter callback
found.

[Mon Mar 17 13:51:15 2008] [error] [client 127.0.0.1] python_handler: Can't
get/create interpreter.

 

Can anyone shed any light on what the problem might be????

Regards..Joe

 

 

 

 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20080317/1cbd992d/attachment.html


More information about the Mod_python mailing list