472,364 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Apache 2.2.3 and mod_python 3.2.10

I installed Apache 2.2.3 and mod_python 3.2.10 on WinXP plateform
I configured mod_python via httpd.conf:
LoadModule python_module modules/mod_python.so

but my script folder configuration doesn't work correctely:

Alias /myfolder D:/myfolder

<Directory "/myfolder">
Order allow,deny
Allow from all
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On
</Directory>

for test, this is a sample script d:\myfolder\test.py
# test.py
#
from mod_python import apache
#
def hello(name=None):
if name:
return 'Hello, %s!' % name.capitalize()
else:
return 'Hello there!'
#
def handler(req):
req.content_type = 'text/plain'
req.write("from handler test, Hello World!")
return apache.OK

when I access to the url http://localhost/monrep/test.py,
I obtain source test.py listing but not the rendering of handler or
hello method.

with url http://localhost/theriaque/test.py/hello, I obtain :
=>The requested URL /theriaque/test.py/hello was not found on this server.

It seems like something is missing ... but what ?

thanks for any help
Dec 19 '06 #1
2 3116
sorry, I give here the right paths:

I installed Apache 2.2.3 and mod_python 3.2.10 on WinXP plateform
I configured mod_python via httpd.conf:
LoadModule python_module modules/mod_python.so

but my script folder configuration doesn't work correctely:

Alias /myfolder D:/myfolder

<Directory "/myfolder">
Order allow,deny
Allow from all
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On
</Directory>

for test, this is a sample script d:\myfolder\test.py
# test.py
#
from mod_python import apache
#
def hello(name=None):
if name:
return 'Hello, %s!' % name.capitalize()
else:
return 'Hello there!'
#
def handler(req):
req.content_type = 'text/plain'
req.write("from handler test, Hello World!")
return apache.OK

when I access to the url http://localhost/myfolder/test.py,
I obtain source test.py listing but not the rendering of handler or
hello method.

with url http://localhost/myfolder/test.py/hello, I obtain :
=>The requested URL /myfolder/test.py/hello was not found on this server.

It seems like something is missing ... but what ?

thanks for any help
Dec 19 '06 #2

m.banaouas wrote:
sorry, I give here the right paths:

I installed Apache 2.2.3 and mod_python 3.2.10 on WinXP plateform
I configured mod_python via httpd.conf:
LoadModule python_module modules/mod_python.so

but my script folder configuration doesn't work correctely:

Alias /myfolder D:/myfolder

<Directory "/myfolder">
Order allow,deny
Allow from all
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On
</Directory>

for test, this is a sample script d:\myfolder\test.py
# test.py
#
from mod_python import apache
#
def hello(name=None):
if name:
return 'Hello, %s!' % name.capitalize()
else:
return 'Hello there!'
#
def handler(req):
req.content_type = 'text/plain'
req.write("from handler test, Hello World!")
return apache.OK

when I access to the url http://localhost/myfolder/test.py,
I obtain source test.py listing but not the rendering of handler or
hello method.

with url http://localhost/myfolder/test.py/hello, I obtain :
=>The requested URL /myfolder/test.py/hello was not found on this server.

It seems like something is missing ... but what ?

thanks for any help
Get it working for a normal handler first and don't use
mod_python.publisher.

For a set of instructions on how to get a simple handler working,
including descriptions of common problems and how to debug it, see:
http://www.dscpl.com.au/wiki/ModPyth...dPythonWorking

Once you have confirmed that your installation works, then consider
looking at mod_python.publisher.

I'd also suggest that you get yourself on the mod_python user mailing
list and seek help there as the mod_python community there is much
larger. Mailing list details are on the mod_python web site.

BTW, don't you mean:

<Directory "D:/myfolder">

if that is what Alias uses?

Also, don't mix normal handlers and mod_python.publisher functions in
the same module, and don't use files called 'test.py' as there is a
standard Python module by the same name and if things aren't set up
right you can be picking up the wrong module.

Graham

Dec 19 '06 #3

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

Similar topics

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...
6
by: Piet | last post by:
Hi there, I cannot install mod_python v3.1.3 on either Win2k/ActivePython 2.3.2 or WinMe/Python 2.3.4. When I run the Windows installer, I get the following error message: Traceback (most recent...
2
by: digidalmation | last post by:
Hello all. I've been trying to get my linux server to run mod_python. It's a Mandrake 10 linux box, and apache/mod_python are installed from rpms. apache2-mod_python-2.0.48_3.1.3-1mdk...
0
by: Christopher | last post by:
I am running: Fedora Core 1 Python 2.4 Apache 1.3.3 mod_python 2.7.11 When I try to access the test mptest.py file I receive: > Internal Server Error
1
by: neha | last post by:
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...
9
by: cyberco | last post by:
And I thought this would be trivial...getting mod_python to run within apache on windows XP. ============= mod_python 3.2.8 apache 2.0.55 python2.4 winxp =============
5
by: m.banaouas | last post by:
Hi, bonjour, witch versions are suitable to use for apache & mod_python ? Can i install and use "Apache 2.2.3" & "mod_python 3.2.10" (most recent versions) without facing any known major...
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: 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: ...
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: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
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...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
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...
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...

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.