473,591 Members | 2,919 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mod_python: what's going on here?

I'm not entirely certain comp.lang.pytho n is the proper newsgroup for
mod_python questions, but "comp.lang.pyth on.web" doesn't seem to exist,
so... my apologies in advance if this is considered off-topic.

I'm attempting to get mod_python 3.1.4/python 2.4.1 working on Apache
2.0.54 running under OS X. Apache was compiled from source with a
simple

/configure --enable-so --with-mpm=worker

.... followed by the make/make install dance. mod_python was almost as
simple:

../configure --with-apxs=/usr/local/apache2/bin/apxs \
--with-python=/sw/bin/python2.4

.... followed by the requisite dance.

At this point, all's well. The following bits were added to
httpd.conf:

LoadModule python_module /usr/local/apache2/modules/mod_python.so
<Directory "/usr/local/apache2/htdocs/test">
AddHandler mod_python .py
PythonHandler mptest
PythonDebug on
</Directory>

.... one apachectl restart later, Apache was running fine and serving
pages. The version string at the bottom of some static pages listed
mod_python as being present, so I reckoned that meant it was all
installed all right. However, any attempt to serve a mod_python
script, mptest.py, from the test subdirectory results in a 500 Internal
Server Error. Nothing gets written to error_log, but access_log
confirms the 500 was sent.

Does anyone have any experience with mod_python on OS X/Apache
environments? Can anyone shed some light on 500s that don't leave
traces in the error logs, or what precise incantation I need to make
mod_python start serving up scripts?

Also, if this is not appropriate for this group, does anyone know of a
Python group for which this is more appropriate?

Sep 5 '05 #1
2 2071
Robert J. Hansen wrote:
I'm not entirely certain comp.lang.pytho n is the proper newsgroup for
mod_python questions, but "comp.lang.pyth on.web" doesn't seem to exist,
so... my apologies in advance if this is considered off-topic.

I'm attempting to get mod_python 3.1.4/python 2.4.1 working on Apache
2.0.54 running under OS X. Apache was compiled from source with a
simple

/configure --enable-so --with-mpm=worker

... followed by the make/make install dance. mod_python was almost as
simple:

./configure --with-apxs=/usr/local/apache2/bin/apxs \
--with-python=/sw/bin/python2.4

... followed by the requisite dance.

At this point, all's well. The following bits were added to
httpd.conf:

LoadModule python_module /usr/local/apache2/modules/mod_python.so
<Directory "/usr/local/apache2/htdocs/test">
AddHandler mod_python .py
PythonHandler mptest
PythonDebug on
</Directory>

... one apachectl restart later, Apache was running fine and serving
pages. The version string at the bottom of some static pages listed
mod_python as being present, so I reckoned that meant it was all
installed all right. However, any attempt to serve a mod_python
script, mptest.py, from the test subdirectory results in a 500 Internal
Server Error. Nothing gets written to error_log, but access_log
confirms the 500 was sent.

Does anyone have any experience with mod_python on OS X/Apache
environments? Can anyone shed some light on 500s that don't leave
traces in the error logs, or what precise incantation I need to make
mod_python start serving up scripts?

Also, if this is not appropriate for this group, does anyone know of a
Python group for which this is more appropriate?

You will probably get help on this newsgroup, but the mod-python list is
pretty helpful, and there's a Python Web-Sig mailing list you can find
out about at http://www.python.org/sigs/ if you want.

I'm afraid I am new to OS X (and 3,000 miles away from my Mac Mini), so
I can't be any help directly with any Mac-dependent issues. But when I
first started using mod_python someone (I'm afraid I don't remember who)
advised me to use SetHandler rather than AddHandler.

Looking at my Windows httpd.conf (2.0.52, so close enough to yours) I see

############### ############### ############### ############### #############
# #
# MOD_PYTHON TESTING AREA #
# #
############### ############### ############### ############### #############
#
# Request handler
#
<Directory "C:/apache/htdocs/modpy">
AllowOverride FileInfo
SetHandler mod_python
PythonHandler mptest
PythonDebug On
</Directory>
#
# Filter handler
#
<Directory "C:/Apache/htdocs/test">
AllowOverride All
SetHandler mod_python
#PythonHandler mptest1
#PythonFixupHan dler mptest1
PythonLogHandle r mptest1
PythonOutputFil ter mptest1 CAPITALIZE
AddOutputFilter CAPITALIZE .txt .py
PythonDebug On
</Directory>

This might at least be enough to start generating sensible error messages.

One further possibility is that Apache is using an older Python by
default: byte codes vary from version to version, so something horrible
might be happening as mod_python tries to execute, but that seems a bit
far-fetched when you've got so far. I seem to remember that OS X doesn't
supply 2.4 by default: have you added it or overwritten the default
Python? Just another base to cover ...

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/

Sep 5 '05 #2
Robert J. Hansen a écrit :
Does anyone have any experience with mod_python on OS X/Apache
environments? Can anyone shed some light on 500s that don't leave
traces in the error logs, or what precise incantation I need to make
mod_python start serving up scripts?
Here is a setup that works for me on 10.3, with Apache2 2.54, python
2.4.1 and mod_python 3.1.4, all installed from source. This should
probably work also with your python from fink.

Apache2:
../configure --enable-mods-shared=all --enable-so

Python:
../configure

mod_python:
../configure --enable-so

Also, if this is not appropriate for this group, does anyone know of a
Python group for which this is more appropriate?

The mod_python mailing list ? At http://www.modpython.org/ .

Regards,

Olivier

Sep 5 '05 #3

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

Similar topics

7
2328
by: Nancy | last post by:
Hi, Is there any one knows, if I want to use mod_python to handle my html form, I must have a SMTP server on my PC(winxp pro)? Where can I get a free SMTP server? I cann't follow mod_python's manual example (http://www.svencoop.com/manual/mod/mod_python/tut-pub.html), why ... Thanks a lot.
2
2916
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
1790
by: Python_it | last post by:
I'm going to work with mod_python. I install mod_python 3.2.2b for python 2.4. If i test my install with mptest.py see this link: http://www.modpython.org/live/mod_python-3.2.2b/doc-html/modpython.html IT WORKS!
6
1937
by: Anthony L. | last post by:
I am writing a web application that is comparable to a content management system used in blogging. I really want to use Python after having done some evaluation coding using Python 2.3.5 with mod_python 3.1.4 running on Apache 2.0 with the Publisher handler. However, I am still very hesitant to settle on Python. All my research brings up the same collection of scant articles and old mailing list messages that reference each other. I am...
1
4331
by: treelife | last post by:
I'm getting and internal server error when | run the following mod_python script. I am actually trying to run Django. Script: from mod_python import apache def handler(req): req.content_type = 'text/plain' req.write("Under Construction")
10
1397
by: walterbyrd | last post by:
I am considering python, instead of php, for web-application development. I often see mod_python.criticisized as being borked, broken, or just plain sucking. Any truth to any of that?
10
4929
by: Vincent Delporte | last post by:
Hi I'm still a newbie when it comes to web applications, so would like some help in choosing a solution to write apps with Python: What's the difference between using running it through mod_python vs. building an application server using Python-based tools like CherryPy, Quixote, Draco, etc.? Thanks.
3
1796
by: Michael | last post by:
Hey everyone, Is it possible to automatically insert headers/footers using mod_python? I will be not be using PSP's, so I cannot use the PSP/include solution. Furthermore, the header will be dynamic; it won't be a static HTML page. In short, I've been looking for a page layout facility using mod_python.
3
4932
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>
0
7871
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
7995
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
8227
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...
0
6642
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5735
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
3851
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3893
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1467
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1202
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.