I have a test perl script, that works on my Windoze box (Just says hello) that I have in /var/www/cgi-bin on my Slackware 10.2 box. When I'm in that directory, if I type
then I get the html the script generates on screen.
However, if I call the script from a PC through Apache, I get error 500. The Apache error log says
[error] (2)No such file or directory: exec of /var/www/cgi-bin/test.pl failed
[error] [client 192.168.0.3] Premature end of script headers: /var/www/cgi-bin/test.pl
[error] [client 192.168.0.3] File does not exist: /var/www/htdocs/favicon.ico
The test script from the install runs perfectly, and I think I understand why. The first line of the sample script is #!/bin/sh, so I think that is running a bash script. My script is below
print "Content-type: text/html\n\n";
print "<TITLE>CGI Test</TITLE>";
print "<BODY><H2>I just wrote a web page using Perl!</H2>";
So I'm thinking it must be a Apache conf problem. But I can't see anything wrong with that either. Here is the appropriate section of it
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
Allow from all
Can anyone see why this isn't working? Thanks