need help with mod_python in RH 9

T

Titi Anggono

Hi all,

I use apache2.0, mod_python 3.0, and python2.2.2. In
/etc/httpd/conf.d/python.conf, I added following (as I
read in the manual)

<Directory /var/www/html/htdocs>
AddHandler python-program .py
PythonHandler mptest
PythonDebug On
</Directory>

and create mptest.py under directory
/var/www/html/htdocs, (as I read in the manual)
------------------------
from mod_python import apache
def handler(req):
req.content_type="text/html"
req.send_http_header()
req.write("Hello World!")
return apache.OK
-----------------------------------

when I use url
http://192.168.231.3/html/htdocs/mptest.py, I get the
code listing. Apache doesn't execute the file.

Could somebody tell me how to tell apache to execute
the code.




____________________________________________________
Yahoo! Sports
Rekindle the Rivalries. Sign up for Fantasy Football
http://football.fantasysports.yahoo.com
 
G

grahamd

Oh, one minor thing. Your content type should be "text/plain" and
not "text/html" as you aren't returning HTML This isn't going to be
causing the problem you are seeing though.

Graham
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top