我一直在试图用Apache 2.2.3来设置冗余的LDAP服务器。
/etc/httpd/conf.d/authn_alias.conf
<AuthnProviderAlias ldap master> AuthLDAPURL ldap://192.168.5.148:389/dc=domain,dc=vn?cn AuthLDAPBindDN cn=anonymous,ou=it,dc=domain,dc=vn AuthLDAPBindPassword pa$$w0rd </AuthnProviderAlias> <AuthnProviderAlias ldap slave> AuthLDAPURL ldap://192.168.5.199:389/dc=domain,dc=vn?cn AuthLDAPBindDN cn=anonymous,ou=it,dc=domain,dc=vn AuthLDAPBindPassword pa$$w0rd </AuthnProviderAlias>
/etc/httpd/conf.d/authz_ldap.conf
# # mod_authz_ldap can be used to implement access control and # authenticate users against an LDAP database. # LoadModule authz_ldap_module modules/mod_authz_ldap.so <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 </Location> </IfModule>
如果我理解正确, mod_authz_ldap将尝试search第二个LDAP中的用户,如果第一个服务器closures或OpenLDAP没有运行。
但实际上,这并没有发生。 通过在主服务器上停止LDAP进行testing,访问Subversion版本库时,出现“500内部服务器错误” 。 error_log显示:
[11061] auth_ldap authenticate: user quanta authentication failed; URI / [LDAP: ldap_simple_bind_s() failed][Can't contact LDAP server]
我误解了吗? AuthBasicProvider ldap1 ldap2仅意味着如果mod_authz_ldap无法在ldap1中find用户,则将继续使用ldap2。 它不包括故障转移function(ldap1必须运行并正常工作)?
我远不是LDAP的专家,但根据mod_authnz_ldap文档,您必须在AuthLDAPUrl指令中指定故障转移LDAP服务器,像这样
AuthLDAPURL "ldap://ldap1.airius.com ldap2.airius.com/ou=People, o=Airius"
您不能为故障转移设置不同的filter。 故障转移必须是服务于相同数据的主服务器的镜像。
克里斯托弗·佩林(Christopher Perrin)说了什么,而且默认的超时时间是10秒,你可能想缩短这个时间,所以你“快速地失败”,人们得到的反应更快。