DeveloperSide.NET Forums

DeveloperSide.NET => Web.Developer Server Suite Community Edition,
Public Support Forum => Topic started by: lawrence on September 03, 2007, 06:58:58 PM



Title: 'Forbidden' message running cgi-bin scripts
Post by: lawrence on September 03, 2007, 06:58:58 PM
Hi,
I installed two different file tranfer scripts. Both give me the same error when ran:
'Forbidden
you don't have permission to access /'appdir'/cgi-bin/progress.cgi on this server'
I get this message after I followed your instructions and introduced the following lines into the www\Apache22\conf\httpd.conf file:

AddHandler cgi-script .cgi .pl
<Directory />
    Options ExecCGI
    AllowOverride None
    Order allow,deny
    Deny from all
</Directory>

My understanding is that this change allows Apache to run cgi-bin scripts outside the cgi installation folder: www\cgi-bin\
Those two scripts created their own cgi-bin directories in their respective installation folders within the webroot. I changed the first line of all the files in the newly created cgi-bin directories to *!C:/www/perl/bin/perl.exe from the original *!/usr/perl/bin/perl (the initial symbol is not '*' but I couldn't get it here)
Just to mention that, before this change I was getting the text in the /'appdir'/cgi-bin/upload.cgi file dysplayed on the screen.Now I get  the forbidden message.
My system is windows 2000 server. I set the permissions to allow all in the cgi-bin  folders.

Please help.

Thank you



Title: Re: 'Forbidden' message running cgi-bin scripts
Post by: admin on September 03, 2007, 08:42:15 PM
Change / to /'appdir'/cgi-bin/


Title: Re: 'Forbidden' message running cgi-bin scripts
Post by: lawrence on September 04, 2007, 09:47:53 PM
If I understood correctly I should replace <Directory /> with <Directory /easy/cgi-bin> in the httpd.conf file.
I tried with and without the trailing slash ie <Directory /easy/cgi-bin/> or <Directory /easy/cgi-bin>. Also tried with and without the full path ie:
<Directory D:/www/webroot/easy/cgi-bin/> or <Directory /easy/cgi-bin/> It still doesn't work.
I get the same: \Forbidden message 'You don't have permission to access /easy//cgi-bin/progress.cgi on this server'. It drives me nuts. By the way, is it  normal to have the two forward slashes (easy//cgi.bi...)  in the error message?

Thanks





Title: Re: 'Forbidden' message running cgi-bin scripts
Post by: admin on September 04, 2007, 09:56:25 PM
I just noticed this...

Order allow,deny
Deny from all

That second line should be 'Allow from all'. But you still need to have the full path to the cgi dir.


Title: Re: 'Forbidden' message running cgi-bin scripts
Post by: Intermecman on September 30, 2007, 11:34:19 PM
Did you ever get this working? Were you using the v1.95 Windows Web-Development Server Suite platform? I have looked through many of the forum postings and tried so many different settings and configurations that I am totally at a loss and frustrated. I must be missing that one key element that is killing me. I want to specifically run a formmail.pl script but also receive foridden messages or it loads the script as a text file instead of executing it. It appears Apache 2.2 has changed many of the load structure of the httpd.conf file and the on-line web documentation isn't the best. Is their any secret 5 minute install on how to get this to work from a new fresh install? Thanks in Advance!


Title: Re: 'Forbidden' message running cgi-bin scripts
Post by: admin on October 01, 2007, 12:24:41 AM
Did you change the 'shebang' line of the script?

The 1st line should point to the interpreter.

In this case it should be...
Code:
#!/www/perl/bin/perl.exe

Place the file under \www\cgi-bin, and unless the configuration files are messed up, it should run from localhost\cgi-bin\your-file.pl