Setting up Python for CGI

Gregory Piñero gregpinero at
Fri Jul 15 04:12:23 UTC 2005

Ok, I'm doing better, I think the server is _trying_ to execute my script!

Any help would be greatly appriciated.  Below is all the info.



Here's the message I get when I point my browser to the script:
Internal Server Error

The server encountered an internal error or misconfiguration and was
unable to complete your request.

Please contact the server administrator, webmaster at localhost and
inform them of the time the error occurred, and anything you might
have done that may have caused the error.

More information about this error may be available in the server error log.
Apache/2.0.54 (Ubuntu) PHP/4.3.10-15ubuntu2 Server at Port 3391
Other info:
-My apache log file says "Premature end of script"
-When I run the script from the console it works fine.
-/usr/bin/python is where my python is.
-Here are the permissions on the file:
$ ls -l
-rwxr-xr-x  1 root root 646 2005-07-12 18:57

And here's the script if that helps: 

import sys

import cgi

import cgitb

import MySQLdb



print """Content-type: text/html\n

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">



  <meta content="text/html; charset=ISO-8859-1"


  <title>Make a journal entry</title>

<!-- to correct the unsightly Flash of Unstyled Content. -->

<script type="text/javascript"></script>

<style type="text/css" media="all">

    @import "journalread.css";




<h1 >test</h1>    


print "</body></HTML>"

More information about the ubuntu-users mailing list