473,763 Members | 7,727 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.publ isher
PythonDebug On
</Directory>

for test, this is a sample script d:\myfolder\tes t.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_typ e = '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 3232
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.publ isher
PythonDebug On
</Directory>

for test, this is a sample script d:\myfolder\tes t.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_typ e = '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.publ isher
PythonDebug On
</Directory>

for test, this is a sample script d:\myfolder\tes t.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_typ e = '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.publ isher.

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.publ isher.

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.publ isher 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
2869
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 "http://www.modpython.org/live/current/doc-html/inst-testing.html". I've added specific information such as Windows filepaths and filenames so there's no ambiguity on what you should do. I encourage you to copy and paste to avoid typing errors. Cheers, Rolfe
6
3258
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 call last): File "C:\Programme\Python23\Scripts\win32_postinstall.py", line 86, in ? apachediroptions = getApacheDirOptions() File "C:\Programme\Python23\Scripts\win32_postinstall.py", line 45, in getApacheDirOptions
2
2923
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 apache2-2.0.48-6mdk The rpm installed the python module as: /usr/lib/apache2-extramodules/mod_python.so And added a config file for apache:
0
3316
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
2791
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 are apache version2. mod_python v3.1.14 python2.4 The problem is,when i m running my python script,after starting apache
9
4929
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
3117
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 issue ? thanks for any help.
3
4939
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 "D:/softwares/Apache2.2/htdocs"> AddHandler mod_python .py PythonHandler mptest PythonDebug On </Directory>
1
4285
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: make_obcallback: could not import mod_python.apache.\n
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10144
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9997
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9937
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9822
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.