AllowOverride override1 override2 ... Directory
You might ask: if none switches multiple searches off, which of the above options switches it on? The answer is any of them, or the complete absence of AllowOverride. In other words, it is on by default.
To illustrate how this works, look at .../site.override, which is .../site.htaccess with the authentication directives on the salespeople's directory back in again. We have also, to make a visible difference, commented out:
require group cleaners
User webuser Group webgroup ServerName www.butterthlies.com AccessFilename .myaccess ServerAdmin email@example.com DocumentRoot /usr/www/site.htaccess/htdocs/customers ErrorLog /usr/www/site.htaccess/logs/customers/error_log TransferLog /usr/www/site.htaccess/logs/customers/access_log ScriptAlias /cgi-bin /usr/www/cgi-bin <VirtualHost sales.butterthlies.com> ServerAdmin firstname.lastname@example.org DocumentRoot /usr/www/site.htaccess/htdocs/salesmen ServerName sales.butterthlies.com ErrorLog /usr/www/site.htaccess/logs/salesmen/error_log TransferLog /usr/www/site.htaccess/logs/salesmen/access_log ScriptAlias /cgi-bin /usr/www/cgi-bin <Directory /usr/www/site.htaccess/htdocs/salesmen> AuthType Basic AuthName darkness AuthUserFile /usr/www/ok_users/sales AuthGroupFile /usr/www/ok_users/groups require valid-user #require group cleaners </Directory> <Directory /usr/www/cgi-bin> AuthType Basic AuthName darkness AuthUserFile /usr/www/ok_users/sales AuthGroupFile /usr/www/ok_users/groups #AuthDBMUserFile /usr/www/ok_dbm/sales #AuthDBMGroupFile /usr/www/ok_dbm/groups </Directory> </VirtualHost>
Access to the salespeople's site is now restricted to bill, ben, sonia, and daphne, and they need to give a password. If you remember, the .myaccess file of .../site.htaccess had the following lines:
require group cleaners #require valid-user
As things stand in .../site.override, the Config file will prevail and any valid user, such as bill, can get access. If we insert the line:
in the Directory block, httpd.conf allows any valid user access to the salespeople's directory, but .myaccess restricts it further to members of the group cleaners.
Copyright © 2001 O'Reilly & Associates. All rights reserved.