Ask for a password, unless from specified IP (Apache)
Q. When accessing a directory in apache, I would like to set up a way to ask for a password from a user if he is not listed on the allowed IP list.
A. This one is a bit of a pain to figure out, so here it is:
<Location />
Order Deny,Allow
Deny from all
AuthType Basic
AuthName "Access Restricted"
AuthUserFile "/var/www/.htpass" #your password file
Require valid-user
Allow from 192.168.5.10
Allow from 192.168.10.10
Allow from 10.10.10.3
Satisfy Any
</Location>
Last Updated on Saturday, 16 October 2010 10:45
Add your comment
yvComment v.1.24.0