[mod_python] 500 internal server error

Peter Sanchez pjs at packet-addiction.org
Fri Dec 9 14:07:54 EST 2005


You are using mod_python.publisher, so you need to return your HTML  
code. Try this, instead of:

     return apache.OK

Use:

    return '<center><h1>Testing</h1></center>'

Should solve your problem.

Peter


On Dec 9, 2005, at 10:36 AM, chase3 at llnl.gov wrote:

> As a first step in moving a CGI script to mod_python, I wrapped the
> script in a handler.  This seems to work and the database does
> receive the data.   It looks like things should be ok.  However,
> I am getting a 500 Internal Server Error back that I have not been
> able to figure out, as there were no other clues in the error_log.
> In fact, putting an log message shows execution is successful:
>
>   ...
>     # Close the connection
>     db.close()
>     apache.log_error ( "success", apache.APLOG_ERR )
>     return apache.OK
>   else:
>     apache.log_error ( "Failed!", apache.APLOG_ERR )
>     return apache.SERVER_RETURN
>
> I get "success" in the log file.
>
> I put this mod_python script in the cgi-bin because when it was
> in htdocs, I ran into 401 Authorization Required problems.
> I should mention that I am not communicating to the server with
> a URL in a browser, but through a utility that uses CURL and SSL to
> do an HTTPS post, so user authentication is not possible.
> When the mod_python script is in cgi-bin, user authentication is
> not required. The software uses a digital signature for  
> authentication.
>
> <Directory "/etc/httpd/cgi-bin/tracker">
>     AddHandler python-program .py
>     PythonHandler mod_python.publisher
>     PythonDebug On
> </Directory>
>
> Any ideas on how to locate the server error?
>
> Apache server is at 2.0.46; python 2.2.35 and mod_python-3.0.3-3.ent
>
> Thanks,
> Lila
>
>
> -- 
> Lila Chase
> lchase at llnl.gov
>
> _______________________________________________
> 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