[mod_python] Mysterious 500 error?

Graham Dumpleton graham.dumpleton at gmail.com
Sat Jul 14 20:31:09 EDT 2007


I'd suggest you browser is also seeing a 500 response, but because
page content is being returned it doesn't care and still displays the
page. Use Firefox live headers or similar to confirm.

My only guess is that your Apache configuration is wrong and you have
somehow managed to create a stacked set of handlers by listing
PythonHandler directive more than once. The first one generates the
correct response, but the second is failing resulting in a 500 status
overriding the firsts 200 response.

What does you Apache configuration snippet look like where you have
defined PythonHandler etc?

Graham

On 15/07/07, Peter Shinners <pete at shinners.org> wrote:
> I have a simple mod_python handler that works correctly for web browsers,
> but fetching with wget gives a 500 Internal Server Error. This is using
> the latest mod_python 2.7 under Apache 1.3.37. I can't see any problem.
> The only different I see is perhaps HTTP/1.1 and HTTP/1.0 ?
>
> You can test the live url here, http://www.shinners.org/iCream/magic.html
>
> Here is the handler code...
>
> def handler(req):
>      path = req.uri.split("/", 2)[-1]
>      if path == "magic.html":
>          req.content_type = "text/html"
>          req.status = apache.OK
>          req.send_http_header()
>          req.write("<html><body>It is ok</body></html>")
>          return apache.OK
>      # ... other urls handled afterwards
>
>
> On the client end, these are the headers I get back.
>
> Date:Sat, 14 Jul 2007 20:16:07 GMT
> Server:Apache
> Keep-Alive:timeout=5, max=50
> Connection:Keep-Alive
> Transfer-Encoding:chunked
> Content-Type:text/html
>
>
>
> Here are the requests I see in the server log. I see a difference between
> HTTP/1.1 and HTTP/1.0 ?
>
> 76.168.41.58 - - [14/Jul/2007:16:16:08 -0400] "GET /iCream/magic.html
> HTTP/1.1" - 46 "-" "Mozilla/5.0 (X11; U; Linux i686; en; rv:1.8.1.4)
> Gecko/20061201 Epiphany/2.18 Firefox/2.0.0.4 (Ubuntu-feisty)"
>
> 76.168.41.58 - - [14/Jul/2007:16:10:41 -0400] "GET /iCream/magic.html
> HTTP/1.0" - 34 "-" "Wget/1.10.2"
>
>
> I'm not seeing anything show up in the server error logs, but it doesn't
> look like I'm getting the raw logs given to me.
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>


More information about the Mod_python mailing list