cgi-bin (object not found, access forbidden)
[This posting doesn't like url's, so I've replaced the url's below with "URL"]
Hi, I've been tearing my hair out on this one for ages. There was a similar posting about this, but I tried it all and just got more confused.
I'm using Apache 9 with Webmin. I'm trying to allow cgi scripts to run on virtual servers. I've created this in Apache directives file (httpd.conf):
DocumentRoot /home/sites/lho/web
ServerName lho.com
ServerAlias lho.com URL
ScriptAlias /cgi-bin/ /home/sites/web/lho/cgi-bin/
Then I tried to edit the entire httpd.conf file:
#ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
ScriptAlias /cgi-bin/ "/home/sites/"
(I also tried commenting out the scriptalias directive, btw.)
I also ensured that there was the directive:
AddHandler cgi-script .cgi
and noticed there was a 'default' setting:
<Directory />
# Options FollowSymLinks
Options Indexes FollowSymLinks ExecCGI
AllowOverride None
</Directory>
I then tried simply to display an index.html file in the cgi-bin directory and got "object not found", but if I changed the name to cgibin and typed in "URL/cgibin" then the file was displayed (!!??)
When I tried to execute "URL/cgi-bin/hello.cgi" I got "server error: premature end of script headers", but when I tried it with cgibin/hello.cgi I got "access forbidden". I also get this message if I comment out all the ScriptAlias directives.
hello.cgi:
#!/usr/bin/perl
print "content-type:text/html\n\nHello World!";
exit;
The cgi-bin (cgibin) directory has 777 permissions, the cgi file has 755 permissions.
What am I missing?
Many thanks...
|