Forum Moderators: phranque
<Location "/intranet">
AuthType Basic
AuthName "Red"
AuthzLDAPAuthoritative On
AuthzLDAPMethod ldap
AuthzLDAPProtocolVersion 3
AuthzLDAPServer servidor.dominio.es:389
AuthzLDAPUserBase ou=Users,dc=dominio,dc=es
AuthzLDAPUserKey uid
satisfy any
order deny,allow
allow from x.x.x.x x.x.x.x
deny from all
# Require valid-user
AuthzLDAPGroupBase ou=Groups,dc=dominio,dc=es
AuthzLDAPGroupKey uid
AuthzLDAPMemberKey memberUid
AuthzLDAPSetGroupAuth user
Require group "Domain Users"
# Require ldap-filter (!(uid=sala)) <- want to restict user "sala" from entering the intranet
</Location>
[client x.x.x.x] [25682] requirement 'ldap-filter' not known to mod_authz_ldap
<Location "/intranet">
AuthType Basic
AuthName "Red"
AuthzLDAPAuthoritative On
AuthzLDAPMethod ldap
AuthzLDAPProtocolVersion 3
AuthzLDAPServer server.domain.es:389
AuthzLDAPUserBase ou=Users,dc=domain,dc=es
AuthzLDAPUserKey uid
satisfy any
order deny,allow
allow from x.x.x x.x.x
deny from all
Require filter (!(uid=sala))
# Require valid-user
AuthzLDAPGroupBase ou=Groups,dc=domain,dc=es
AuthzLDAPGroupKey cn
AuthzLDAPMemberKey memberUid
AuthzLDAPSetGroupAuth user
# Require group "Domain Users"
</Location>
I cant use it because it says is for apache 2.3 or later and I have 2.2, I tried to updated but there is not apache 2.3 for RHEL6
SetEnvIf {ldap stuff here} goodtogo=1
SetEnvIf {stuff about specific bad users here} goodtogo=0
and then
Allow from env=goodtogo
their username no matter from which IP or machine is login in
5. %{LA-U:variable} can be used for look-aheads which perform an internal (URL-based) sub-request to determine the final value of variable. This can be used to access variable for rewriting which is not available at the current stage, but will be set in a later phase.
For instance, to rewrite according to the REMOTE_USER variable from within the per-server context (httpd.conf file) you must use %{LA-U:REMOTE_USER} - this variable is set by the authorization phases, which come after the URL translation phase (during which mod_rewrite operates).
On the other hand, because mod_rewrite implements its per-directory context (.htaccess file) via the Fixup phase of the API and because the authorization phases come before this phase, you just can use %{REMOTE_USER} in that context.
<Directory "/var/www/html/intranet">
AuthType Basic
AuthName "Red Intranet"
AuthzLDAPAuthoritative on
AuthzLDAPMethod ldap
AuthzLDAPProtocolVersion 3
AuthzLDAPServer server.domain.es:389
AuthzLDAPUserBase ou=Users,dc=domain,dc=es
AuthzLDAPUserKey uid
AuthLDAPBindDN "uid=root,ou=Users,dc=domain,dc=es"
AuthLDAPBindPassword "password"
order deny,allow
deny from all
allow from 172.31.1 172.31.2 172.31.3 172.31.4 172.31.5
AuthzLDAPGroupBase ou=Groups,dc=domain,dc=es
AuthzLDAPGroupKey uid
AuthzLDAPMemberKey memberUid
AuthzLDAPSetGroupAuth user
Require group 'zIntranet'
satisfy any
</Directory>