Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
apache .cgi files give error: no permissions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
fredu
n00b
n00b


Joined: 23 Jul 2003
Posts: 62
Location: Turku, Finland

PostPosted: Tue Jul 20, 2004 12:07 pm    Post subject: apache .cgi files give error: no permissions Reply with quote

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
View user's profile Send private message
fredu
n00b
n00b


Joined: 23 Jul 2003
Posts: 62
Location: Turku, Finland

PostPosted: Tue Jul 20, 2004 12:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
cogitate
n00b
n00b


Joined: 05 Dec 2003
Posts: 46
Location: Ontario, Canada

PostPosted: Tue Jul 20, 2004 1:11 pm    Post subject: Reply with quote

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.
Code:
Options ExecCGI
Back to top
View user's profile Send private message
ursus
n00b
n00b


Joined: 16 Jul 2004
Posts: 16
Location: 52.2170° N, 4.5330° E

PostPosted: Tue Jul 20, 2004 1:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum