[mod_python] Installation problems

Reginald Charney charney at charneyday.com
Wed Mar 20 21:34:32 EST 2002

I am unable to get mod_python working on my system. I think I have followed everything needed and documented, but when I enter the following URLs, I get:

/test/mptest.py  - I am asked what program to use to execute this file
/test/mptest      - lists the ASCII source of the file

The following is what I believe is the relevant information from my installation. Any help would be appreciated. TIA.

Reg. Charney

Partial contents of /etc/httpd/httpd.conf

    # And for PHP 4.x, use:
    <IfModule mod_php4.c>
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php-source .phps

    # And for mod_python, use:
    <IfModule mod_python.c>
    AddType application/x-httpd-py .py
<Directory /usr/local/httpd/htdocs/test>
    AddHandler python-program .py
    PythonHandler mptest
    PythonDebug On

Test file /test/mptest.py

from mod_python import apache

def handler(req):
        req.write("hello world!")
        return apache.OK

Output from phpinfo()
System:		Linux x330-2 2.4.9 #3 SMP Wed Feb 13 15:02:07
Server Root:	/usr/local/httpd
Loaded Modules:	mod_userdir, mod_python, mod_php4, mod_perl, mod_setenvif, mod_unique_id, mod_usertrack, mod_headers, mod_expires, mod_cern_meta, mod_proxy, mod_digest, mod_auth_db, mod_auth_dbm, mod_auth_anon, mod_auth, mod_access, mod_rewrite, mod_alias, mod_speling, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_info, mod_status, mod_negotiation, mod_mime, mod_mime_magic, mod_log_referer, mod_log_agent, mod_log_config, mod_define, mod_env, mod_vhost_alias, mod_mmap_static, mod_so, http_core

PYTHONPATH:	/usr/lib/python2.1:/usr/lib/python2.1/plat-linux2:/usr/lib/python2.1/lib-tk:/usr/lib/python2.1/lib-dynload:/usr/lib/python2.1/site-packages:/usr/lib/apache/lib/python/site-packages

SERVER_SOFTWARE: Apache/1.3.20 (Linux/SuSE) mod_python/2.7.5 Python/2.1.1 PHP/4.0.6 mod_perl/1.26

HTTP_ENV_VARS["PATH"]:	/usr/sbin:/bin:/usr/bin:/sbin:/usr/X11R6/bin 

More information about the Mod_python mailing list