Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm wondering if the following is possible somehow:

Make Apache ask for basic authentication when a resource is requested from the Internet and just bypass the authentication when a request originates from the local network. I found some info about the satisfy directive after reading this here but i cant make it work here the config snippet with which I try to achieve my goal:

<Directory /path/to/published/resource>
    AllowOverride All
    Order deny,allow
    AuthType Basic
    AuthName authname
    AuthUserFile /path/to/authfile
    Require user username
    Allow from 192.168.178
    Satisfy Any
</Directory>

Any suggestions why that doesn't work?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Swap the order and try again:

<Directory /path/to/published/resource>
    AllowOverride All
    AuthType Basic
    AuthName authname
    AuthUserFile /path/to/authfile
    Require user username
    Order allow,deny
    Allow from 192.168.178
    Satisfy Any
</Directory>
share|improve this answer
    
Hi, thanks works perfectly when switching Order allow,deny the other reformatting you did doesn't seems to have any influence, right? –  soriak Sep 4 '12 at 7:25
    
Yes. I just move the Order line to above the Allow from line to follow more easily. –  quanta Sep 4 '12 at 7:33

Your Answer

 
discard

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.