simple cgi script not working

hi all,

i have installed simple cgi-script
under apache/cgi-bin directory

hello.cgi

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print <<END_HTML;
<html>
<head></head>
<body>Hello, World!</body>
</html>
END_HTML

when i hit the url http://hostname:portno/cgi-bin/hello.cgi
i get the error as 503 Service Temporarily Unavailable

when i check the apache error log:
I see the below error messages:

[Sun Jun 28 01:08:12 2009] [error] [client xx.xx.xxx.xxx] (2)No such file or directory: unable to connect to cgi daemon after multiple tries:hostname:portno/cgi-bin/hello.cgi

Any help is greatly appreciated!!!

Put this line in the script

use CGI;

Hi Igor,

I have put use CGi; in my script
but still i'm getting same error:

In the logs, I see same error message:
[Sun Jun 28 09:02:06 2009] [error] [client xx.xx.xxx.xxx] (2)No such file or directory: unable to connect to cgi daemon after multiple tries: /hostname/apache/cgi-bin/hello.cgi

Including the CGI module won't do any difference, as it's only purpose is to simplify CGI programming (Parameter usage, HTML output, ...)

What are the permissions on hello.cgi? What are the lines for the CGI handlers in Apaches configuration files?

raghur77,

Ask your hosting service what the problem is.

Then you have put the script in a wrong directory or the handler for that directory has not been sat properly for cgi-script. Who ever is the admin on the box should fix this and tell you what do. If it's ISP call them and tell them about the problem.

I recycled apache webserver and the problem is resolved. not sure what went wrong here.
Now all set.