I am trying to run a CGI perl script on Apache HTTP server but looks like there is some issue with the configuration. I am able to post html content but with CGI I am getting the following error:
"The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, asfdsaf.@sdafdsl.com 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."
Here is what I see in server error logs:
127.0.0.1 - - [21/May/2011:21:29:04 +0530] "GET /cgi-bin/sample.pl HTTP/1.1" 500 543
127.0.0.1 - - [21/May/2011:21:29:05 +0530] "GET /cgi-bin/sample.pl HTTP/1.1" 500 543
Here is what I have in httpd.conf file in order to enable CGI scripts:
LoadModule cgi_module modules/mod_cgi.so
<IfModule alias_module>
ScriptAlias /cgi-bin/ "C:/httpd-2.2-x64/cgi-bin/"
</IfModule>
<Directory C:/httpd-2.2-x64/cgi-bin>
AllowOverride all
Options +ExecCGI
Order allow,deny
Allow from all
</Directory>
<IfModule mime_module>
.
.
.
AddHandler cgi-script cgi pl
.
.
.
</IfModule>
and here is the cgi perl script that I am trying to run:
#!C:\Perl\bin
print "Content-type: text/html\n\n";
print <<HTML;
<html>
<head>
<title>A Simple Perl CGI</title>
</head>
<body>
<h1>A Simple Perl CGI</h1>
<p>Hello World</p>
</body>
HTML
exit;
Could anyone please let me know if I am missing something?