Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to configure Apache to allow connections from A specific IP or otherwise based on usernames. Is this possible? For now I am having this configuration which is username based.

<Directory />

    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
<Location />
    AuthType SSPI
    SSPIAuth On
    SSPIAuthoritative On
    SSPIOfferBasic On
    Require group GROUP_NAME
share|improve this question
up vote 4 down vote accepted

you can use the "satisfy" condition :

AuthUserFile /path/to/.htpasswd
AuthType Basic
AuthName "Restricted Area"
Require valid-user

Order Deny,Allow
Allow from
Allow from
Deny from all

Satisfy any

that means if the user does not have the ip 'Allow from', he will be asked to enter a password

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.