LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 06-17-2005, 12:44 AM   #1
tiang_ono
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
</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.

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

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?

-twantrd
 
Old 06-20-2005, 08:12 PM   #3
tiang_ono
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
Code:
LoadModule python_module modules/mod_python.so
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.
 
  


Reply


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


All times are GMT -5. The time now is 10:30 PM.

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