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

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

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

Post 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?
Last edited by Grim... on Wed Apr 26, 2006 8:47 am, edited 1 time in total.
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post 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.
Post Reply