Restricting CGI access in access.conf

Restricting CGI access in access.conf

Post by Doran L. Bart » Tue, 13 Apr 1999 04:00:00




>Hi All,
>I am trying to modify the access.conf server configuration file to
>restrict CGI access from remote hosts to CGI files in a particular
>directory yet allow CGI access in the same directory for visitors to my
>web site (i.e., people who come using their browsers).
>This way you actually must be visiting my site to access the CGI script.  I
>want to do the same but from the web server level, before PERL is called.

I believe you can find the solution with the rewrite module. All those nice
environment variables are available in the rewrite configuration:

  Rewri*gine on
  RewriteCond %{REQUEST_URI} /cgi-bin/my.cgi
  RewriteCond %{HTTP_REFERER} ! ^http://www.veryComputer.com/ [NC]
  RewriteRule (.*) http://www.veryComputer.com/

Put this in httpd.conf and away you go. :-)

-=Fozz

--

 "I have learned much more about Microsoft by using the Linux operating
  system than I ever would have done by using Windows." --Neal Stephenson

 
 
 

1. access restricted by password: problem with nested directories with different accesses

Hi there!

Here is a small problem i encoutner:
i have a Apache Server, with directory /admin that is restricted to user
webmaster
Recently, i have installed in this dir a subdir containing a program
that also interested the user root ( unix machine admininstrator).
(btw. this app is Big brother, you are strongly invited to try it )
In this way  i created him a http identity "root", with a pass.
I've also modified the access.conf:

# only webmaster access
<Directory /home/httpd/htdocs/admin>
        Options Indexes FollowSymLinks Includes
        AuthName Webmaster
    AllowOverride None
        <Limit GET>
                require user web
        </Limit>
</Directory>

# webmaster AND root access
<Directory /home/httpd/htdocs/admin/bb>
        Options Indexes FollowSymLinks Includes
        AuthName Webmaster or Admin
    AllowOverride None
        <Limit GET>
                require user root web
        </Limit>
</Directory>

But when i (web) try to connect to bb,;apcahe ask for my pass *twice* .
I guessed that Apcahe check the access for both directories.
I tried a few other configs, but none worked.

Any Apache Guru that knows how to fix that ?

Leo

2. A Little help to Denise's Linux Box...

3. Can I define srm.conf, access.conf in httpd.conf ?

4. RH 7.3 sendmail config tool?

5. How to Restrict CGI access on Freebsd?

6. OpenBSD performance

7. Restricted access to cgi-directory

8. Route command with netmask?

9. Apache/Linux CGI: 'Forbidden' execution after restricting Linux access

10. APACHE: access-restricting cgi...how?

11. Restricting access using group id/cgi/perl

12. selectively restricting cgi access

13. Restricting specific cgi accesses with apache?