472,373 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,373 software developers and data experts.

problem running a python script using apache,mod_python on linux

hi,
i m trying to integrate python with apache on linux.For this i m using
mod_python.
I dont see any problem with the versions of python,apache and
mod_python i m using.
the versions i m using are
apache version2.
mod_python v3.1.14
python2.4
The problem is,when i m running my python script,after starting apache
,it is showing me the code it has.

My error_log is showing the following message
[Tue Oct 18 19:01:06 2005] [notice] Apache/2.0.55 (Unix)
mod_python/3.1.4 Python/2.4.2 configured -- resuming normal operations
[Tue Oct 18 19:01:06 2005] [info] Server built: Oct 17 2005 13:07:52
[Tue Oct 18 19:01:06 2005] [debug] prefork.c(956): AcceptMutex: sysvsem
(default: sysvsem)
the access_log is showing this message:
127.0.0.1 - - [18/Oct/2005:19:01:14 +0530] "GET /apache_pb.gif
HTTP/1.1" 200 2326
127.0.0.1 - - [18/Oct/2005:19:01:19 +0530] "GET /test/mptest.py
HTTP/1.1" 200 110
from the python script,i m returning an apache.OK ,so i think it goin
on fine,as i m getting 200i.e the hhtp processing is goin on fine.
I have made the required changes to the httpd.conf file
***
LoadModule python_module /home/ngupta/Apache2/modules/mod_python.so
DocumentRoot "/home/ngupta/Apache2/htdocs"

<Directory />
AllowOverride FileInfo
</Directory>

***
I m using a .htaccess file placed under Apache2/htdocs/test/
The .htaccess file has the following code
**
AddHandler mod_python .py
PythonHandler mptest
PythonDebug On
**
where mptest is python script and is as follows
**
from mod_python import apache
def handler(req):
req.send_http_header()
req.write("Hello")
return apache.OK
**
so if anyone knows where the problem lies ,please tell me.
thanks.
Neha gupta

Oct 19 '05 #1
1 2586
Neha,
I have made the required changes to the httpd.conf file
***
LoadModule python_module /home/ngupta/Apache2/modules/mod_python.so
Did you also add the line:
AddModule mod_python.c
DocumentRoot "/home/ngupta/Apache2/htdocs"

<Directory />
AllowOverride FileInfo
</Directory>

***
I m using a .htaccess file placed under Apache2/htdocs/test/
The .htaccess file has the following code
**
AddHandler mod_python .py
PythonHandler mptest
PythonDebug On
**


I didn't see anything else that jumps out.

Brad
Oct 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Doug Farrell | last post by:
Hi all, I'm trying to build a demonstration website using mod_python and 4Suite to show how we could transform XML documents into HTML with XSLT. Here is a piece of code that causes it to blow...
1
by: Rolfe | last post by:
Hi, I struggled, and got mod_python running on Apache/Win2k. Follow these instructions verbatim and you shouldn't have any trouble. These instructions are based on...
0
by: Manuzhai | last post by:
Hello there, I have this weird problem with a mod_python application. Recently I installed ElementTree and cElementTree through ez_setup.py, even though they were already installed normally...
1
by: boney | last post by:
hello All, I am totally unknown to python language.. i need to install mod_python to embed python interpreter with the Apache server, in order to use Trac with Apache Web Server i am using...
3
by: joe jacob | last post by:
I configured apache to execute python scripts using mod_python handler. I followed below mentioned steps to configure apache. 1. In http.conf I added <Directory...
1
by: walterbyrd | last post by:
I understand that Python has them, but PHP doesn't. I think that is because mod_php is built into apache, but mod_python is not usually in apache. If mod_python was built into apache, would...
1
by: NccWarp9 | last post by:
Hello, im using Apache HTTPD 2.2.8 with mod_python/3.3.1 Python/2.4.3 on Windows and having truble starting pythone, any help would be appreciated .. Im getting this error: ...
6
by: barun.saha04 | last post by:
Hi, I am facing a very basic problem with PSP. I have installed mod_python (in fedora Core 1), added the lines required for loading Python modules and handling PSP pages. I have created a...
8
by: timotoole | last post by:
Hi all, I'm trying to get python to work with cgi for a small intranet site, however even a simply "hello world test isn't working". Here is the test file: #!/usr/bin/python # -*- coding:...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.