PDA

View Full Version : [ubuntu] 500 Internal Server Error



pi.theta
May 4th, 2009, 04:07 PM
(using ubuntu jaunty
i just installed apache2 and have this file at the default location
/usr/lib/cgi-bin/hello.py

with following code:


#!/usr/bin/python
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

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


#!/usr/bin/python
print ´Content-Type:text/plain\n´
print ´My name is theta´

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

it shows the same error while using plain html


<hmtl>
<title> local server </title>

some text here

</html>

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

localhost/cgi-bin/hello.html

a http://

gets added at the beginning

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


#!/usr/bin/python
print 'Content-Type:text/plain\n'
print 'My name is theta'

msatep
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?

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

ActiveFrost
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
</Directory>

Hope it helps :)

msatep
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 127.0.0.1] Premature end of script headers: test.py

what is it means?

To ActiveFrost: Thank You! It works!!!