0

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?

soriak
  • 13
  • 5

1 Answers1

2

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>
quanta
  • 51,413
  • 19
  • 159
  • 217
  • Hi, thanks works perfectly when switching Order allow,deny the other reformatting you did doesn't seems to have any influence, right? – soriak Sep 04 '12 at 07:25
  • Yes. I just move the `Order` line to above the `Allow from` line to follow more easily. – quanta Sep 04 '12 at 07:33