httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yehuda Katz <yeh...@ymkatz.net>
Subject Re: [users@httpd] Can I use different Directory according to the source IP?
Date Thu, 24 Jul 2014 03:50:44 GMT
On Wed, Jul 23, 2014 at 7:30 PM, Mark jensen <ngiw2012@hotmail.com> wrote:

> First, I may ask the question in a different way: can we have two defined
> Directory tag for one directory?
>

It would not accomplish what you want if it would work at all.


> - users with source 192.168.1
>

> <Directory /var/www/html/directory>
>       Order Deny,Allow
>       Deny from all
>       Allow from 192.168.1
> </Directory>
>
> - other users (need to be authenticated using LDAP):
>
> <Directory /var/www/html/directory>
>       AuthName "LDAP Authentication"
>       AuthType Basic
>       AuthBasicProvider ldap
>       AuthzLDAPauthoritative off
>       AuthLDAPURL ldap://
> 192.168.1.3/dc=example,dc=com?uid?sub?(objectClass=*)
>       Require valid-user
> </Directory>
>
>
If these are really your requirements, you could use Satisfy Any:
https://wiki.apache.org/httpd/BypassAuthenticationOrAuthorizationRequirements

<Directory /var/www/html/directory>
      AuthName "LDAP Authentication"
      AuthType Basic
      AuthBasicProvider ldap
      AuthzLDAPauthoritative off
      AuthLDAPURL ldap://
192.168.1.3/dc=example,dc=com?uid?sub?(objectClass=*)
      Require valid-user
      Order allow,deny
      Allow from 192.168.1
      Satisfy any
</Directory>

- Y

Mime
View raw message