mod_python not working (showing source code)

  • Thread starter Anthony Papillion II
  • Start date
A

Anthony Papillion II

Hello Everyone,

I have downloaded and installed mod_python and it doesn't seem to be
working. I am hoping someone can give me some pointers as to what I am doing
wrong. Here are the steps I've followed so far:

1. Installed mod_python from the rpm file.
2. Added LoadModule and AddModule directives to the httpd.conf file

Now, I have a file called mod_test.py that contains the following code:

#!/usr/bin/python

print "Test of mod_python"

When I call the file up in the browser, I simply see the python source. What
am I doing wrong?

Thanks!
Anthony
 
T

Tim Roberts

Anthony Papillion II said:
Hello Everyone,

I have downloaded and installed mod_python and it doesn't seem to be
working. I am hoping someone can give me some pointers as to what I am doing
wrong. Here are the steps I've followed so far:

1. Installed mod_python from the rpm file.
2. Added LoadModule and AddModule directives to the httpd.conf file

Now, I have a file called mod_test.py that contains the following code:

#!/usr/bin/python

print "Test of mod_python"

When I call the file up in the browser, I simply see the python source. What
am I doing wrong?

What does your .htaccess look like? Did you do an AddHandler and
SetHandler so Apache knows what to do with your .py files, and set a
PythonHandler do mod_python knows what to do?

Did you actually read the mod_python documentation?
 
I

Ivo Woltring

Hello Everyone,

I have downloaded and installed mod_python and it doesn't seem to be
working. I am hoping someone can give me some pointers as to what I am doing
wrong. Here are the steps I've followed so far:

1. Installed mod_python from the rpm file.
2. Added LoadModule and AddModule directives to the httpd.conf file

Now, I have a file called mod_test.py that contains the following code:

#!/usr/bin/python

print "Test of mod_python"

When I call the file up in the browser, I simply see the python source. What
am I doing wrong?

Thanks!
Anthony

in httpd.conf put someting like:

LoadModule python_module modules/mod_python.so

and in .htaccess:

SetHandler mod_python
AddHandler python-program .py
PythonHandler mod_python.publisher
#PythonHandler mptest
PythonDebug On

#PythonDebug On
 
A

Adam Przybyla

Ivo Woltring said:
in httpd.conf put someting like:

LoadModule python_module modules/mod_python.so

and in .htaccess:

SetHandler mod_python
AddHandler python-program .py
PythonHandler mod_python.publisher
#PythonHandler mptest
PythonDebug On

#PythonDebug On
... change mod_test.py name to python-program.py ;-) Regards
Adam Przybyla
 

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

Members online

No members online now.

Forum statistics

Threads
474,211
Messages
2,571,092
Members
47,693
Latest member
david4523

Latest Threads

Top