in cgi-bin, I have some execs that I want to protect with .htaccess, and
others that I want public. Whats the best way to do this? With a
seperate cgi directory, or by futzing around with .htaccess? Or another
way?
E
E
If you want security, you'll need to use the require and/or allowQuote:> in cgi-bin, I have some execs that I want to protect with .htaccess, and
> others that I want public. Whats the best way to do this? With a
> seperate cgi directory, or by futzing around with .htaccess? Or another
> way?
Read up on the <FILE></FILE> directives
(http://www.apache.org/docs/mod/core.html#files) to learn how to apply
other directives on a per-file basis.
moo
----------------------------------------------------------------------
Ron Klatchko - Senior Software Engineer
UCSF Library and Center for Knowledge Management
>If you want security, you'll need to use the require and/or allow
>directives either in an .htaccess or in the conf files. Simply putting
>the CGI's in a seperate directory without doing anything else (security
>via obfusucation) is considered extremely weak.
>Read up on the <FILE></FILE> directives
>(http://www.apache.org/docs/mod/core.html#files) to learn how to apply
>other directives on a per-file basis.
if ($ENV{REMOTE_ADDR} !~ /204\.152\.10/)
{
print "Content-type: text/html\n\n";
print "You are not authorized to access this program";
exit;
}
<... rest of script follows...>
Of course, this doesn't give you the nice password login pop-up, but
if you really want that, just make a directory for all your "password
protected" scripts, and put them all in there.
cgi-bin/ - all your "public scripts"
cgi-bin/secure/ - all your protected scripts
easy enough.
1. Restricting CGI access in access.conf
3. How to Restrict CGI access on Freebsd?
4. Telnet / FTP access question
5. Restricted access to cgi-directory
7. Apache/Linux CGI: 'Forbidden' execution after restricting Linux access
8. system hang
9. APACHE: access-restricting cgi...how?
10. Restricting access using group id/cgi/perl
11. Restricting specific cgi accesses with apache?
12. how to selectively restrict server-side includes?
13. Selectively proxying or locally running CGI scripts