Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been trying to setup redundant LDAP servers with Apache 2.2.3.


<AuthnProviderAlias ldap master>
    AuthLDAPURL ldap://,dc=vn?cn
    AuthLDAPBindDN cn=anonymous,ou=it,dc=domain,dc=vn
    AuthLDAPBindPassword pa$$w0rd

<AuthnProviderAlias ldap slave>
    AuthLDAPURL ldap://,dc=vn?cn
    AuthLDAPBindDN cn=anonymous,ou=it,dc=domain,dc=vn
    AuthLDAPBindPassword pa$$w0rd


# mod_authz_ldap can be used to implement access control and 
# authenticate users against an LDAP database.

LoadModule authz_ldap_module modules/

<IfModule mod_authz_ldap.c>
   <Location />
        AuthBasicProvider master slave
        AuthzLDAPAuthoritative Off
        AuthType Basic
        AuthName "Authorization required"

        AuthzLDAPMemberKey member
        AuthUserFile /home/setup/svn/auth-conf
        AuthzLDAPSetGroupAuth user
        require valid-user
        AuthzLDAPLogLevel error

If I understand correctly, mod_authz_ldap will try to search users in the second LDAP if the first server is down or OpenLDAP on it is not running.

But in practice, it does not happen. Tested by stopping LDAP on the master, I get the "500 Internal Server Error" when accessing to the Subversion repository. The error_log shows:

[11061] auth_ldap authenticate: user quanta authentication failed; URI / [LDAP: ldap_simple_bind_s() failed][Can't contact LDAP server]

Did I misunderstand? AuthBasicProvider ldap1 ldap2 only means that if mod_authz_ldap can't find the user in ldap1, it will continue with ldap2. It doesn't include the failover feature (ldap1 must be running and working fine)?

share|improve this question
up vote 4 down vote accepted

I'm far from beaing a specialist for LDAP but according to the mod_authnz_ldap docs you have to specify the failover LDAP server in the AuthLDAPUrl Directive like this

AuthLDAPURL "ldap://, o=Airius"

Edit: Clarification

You cannot set different filters for the failovers. A failover has to be a mirror of the primary server to serve the same data.

share|improve this answer
Thanks. This works: AuthLDAPURL "ldap://ldap1:389 ldap2:389/dc=domain,dc=vn?cn?sub?(objectClass=*)" but this doesn't: AuthLDAPURL "ldap://ldap1:389/dc=domain,dc=vn?cn?sub?(objectClass=*) ldap2:389/dc=domain,dc=vn?cn?sub?(objectClass=*)" (Bad URL encountered while parsing LDAP URL). What happens if I want to specify different filter for 2 ldaps? Moreover, does anyone else get it working with mod_authz_ldap? – quanta Jul 2 '12 at 4:25
A failover should be a copy of the main ldap server. Otherwise it would be no failover. – Christopher Perrin Jul 2 '12 at 15:18

What Christopher Perrin said, but also the default timeout is ten seconds, which you may want to shorten so you 'fail fast' and people get a response back quicker.

share|improve this answer

Your Answer


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.