Click to See Complete Forum and Search --> : perl scripts error


johnh10000
07-21-2009, 05:12 AM
Hi gang, I run a little net work called tux, from a ubuntu jaunty box.

Hi I thought I'd set up perl properly but....

I've done perl before, but can't recall..

Two simple scripts which I nicked off the web:

The obigatry hello world
--
#!/usr/bin/perl

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

print <<END_HTML;
<html>
<head></head>
<body>Hello, World!</body>
</html>
END_HTML
--
and printenv
--
#!/usr/bin/perl

print "Content-type: text/html\n\n";
print "<code>\n";

foreach $key (sort keys(%ENV)) {
print "$key = $ENV{$key}<p>";
}
--
Which result in:
[Tue Jul 21 09:46:42 2009] [error] [client 192.168.1.3] (13)Permission denied: exec of '/usr/lib/cgi-bin/printenv.cgi' failed
[Tue Jul 21 09:46:42 2009] [error] [client 192.168.1.3] Premature end of script headers: printenv.cgi
[Tue Jul 21 09:47:57 2009] [error] [client 192.168.1.3] (13)Permission denied: exec of '/usr/lib/cgi-bin/printenv.cgi' failed
[Tue Jul 21 09:47:57 2009] [error] [client 192.168.1.3] Premature end of script headers: printenv.cgi
[Tue Jul 21 09:51:24 2009] [error] [client 192.168.1.3] (13)Permission denied: exec of '/usr/lib/cgi-bin/printenv.cgi' failed
[Tue Jul 21 09:51:24 2009] [error] [client 192.168.1.3] Premature end of script headers: printenv.cgi
[Tue Jul 21 09:55:42 2009] [error] [client 192.168.1.3] (13)Permission denied: exec of '/usr/lib/cgi-bin/hello.cgi' failed
[Tue Jul 21 09:55:43 2009] [error] [client 192.168.1.3] Premature end of script headers: hello.cgi

Sixtease
07-22-2009, 05:01 AM
Umm... do the CGI's have execute permission for the web server user?

johnh10000
07-22-2009, 05:25 AM
Something stupid, and your question, ask ...execute. My problem was I hadn't set the exe flag. works now.

After all that someone last night posted a script that shoud do what I want in jS
Thanks all.