running cgi programs

softbreeze

Registered
I am attempting to run a cgi from the CGI-EXECUTABLES directory. Apache is using the default configuration file; no changes.

The first time a cgi document is accessed, Apache returns, \"Access Forbidden\". However, if the cgi is accessed directly (which errors) first, Apache functions properly. Thereafter, each access to the document returns the error. So, here is what happens:

localhost/cgi-bin/my.cgi/
HTML:
  Access Forbidden
localhost/cgi-bin/my.cgi  CGI Error
localhost/cgi-bin/my.cgi/[html]  Works Correctly

then, when the process is repeated...

localhost/cgi-bin/my.cgi/[html]  Access Forbidden
localhost/cgi-bin/my.cgi  CGI Error
localhost/cgi-bin/my.cgi/[html]  Works Correctly

The Apache error log states that a directory is being accessed and therefore access is denied.  A directory??

Any idea what\'s going on and how to fix this?

Thanks.
 

jazzy

Registered
I had a similar issue when I was setting up apache on my os x box - then I remembered a little something called the apache.conf file where all sorts of cool config stuff for apache resides. Towards the bottom you will find two settings of note. The first is one to allow server side includes (in the form of cgi) - line 807. The second, starting on line 812, is one to use server parsed html files (shtml). After you make the approapriate changes to the comments here, save the file out (don't forget that normal users can't make changes to this file), and then restart the Apache Server. Provided your scripts are good, you should be right as rain after that.
 
Top