Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-17-2005, 12:44 AM   #1
LQ Newbie
Registered: Apr 2004
Location: indonesia
Distribution: red hat 9
Posts: 21

Rep: Reputation: 15
need help with mod_python

Hi all,

I use apache2.0, mod_python 3.0, and python2.2.2. In /etc/httpd/conf.d/python.conf, I added following

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

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

when I use url, I get the code listing. Apache doesn't execute the file.

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

Old 06-18-2005, 12:35 PM   #2
Senior Member
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
I don't use mod_python with apache but how are you loading it in apache? Show us the LoadModule directive. It's also in the libexec folder under apache right?

Old 06-20-2005, 08:12 PM   #3
LQ Newbie
Registered: Apr 2004
Location: indonesia
Distribution: red hat 9
Posts: 21

Original Poster
Rep: Reputation: 15
Sorry, I had to go to the remote place for a few days.

In RH 9, the configuration for loading module such as perl, python, php located at /etc/httpd/conf.d/*.conf. I think it is a little bit different with RH XX < RH 9, am I right ?? . The modules are located in /etc/httpd/modules/

The httpd loads these modules using

# Load config files from the config directory "/etc/httpd/conf.d"
Include /conf.d/*.conf

According to the manual I have read, we don't add
LoadModule python_module modules/
if we insert these line and we start the apache there will be a comment that python module has been loaded (I have tried it).

But, I still have problem how to tell mozilla to execute the python code.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
mod_python config error darthtux Programming 1 05-21-2005 06:27 PM
mod_python gaddargarson Programming 1 03-29-2005 08:45 AM
mod_python apache configuration gaddargarson Programming 2 03-09-2005 05:14 AM
installing mod_python dominant Linux - Software 0 11-26-2004 06:19 AM
Apache with mod_python mbayeb Linux - Software 2 12-24-2002 05:24 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:45 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration