phpldapadmin安装

我有一个LDAP服务器上运行:
ldap://129.168.0.117:389
要么
ldap://roshd.org:389其中roshd.org = 129.168.0.117

我在phpldapadmin的config.php中有这样的configuration:

 $servers = new Datastore(); $servers->newServer('ldap_pla'); $servers->setValue('server','name','My LDAP Server'); $servers->setValue('server','host','192.168.0.117'); $servers->setValue('server','port',389); $servers->setValue('login','auth_type','session'); $servers->setValue('login','bind_id','cn=Manager,dc=roshd,dc=org'); $servers->setValue('login','bind_pass','secret'); $servers->setValue('auto_number','search_base','ou=People,dc=roshd,dc=org'); 

在我的sldap.conf中:

... database bdb directory /usr/local/var/openldap-data suffix "dc=roshd,dc=org" rootdn "cn=Manager,dc=roshd,dc=org" rootpw secret ...
... database bdb directory /usr/local/var/openldap-data suffix "dc=roshd,dc=org" rootdn "cn=Manager,dc=roshd,dc=org" rootpw secret ... 

但是当我试图loginphpldapadmin,我得到这个错误。 有什么想法吗?

Unable to connect to LDAP server My LDAP Server Error: Can't contact LDAP server (-1) for user error Failed to Authenticate to server Invalid Username or Password.
Unable to connect to LDAP server My LDAP Server Error: Can't contact LDAP server (-1) for user error Failed to Authenticate to server Invalid Username or Password. 

指出不同:

$服务器 – >的setValue( '服务器', '宿主', '192.168.0.117');

LDAP://129.168.0.117:389

我怀疑rootpw要么被encryption存储,而要清除文本,在这种情况下,它可能会有不同的结果。 (即秘密的散列值被发送并与明文string密码进行比较)。

如果你正在对LDAP本身进行身份validation,你可能想要检查这个设置: $servers->setValue('login','attr','uid');

 /* If you specified 'cookie' or 'session' as the auth_type above, you can optionally specify here an attribute to use when logging in. If you enter 'uid' and login as 'dsmith', phpLDAPadmin will search for (uid=dsmith) and log in as that user. Leave blank or specify 'dn' to use full DN for logging in. Note also that if your LDAP server requires you to login to perform searches, you can enter the DN to use when searching in 'bind_id' and 'bind_pass' above. */ // $servers->setValue('login','attr','dn'); 

在CentOS 7上,我得到了同样的错误,因为SELinux限制了从httpd对ldap的访问。

 setsebool -P httpd_can_connect_ldap on 

诀窍…

我遇到过同样的问题。 你可以检查下面。

  1. 检查如果你在$ servers-> setValue('server','host','ipaddress')中有正确的ipaddress, 在ldap.conf文件中。 并重新启动tomcat服务器。 干杯。

  2. 用terminal上的“ldapsearch -x”检查用户是否存在或不存在。