472,791 Members | 1,076 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,791 software developers and data experts.

apache & mod_python

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.
Dec 8 '06 #1
5 3017
m.banaouas wrote:
Can i install and use "Apache 2.2.3" & "mod_python 3.2.10" (most recent
versions) without facing any known major issue ?
Works fine for me.
The only "known major issue" you can face is general non-threadsafety
of Python interpreter. So, if you are using Apache MPM, you have to
allow for it, or use framework that does it for you.

Dec 8 '06 #2

Maxim Sloyko wrote:
m.banaouas wrote:
Can i install and use "Apache 2.2.3" & "mod_python 3.2.10" (most recent
versions) without facing any known major issue ?
Only that to use Apache 2.2 you must have mod_python 3.2.10 or later,
older versions of mod_python do not work with the more recent version
of Apache.
Works fine for me.
The only "known major issue" you can face is general non-threadsafety
of Python interpreter. So, if you are using Apache MPM, you have to
allow for it, or use framework that does it for you.
You answer here is a bit misleading. There are no issues with the
thread safety of the Python interpreter per-se. However, as with any
Python application, whether mod_python is used or not, if multiple
threads are being used your application code may have to be written so
as to cope with access to code/data from multiple threads at the same
time. This is not anything unique to mod_python.

Whether this will be an issue or not is dependent on which Apache MPM
is used, not that the Apache MPM is used as one will always be used.
The specific Apache MPMs where multithreading has to be taken into
consideration are "winnt" on Windows platforms and "worker" on UNIX
platforms. What this all means is that when these MPMs are used there
can be concurrent request handlers executing in distinct threads within
the same Apache processes. Thus, where common data is accessed, it has
to be adequately protected.

For further details on the Apache/mod_python process/interpreter/thread
model, see:
http://www.dscpl.com.au/wiki/ModPyth...terpreterModel

That said, there are sometimes threading issues with mod_python but it
is more to do with the fact that mod_python can use multiple
interpreter instances within a single process. Also, the problems are
not a problem in mod_python, but result from third party C modules for
Python being used which take the simple path of using the simplified
thread API for working with the GIL. Such modules often will not work
properly when used from secondary Python interpreter instances. In
these cases it is a simple matter of telling mod_python to handle
requests which are dependent on those modules within the main Python
interpreter, ie., the very first one which gets created. Where third
party C modules use the full thread API for Python properly, it doesn't
matter which interpreter instance they are used from.

Graham

Dec 10 '06 #3
thanks for your answers
The plateform I target is Windows XP (no body is perferct ...).

Concerning multithread , is simultaneous multi http client calls can
present any problem ? I don't think because usually http server fires a
different process for each client call, while Threading is discussed
within the same process, isn't it?

I'm still looking for mod_python 3.2.10 to install it with apache 2.2.3
It seems like I must "build" it before use it.
If there is no other mean I will do it but usually I retrieve "ready to
use" kits.

Graham Dumpleton a écrit :
Maxim Sloyko wrote:
>m.banaouas wrote:
>>Can i install and use "Apache 2.2.3" & "mod_python 3.2.10" (most recent
versions) without facing any known major issue ?

Only that to use Apache 2.2 you must have mod_python 3.2.10 or later,
older versions of mod_python do not work with the more recent version
of Apache.
>Works fine for me.
The only "known major issue" you can face is general non-threadsafety
of Python interpreter. So, if you are using Apache MPM, you have to
allow for it, or use framework that does it for you.

You answer here is a bit misleading. There are no issues with the
thread safety of the Python interpreter per-se. However, as with any
Python application, whether mod_python is used or not, if multiple
threads are being used your application code may have to be written so
as to cope with access to code/data from multiple threads at the same
time. This is not anything unique to mod_python.

Whether this will be an issue or not is dependent on which Apache MPM
is used, not that the Apache MPM is used as one will always be used.
The specific Apache MPMs where multithreading has to be taken into
consideration are "winnt" on Windows platforms and "worker" on UNIX
platforms. What this all means is that when these MPMs are used there
can be concurrent request handlers executing in distinct threads within
the same Apache processes. Thus, where common data is accessed, it has
to be adequately protected.

For further details on the Apache/mod_python process/interpreter/thread
model, see:
http://www.dscpl.com.au/wiki/ModPyth...terpreterModel

That said, there are sometimes threading issues with mod_python but it
is more to do with the fact that mod_python can use multiple
interpreter instances within a single process. Also, the problems are
not a problem in mod_python, but result from third party C modules for
Python being used which take the simple path of using the simplified
thread API for working with the GIL. Such modules often will not work
properly when used from secondary Python interpreter instances. In
these cases it is a simple matter of telling mod_python to handle
requests which are dependent on those modules within the main Python
interpreter, ie., the very first one which gets created. Where third
party C modules use the full thread API for Python properly, it doesn't
matter which interpreter instance they are used from.

Graham
Dec 10 '06 #4

m.banaouas wrote:
thanks for your answers
The plateform I target is Windows XP (no body is perferct ...).

Concerning multithread , is simultaneous multi http client calls can
present any problem ? I don't think because usually http server fires a
different process for each client call, while Threading is discussed
within the same process, isn't it?
The use of a separate process to handle each request only applies to
the 'prefork' MPM on UNIX systems. Being on Windows, the 'winnt' MPM is
used and concurrent requests are always handled within different
threads within the same Apache process. The referenced article should
have made that clear.
I'm still looking for mod_python 3.2.10 to install it with apache 2.2.3
It seems like I must "build" it before use it.
If there is no other mean I will do it but usually I retrieve "ready to
use" kits.
See:

http://nicolas.lehuen.com/download/mod_python/

You will find Python 2.5 versions where whereas the official mod_python
download site only has Python 2.3 and 2.4 versions.

Make sure you grab the appropriate version for your combination of
Apache and Python.

Version 3.2.10 is the last stable version although 3.3.0b is in there
as well and has just been put together for final testing before release
for 3.3.

Graham
Graham Dumpleton a écrit :
Maxim Sloyko wrote:
m.banaouas wrote:

Can i install and use "Apache 2.2.3" & "mod_python 3.2.10" (most recent
versions) without facing any known major issue ?
Only that to use Apache 2.2 you must have mod_python 3.2.10 or later,
older versions of mod_python do not work with the more recent version
of Apache.
Works fine for me.
The only "known major issue" you can face is general non-threadsafety
of Python interpreter. So, if you are using Apache MPM, you have to
allow for it, or use framework that does it for you.
You answer here is a bit misleading. There are no issues with the
thread safety of the Python interpreter per-se. However, as with any
Python application, whether mod_python is used or not, if multiple
threads are being used your application code may have to be written so
as to cope with access to code/data from multiple threads at the same
time. This is not anything unique to mod_python.

Whether this will be an issue or not is dependent on which Apache MPM
is used, not that the Apache MPM is used as one will always be used.
The specific Apache MPMs where multithreading has to be taken into
consideration are "winnt" on Windows platforms and "worker" on UNIX
platforms. What this all means is that when these MPMs are used there
can be concurrent request handlers executing in distinct threads within
the same Apache processes. Thus, where common data is accessed, it has
to be adequately protected.

For further details on the Apache/mod_python process/interpreter/thread
model, see:
http://www.dscpl.com.au/wiki/ModPyth...terpreterModel

That said, there are sometimes threading issues with mod_python but it
is more to do with the fact that mod_python can use multiple
interpreter instances within a single process. Also, the problems are
not a problem in mod_python, but result from third party C modules for
Python being used which take the simple path of using the simplified
thread API for working with the GIL. Such modules often will not work
properly when used from secondary Python interpreter instances. In
these cases it is a simple matter of telling mod_python to handle
requests which are dependent on those modules within the main Python
interpreter, ie., the very first one which gets created. Where third
party C modules use the full thread API for Python properly, it doesn't
matter which interpreter instance they are used from.

Graham
Dec 10 '06 #5
Graham Dumpleton a écrit :
m.banaouas wrote:
>thanks for your answers
The plateform I target is Windows XP (no body is perferct ...).

Concerning multithread , is simultaneous multi http client calls can
present any problem ? I don't think because usually http server fires a
different process for each client call, while Threading is discussed
within the same process, isn't it?

The use of a separate process to handle each request only applies to
the 'prefork' MPM on UNIX systems. Being on Windows, the 'winnt' MPM is
used and concurrent requests are always handled within different
threads within the same Apache process. The referenced article should
have made that clear.
Ok, obviously, i will be concerned by thread architecture under win32.
>I'm still looking for mod_python 3.2.10 to install it with apache 2.2.3
It seems like I must "build" it before use it.
If there is no other mean I will do it but usually I retrieve "ready to
use" kits.

See:

http://nicolas.lehuen.com/download/mod_python/
I found it too on http://apache.fastorama.com/dist/httpd/modpython/win/

I would like to warn users about a trick while testing this code (widely
proposed):
#
# helloworld.py
#
from mod_python import apache
#
def handler(req):
req.content_type = ’text/plain’
req.write("Hello World!")
return apache.OK

’text/plain’ don't use regular string delimiters (' and ").
so python interpretter is not happy at all ...
Dec 11 '06 #6

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
2
by: ggg | last post by:
In regards to mod_python, I keep getting this warning when I do apachectl configtest: Loaded DSO libexec/mod_python.so uses plain Apache 1.3 API, this module might crash under EAPI! (please...
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...
1
by: Tama | last post by:
Hello, I've didn't find any answer to my problem so I start a new topic. I have installed Apache 1.3.33 on Windows XP. I've also downloaded and installed ActivePython form...
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: ...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.