Click to See Complete Forum and Search --> : CGI just won't work, please I'm beggin


mazeroth
10-01-2002, 10:21 PM
Hey people. I searched all over the place and other people have had similar problem but I couldn't find a fix. I'm trying to get cgi to work but I can't. I have Mandrake 9. No matter what I do, when I try to access a script it says forbidden.

Here's my commonhttpd.conf file

http://azeroth2.no-ip.org/~azeroth/commonhttpd.conf

please take a look and let me know what's wrong. All the chmod numbers are set right.

I did what the apache tutorial said, made a first.cgi file that when I execute from the shell works, but not through a browser.

http://azeroth2.no-ip.org/cgi-bin/first.cgi

PLEASE HELP ME OUT!!! Thanks.

saithan
10-01-2002, 10:32 PM
try setting the permisions on the cgi script to allow the server to execute
maybe try:
chmod 755 name_of_script
also make sure the permisions on the cgi-bin are correct.
from trying to access the page I get forbidden, telling me that most likly there is a permission problem. also as a tip look in the error log for info on the nature of what could be happening.

scanez
10-01-2002, 10:35 PM
What are the permissions on /var/www/cgi-bin/ and first.cgi? Also, you have

<Directory /var/www/cgi-bin>
AllowOverride All
Options ExecCGI Includes IncludesNOEXEC
</Directory>

in your file there. The way I have it under Debian would be

<Directory /var/www/cgi-bin/>
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>

so you might want to try that too.

mazeroth
10-01-2002, 11:53 PM
Thanks you two for the help. Ok, both the cgi-bin folder and the first.cgi file are under apache/apache user/group.

I changed my common file to what you have and that fixed it. Now I'm trying to get a simple text counter to work and I can't do it. It works when I try to access it by

azeroth2.no-ip.org/cgi-bin/counter/counter.cgi

But I guess I'm calling it wrong from .shtml page.

Should be:

<!--#exec cgi="/var/www/cgi-bin/counter/counter.cgi" -->

Right? chmod 777 on that folder, user/group apache/apache