mod_python installation

P

Patrick Useldinger

Hi,
I have the following configuration:

- Apache 2.0.47 (win32)
- mod_python 3.0.3 win32
- python 2.3

I have added the loadModule command for mod_python: "LoadModule
python_module modules/mod_python.so", and the file is there.

Apache won't start anymore. No error message is in Apache's log file.
Uncommenting the loadModule command makes apache start correctly.

Where can I get more information regarding the origin of the problem?

-PU
 
D

Dave Benjamin

Patrick Useldinger said:
I have added the loadModule command for mod_python: "LoadModule
python_module modules/mod_python.so", and the file is there.

Apache won't start anymore. No error message is in Apache's log file.
Uncommenting the loadModule command makes apache start correctly.

This might be a dumb question, but did you check the error log or the access
log? What happens when you try to start apache from the command line? (is
that possible in Windows? I've never tried...)

Good luck,
Dave
 
J

John Dean

Once you have done that you can write your handler. The name of the file
must be the same as the name you used above in the PythonHandler directive
i.e. test.py
Inside test.py you must have a function called handler e.g.
def handler(req)
req.content_type = 'text/html'
req.send_http_header()
req.write('some-html-formatted-text')
return apache.OK

May I suggest that you visit http://www.modpython.org and download the docs.
The docs will tell you how to write dynamic handlers, how to use the
publisher handler and lots more interesting and advanced stuff.
BTW I have only just figured out how to set up Apache myself (today), with
the help of two very kind people, namely Dave Benjamin and Steve Holden .
All the best and I wish you luck.
 
P

Patrick Useldinger

This might be a dumb question, but did you check the error log or the access
log? What happens when you try to start apache from the command line? (is
that possible in Windows? I've never tried...)

I looked at the error log.

In the Windows Event Log, I found the following:
=======================================
Application log:

The Apache service named reported the following error:
Cannot load C:/Programs/Apache/Apache2/modules/mod_python.so into
server: The specified module could not be found. .

The Apache service named reported the following error:
Syntax error on line 173 of C:/Programs/Apache/Apache2/conf/httpd.conf:

[Line 173 is "LoadModule python_module modules/mod_python.so"]
========================================
System log:.

The Apache2 service terminated with service-specific error 1 (0x1).
========================================

My modules folder looks like this:
Directory of C:\Programs\Apache\Apache2\modules

11/09/2003 21:48 <DIR> .
11/09/2003 21:48 <DIR> ..
08/07/2003 22:02 24 653 mod_access.so
08/07/2003 22:02 24 658 mod_actions.so
08/07/2003 22:02 24 656 mod_alias.so
08/07/2003 22:02 24 658 mod_asis.so
08/07/2003 22:02 24 651 mod_auth.so
08/07/2003 22:02 24 656 mod_auth_anon.so
08/07/2003 22:02 24 655 mod_auth_dbm.so
08/07/2003 22:02 32 850 mod_auth_digest.so
08/07/2003 22:02 32 857 mod_auth_ldap.so
08/07/2003 22:02 32 855 mod_autoindex.so
08/07/2003 22:02 28 757 mod_cache.so
08/07/2003 22:02 24 661 mod_cern_meta.so
08/07/2003 22:02 28 753 mod_cgi.so
08/07/2003 22:02 24 668 mod_charset_lite.so
08/07/2003 22:02 77 903 mod_dav.so
08/07/2003 22:02 45 136 mod_dav_fs.so
08/07/2003 22:02 57 426 mod_deflate.so
08/07/2003 22:02 24 654 mod_dir.so
08/07/2003 22:02 24 666 mod_disk_cache.so
08/07/2003 22:02 24 655 mod_env.so
08/07/2003 22:02 24 659 mod_expires.so
08/07/2003 22:02 28 757 mod_ext_filter.so
08/07/2003 22:02 24 659 mod_file_cache.so
08/07/2003 22:02 24 659 mod_headers.so
08/07/2003 22:02 28 751 mod_imap.so
08/07/2003 22:02 41 042 mod_include.so
08/07/2003 22:02 24 658 mod_info.so
08/07/2003 22:02 32 851 mod_isapi.so
08/07/2003 22:02 24 656 mod_logio.so
08/07/2003 22:02 28 757 mod_log_config.so
08/07/2003 22:02 24 665 mod_mem_cache.so
08/07/2003 22:02 28 748 mod_mime.so
08/07/2003 22:02 32 854 mod_mime_magic.so
08/07/2003 22:02 36 950 mod_negotiation.so
08/07/2003 22:02 41 038 mod_proxy.so
08/07/2003 22:02 20 566 mod_proxy_connect.so
08/07/2003 22:02 28 754 mod_proxy_ftp.so
08/07/2003 22:02 24 659 mod_proxy_http.so
14/03/2003 13:06 110 592 mod_python.so
08/07/2003 22:02 57 426 mod_rewrite.so
08/07/2003 22:02 24 660 mod_setenvif.so
08/07/2003 22:02 24 658 mod_speling.so
08/07/2003 22:02 28 756 mod_status.so
08/07/2003 22:02 24 661 mod_unique_id.so
08/07/2003 22:02 24 658 mod_userdir.so
08/07/2003 22:02 24 661 mod_usertrack.so
08/07/2003 22:02 24 662 mod_vhost_alias.so
08/07/2003 22:02 36 949 util_ldap.so
48 File(s) 1 535 794 bytes
2 Dir(s) 38 969 270 272 bytes free

Regards,
-PU
 
P

Patrick Useldinger

Just found in the mailing list archives that mod_python 3.0.* is *not*
Python 2.3 compatible, and that upgrading to Py2.3 should be postponed
until mod_python 3.1.* is available :-(

-pu
 
K

Kai Thomsen

Patrick said:
Just found in the mailing list archives that mod_python 3.0.* is *not*
Python 2.3 compatible, and that upgrading to Py2.3 should be postponed
until mod_python 3.1.* is available :-(

-pu
I don't know iff it is really not compatible. You can find a patch at
the mod_python page that you have to apply to use it with Python 2.3.
mod_python needs to be recompiled naturally, but I have it working on a
couple of Apache boxes (Linux and W2K) without any problems so far.

Kai
 
M

M-a-S

Kai Thomsen said:
I don't know iff it is really not compatible. You can find a patch at
the mod_python page that you have to apply to use it with Python 2.3.
mod_python needs to be recompiled naturally, but I have it working on a
couple of Apache boxes (Linux and W2K) without any problems so far.

Kai

What patch? At what page? The latest release of mod_python for Windows,
that I could find, is 3.1.0a, which doesn't start with Apache 2.0.43/Windows XP.
Is the patched mod_python available anywhere for downloading? Can you share it?
Thank you,
M-a-S
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top