Page 1 of 1

[SOLVED] 'Allow from' and 'require' in httpd.conf

Posted: Wed Apr 26, 2006 6:47 am
by Grim...
I want to let one person into a particular part of my website, but I always want to be able to get in from my home location (without filling the password box).

Here's what I have:

Code: Select all

<Directory "/var/www/my/directory">
    AuthUserFile /var/www/my/directory/.htpasswd
    order allow,deny
    require user bob
    Authname "Login For Bob"
    Authtype Basic
    AllowOverride All
    allow from .mylocation.com
  </Directory>
I don't normally do Apache stuff, so that has been copied and pasted from other location, and the docs are a bit too complicated.
At the moment, the above always asks for a password, even though I am connecting from mylocation.com.

Any suggestions / advice / glaring errors?

Posted: Wed Apr 26, 2006 8:47 am
by Grim...
Found the answer!

Code: Select all

<Directory "/var/www/my/directory">
    AuthUserFile /var/www/my/directory/.htpasswd
    Order deny,allow
    Deny from all
    Require user bob
    Authname "Login For Bob"
    Authtype Basic
    AllowOverride All
    Allow from .mylocation.com
    Satisfy any
  </Directory>
Note the changed order, and the new 'deny from all' and 'satisfy any' lines.