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
Code:
/usr/bin/perl test.pl
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
Code:
[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
Code:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<HTML><HEAD>";
print "<TITLE>CGI Test</TITLE>";
print "</HEAD>";
print "<BODY><H2>I just wrote a web page using Perl!</H2>";
print "</BODY></HTML>";
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
Code:
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.
#
<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
Can anyone see why this isn't working? Thanks