Web interface authentication

Markus Baertschi markus at markus.org
Thu Nov 21 10:13:58 CET 2002


After some tweaking and reading apache documentation I've found a
simple solution for me. This provides the following:
- The information-display cgi's (all but cmd.cgi) are accessible
  to anyone without authentication
- The 'cmd.cgi' required authentication

The trick is to allow access to the directory <DIRECTORY> directive,
but require authentication on an individual file using the <FILE>
directive. 

Here the corresponding lines from my httpd.conf:

<Directory /usr/local/nagios/sbin>
  AllowOverride AuthConfig
  order allow,deny
  allow from all
  Options ExecCGI
  AuthName "Nagios Access"
  AuthType Basic
  AuthUserFile /usr/local/nagios/etc/htpasswd.users
#  require valid-user
  <FILES cmd.cgi>
    require valid-user
  </FILES>
</Directory>

Markus



--
  Markus Baertschi             Phone: ++41 (21) 807 1677
  Bas du Rossé 14b             Fax  : ++41 (21) 807 1678
  CH-1163, Etoy                Email: markus at markus.org
  Switzerland                  Homepage: www.markus.org




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf




More information about the Users mailing list