LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Apache and CGI is giving me headaches (https://www.linuxquestions.org/questions/linux-software-2/apache-and-cgi-is-giving-me-headaches-331730/)

inpt 06-08-2005 11:02 PM

Apache and CGI is giving me headaches
 
Every time I try to run a .cgi script with apache I get "403 Forbidden". I know ther permissions are right.

I checked apache's error log and I found:

Code:

[Wed Jun  8 23:52:54 2005] [error] [client 127.0.0.1] Options ExecCGI is off in this directory: /home/joe/public_html/cb.cgi
I've tried setting it up so that apache executes *.cgi files anywhere and everywhere, but I might be missing something.

Can anyone help? Thanks.

this213 06-09-2005 12:39 AM

Look for the lines in your httpd.conf that read (default):
Code:

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

And change them to
Code:

<Directory />
    Options FollowSymLinks ExecCGI
    AllowOverride All
</Directory>

It should be noted that having ExecCGI on for all directories is a security risk

AllowOverride = All will allow you to use .htaccess files in your web directories as well

inpt 06-09-2005 09:30 AM

I've tired doing this. (I did restart the server.)

But, I'm still getting the same error; all the permissions and directories are set to ugo+r. Is there something I'm missing? I've looked through the "httpd.conf" file and I found the scripting DIR. Its set to /var/www/cgi-bin. I commented out this and put it to my own public_html/cgi-bin directory.

Now here is something strange..
Even after I commented out the scripting dir and restarting the server, the *.cgi script works if I put it in /var/www/cgi-bin. Is it possible that I am not restarting it right?
here is what I use to restart:
Code:

killall -HUP httpd

this213 06-10-2005 11:24 AM

Do you have

AddHandler cgi-script .cgi

in your httpd.conf?


All times are GMT -5. The time now is 07:14 PM.