I thought I had Apache2 configured properly according to the instructions on Apache site on my testing machine as it looks simple enough with /etc/apache2/sites_available/default as follows:
Code:
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias "/cgi-bin/" "/usr/lib/cgi-bin/" # tried first outside of quotes
AddHandler cgi-script .cgi .yab .pl# tried without it here
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
# AddHandler cgi-script .cgi .yab .pl# tried uncommented
Order allow,deny
Allow from all
</Directory>
Code:
drwxr-sr-x 2 Paul users 4096 Jul 30 22:03 cgi-bin
# tried with different owners
I have the following scripts in /usr/lib/cgi-bin/ the first script is written in yabasic (.yab) I do not know Perl.
Code:
-rwxr-xr-x 1 Paul users 93 Jul 30 20:24 basic_testing.yab
Code:
#!/usr/local/bin/yabasic #(this line is correct)
print "Content-type: text/html"
print: print-: print "It works."
end
Code:
-rwxr-xr-x 1 Paul users 76 Jul 30 21:26 perl_testing.pl
#!/usr/bin/perl #(this line is correct)
print "Content-type: text/html\n\n";
print "Hello, World.";
and the 2 calling scripts in /var/www/html/en/poli/
form_test.yab.htm
Code:
<html><body><head><title></title></head><form method="post" action="/usr/lib/cgi-bin/basic_testing.yab"><input type="submit" value="Submit"></form></body></html>
this was first tried with relative path (/cgi-bin/) which gave a file not found through the browser
form_test.pl.htm
Code:
<html><body><head><title></title></head><form method="post" action="/usr/lib/cgi-bin/perl_testing.pl"><input type="submit" value="Submit"></form></body></html>
"apache2ctl restart" was issued after each modification of the config file
running form_test.yab.htm script in the browser prints the contents of basic_testing.yab while running form_test.pl.htm in the browser asks if perl_testing.pl should be open or saved. There is nothing in the logs. apachectl configtest says syntax OK
Can anyone tell me where my mistake is?
Thank you for your help.