1

In / directory I'm using AuthType SPNEGO, but in one subdirectory I need to have no authentication, but to be accesible just from listed ip addresses. Here is current configuration of that directory:

<Directory /foo/bar>
  Order Deny,Allow
  Deny from all
  Allow from 1.2.3.4 1.2.3.5
</Directory>

By adding Satisfy Any (as described here) is directory accessible without authentication, but is accessible for all ip addresses, not just for that that are listed. How can I achieve that?

Configuration of /:

<Directory />
  AuthName "FOO"
  <IfDefine AUTH_SPNEGO>
    Krb5ServiceName HTTP
    AuthType SPNEGO
  </IfDefine>
  require valid-user
  allow from all
</Directory>
Community
  • 1
  • 1
tarmaq
  • 422
  • 2
  • 7

1 Answers1

0

You can do like this:

<Directory /foo/bar>
  Order Deny,Allow
  Deny from all
  Allow from 1.2.3.4 1.2.3.5
</Directory>

<DirectoryMatch /(?!foo/bar)>
  AuthName "FOO"
  <IfDefine AUTH_SPNEGO>
    Krb5ServiceName HTTP
    AuthType SPNEGO
  </IfDefine>
  require valid-user
  allow from all
</DirectoryMatch>

/foo/bar is accessible only by the specific IP (1.2.3.4 and 1.2.3.5 in this example)

And we set the password authentication for / excluding /foo/bar

Céline Aussourd
  • 10,214
  • 4
  • 32
  • 36