View previous topic :: View next topic |
Author |
Message |
fredu n00b


Joined: 23 Jul 2003 Posts: 62 Location: Turku, Finland
|
Posted: Tue Jul 20, 2004 12:07 pm Post subject: apache .cgi files give error: no permissions |
|
|
I have a file called traffic.cgi in /var/www/localhost/htdocs/rrdtool/ but when I go to my site localhost/rrdtool/traffic.cgi I get the error "You don't have permission to access /rrdtool/traffic.cgi on this server."
I did chmod as root on the file to 755 so it has execution and read rights for all. What is wrong? _________________ I saw this tag first! |
|
Back to top |
|
 |
fredu n00b


Joined: 23 Jul 2003 Posts: 62 Location: Turku, Finland
|
Posted: Tue Jul 20, 2004 12:16 pm Post subject: |
|
|
I could still add that I am able to run the same cgi script if I put it in the folder /var/www/localhost/cgi-bin/ bu all other folders are no-no, so it's probably a apache.conf problem... how do I fix it? _________________ I saw this tag first! |
|
Back to top |
|
 |
cogitate n00b


Joined: 05 Dec 2003 Posts: 46 Location: Ontario, Canada
|
Posted: Tue Jul 20, 2004 1:11 pm Post subject: |
|
|
Check to see if your server configuration allows execution of cgi scripts outside of cgi-bin. I believe by default that the htdocs directory has cgi execution turned off.
You need something like below for the htdocs directory (or any directory you want to limit it to). Note that it works recursively, setting this on /var/www/localhost/htdocs will allow cgi execution from anywhere in the site.
|
|
Back to top |
|
 |
ursus n00b


Joined: 16 Jul 2004 Posts: 16 Location: 52.2170° N, 4.5330° E
|
Posted: Tue Jul 20, 2004 1:20 pm Post subject: |
|
|
Cogitate is correct - CGIExec is off by default everywhere outside of /var/www/localhost/cgi-bin.
This is the bit of your standard Apache config that enables cgi execution:
Code: | <Directory /var/www/localhost/cgi-bin>
AllowOverride All
Options ExecCGI
<IfModule mod_access.c>
Order allow,deny
Allow from all
</IfModule>
</Directory> |
You need to do something similar for any files in other directories. You should restrict ExecCGI to just the places that you need it. Apache bolt it down by default for a reason! |
|
Back to top |
|
 |
|