[mod_python] cg-bin files execution

John isofroni at cc.uoi.gr
Thu Dec 2 16:32:35 EST 2004


----- Original Message ----- 
From: "Jorey Bump" <list at joreybump.com>
To: "Mod_Python" <mod_python at modpython.org>
Sent: Thursday, December 02, 2004 9:32 PM
Subject: Re: [mod_python] cg-bin files execution


> John wrote:
>
> > Here is my error_log
> >
> > [Thu Dec  2 19:50:39 2004] [notice] mod_python: (Re)importing
> > mod_python.publisher from None
> > [Thu Dec  2 19:51:27 2004] [notice] mod_python: (Re)importing
> > mod_python.publisher from None
>
> Normal.
>
> > When i try to lunch the *.py files i receive and 404 error (page does
not
> > exist)
>
> Publisher expects you to point to a function *within* the module:
>
>   http://host/module.py/somefunction
>
> Here's a very easy way to test Publisher:
>
> <Directory /var/www/documentroot>
>     AddHandler python-program .py
>     PythonHandler mod_python.publisher
>     PythonDebug On
> </Directory>
>
> Create test.py:
>
> def hello(req):
>      x = "Hello, world!"
>      return x
>
> Restart apache (if you modified httpd.conf), point your browser to:
>
>   http://localhost/test.py/hello
>
> Furthermore, if you add the directive:
>
>   Options MultiViews
>
> to your directory section, you should be able to hide the extension
> (assuming there is no conflict with another test.* file):
>
>   http://localhost/test/hello
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>

Well i enter that url http://myserver/mptest.py/handler


And i received the following

Hello World!HTTP/1.1 200 OK
Date: Thu, 02 Dec 2004 21:31:42 GMT
Server: Apache/1.3.27 (Unix) mod_python/2.7.10 Python/2.3.4 PHP/4.3.0
AuthMySQL/2.20 DAV/1.0.3 mod_ssl/2.8.12 OpenSSL/0.9.7b
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>200 OK</TITLE>
</HEAD><BODY>
<H1>OK</H1>
The server encountered an internal error or
misconfiguration and was unable to complete
your request.<P>
Please contact the server administrator,
 admin at server and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.<P>
More information about this error may be available
in the server error log.<P>
</BODY></HTML>
What is the internal error? Does it work correctly?




More information about the Mod_python mailing list