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'm using HTTPS+basic auth (AuthType Basic ... Require valid-user) to protect a resource, but I'd like to allow connections from localhost through, even if they aren't authenticated.

What's the simplest way of doing that?

share|improve this question
Oops, clearly my searching-foo failed me today. Thanks. – David Wolever Nov 19 '09 at 20:44
up vote 15 down vote accepted

You can tell apache to allow connections from specific IP addresses, like this:

Allow from
Satisfy Any

If you add that to your authentication scheme it will allow any IP address in the - range to access your content.

A full example may look like this (I am using digest, just substitute with your basic code):

<Location />
    Order deny,allow
    Deny from all
    AuthName "SomeSite"
    AuthType Digest
    AuthDigestProvider file
    AuthUserFile /etc/apache2/password.file
    Require valid-user
    Allow from
    Satisfy Any
share|improve this answer
Ah, 'satisfy' – that was the directive I was missing. Thanks! – David Wolever Nov 19 '09 at 20:36

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.