View Full Version : [ubuntu] 500 Internal Server Error

May 4th, 2009, 04:07 PM
(using ubuntu jaunty
i just installed apache2 and have this file at the default location

with following code:

print ´Conten-Type:text/plain\n´
print ´My name is theta´

when i addresss it using firefox (localhost/cgi-bin/hello.py)

firefox a

500 Internal Server Error

can anyone help me where the trouble could be
thanks for any help in advance

May 4th, 2009, 04:38 PM
Does it give you a 500 error if you spell "Content" correctly?

print ´Content-Type:text/plain\n´
print ´My name is theta´

May 4th, 2009, 10:49 PM
yes, it still does

it shows the same error while using plain html

<title> local server </title>

some text here


can u also tell about the address, because when i press enter after typing


a http://

gets added at the beginning

May 5th, 2009, 01:45 PM
You're not using a valid quotes character.

print 'Content-Type:text/plain\n'
print 'My name is theta'

May 23rd, 2009, 02:32 PM
i've got the same probem(((
herewith there is mod_python works normally on my Ubuntu. But python CGI-scripts do not work. What can I do?

May 23rd, 2009, 02:36 PM
Check the apache logfiles for possible more information.

May 23rd, 2009, 03:16 PM
Terminal :

sudo chmod 755 /usr/lib/cgi-bin/hello.py

Apache configuration file :

<Directory /usr/lib/cgi-bin/>
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all

Hope it helps :)

May 23rd, 2009, 03:53 PM
There is a record after a try of running of CGI-script in the Apache log-file:

[Sat May 23 20:34:30 2009] [error] (13)Permission denied: exec of '/usr/lib/cgi-bin/test.py' failed
[Sat May 23 20:34:30 2009] [error] [client] Premature end of script headers: test.py

what is it means?

To ActiveFrost: Thank You! It works!!!