請教ldap和phpldapadmin的整合,報錯不能連接
我的ldap啟動后馬上就停止了,不知道什麼原因,
錯誤提示1:
Spin loop detection.
Array
(
=> 不能連接到"192.168.20.230" 的"389"埠
=> Array
(
=> Array
(
=> 錯誤
=> 不能連接到"192.168.20.230" 的"389"埠
=> error
)
我看日誌,得到錯誤提示2:
# cat ldap.log
Apr 10 11:24:00 hw slapd: @(#) $OpenLDAP: slapd 2.4.11 (Apr 8 2009 16:59:49) $ root@hw:/root/openldap-2.4.11/servers/slapd
Apr 10 11:24:01 hw slapd: bdb_db_open: database "dc=heweisoft,dc=com": unclean shutdown detected; attempting recovery.
Apr 10 11:24:01 hw slapd: bdb_db_open: warning - no DB_CONFIG file found in directory /usr/local/openldap/var/openldap-data: (2). Expect poor performance for suffix "dc=heweisoft,dc=com".
Apr 10 11:24:01 hw slapd: bdb_monitor_db_open: monitoring disabled; configure monitor database to enable
Apr 10 11:24:01 hw slapd: slapd starting
Apr 10 11:24:03 hw slapd: daemon: shutdown requested and initiated.
Apr 10 11:24:03 hw slapd: slapd shutdown: waiting for 0 threads to terminate
Apr 10 11:24:03 hw slapd: slapd stopped.
Apr 10 11:24:09 hw slapd: @(#) $OpenLDAP: slapd 2.4.11 (Apr 8 2009 16:59:49) $ root@hw:/root/openldap-2.4.11/servers/slapd
Apr 10 11:24:09 hw slapd: bdb_db_open: warning - no DB_CONFIG file found in directory /usr/local/openldap/var/openldap-data: (2). Expect poor performance for suffix "dc=heweisoft,dc=com".
Apr 10 11:24:09 hw slapd: bdb_monitor_db_open: monitoring disabled; configure monitor database to enable
Apr 10 11:24:09 hw slapd: slapd starting
謝謝大蝦
《解決方案》
sladp.conf配置:
# $OpenLDAP: pkg/ldap/servers/slapd/slapd.conf,v 1.23.2.8 2003/05/24 23:19:14 kurt Exp $
#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include /usr/local/openldap/etc/openldap/schema/core.schema 設置schema配置文檔包含
# Define global ACLs to disable default read access.
# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral ldap://root.openldap.org
pidfile /usr/local/openldap/var/slapd.pid
argsfile /usr/local/openldap/var/slapd.args
# Load dynamic backend modules:
# modulepath /usr/local/openldap/libexec/openldap
# moduleload back_bdb.la
# moduleload back_ldap.la
# moduleload back_ldbm.la
# moduleload back_passwd.la
# moduleload back_shell.la
# Sample security restrictions
# Require integrity protection (prevent hijacking)
# Require 112-bit (3DES or better) encryption for updates
# Require 63-bit encryption for simple bind
# security ssf=1 update_ssf=112 simple_bind=64
# Sample access control policy:
# Root DSE: allow anyone to read it
# Subschema (sub)entry DSE: allow anyone to read it
# Other DSEs:
# Subschema (sub)entry DSE: allow anyone to read it
# Other DSEs:
# Allow self write access
# Allow authenticated users read access
# Allow anonymous users to authenticate
# Directives needed to implement policy:
# access to dn.base="" by * read
# access to dn.base="cn=Subschema" by * read
# access to *
# by self write
# by users read
# by anonymous auth
#
# if no access controls are present, the default policy is:
# Allow read by all
#
# rootdn can always write!
#######################################################################
# ldbm database definitions
#######################################################################
database bdb
suffix "dc=heweisoft,dc=com"
rootdn "cn=admin,dc=heweisoft,dc=com"
# Cleartext passwords, especially for the rootdn, should
# be avoid. See slappasswd( and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw 07050927
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory /usr/local/openldap/var/openldap-data # Indices to maintain
index objectClass eq
[ 本帖最後由 wwyhy 於 2009-4-11 13:14 編輯 ]
《解決方案》
ldap.conf配置:
# $OpenLDAP: pkg/ldap/libraries/libldap/ldap.conf,v 1.9 2000/09/04 19:57:01 kurt Exp $
#
# LDAP Defaults
#
# See ldap.conf(5) for details
# This file should be world readable but not world writable.
BASE dc=heweisoft, dc=com
URI ldap://heweisoft.com
#URI ldap://ldap.example.com ldap://ldap-master.example.com:666
#SIZELIMIT 12
#TIMELIMIT 15
#DEREF never
[ 本帖最後由 wwyhy 於 2009-4-11 13:14 編輯 ]
《解決方案》
phpldapadmin的config文件改了以下:
$ldapservers->SetValue($i,'server','name','My LDAP Server');
$ldapservers->SetValue($i,'server','host','localhost');
$ldapservers->SetValue($i,'server','port','389');
$ldapservers->SetValue($i,'server','base',array('dc=heweisoft,dc=com'));
$ldapservers->SetValue($i,'login','dn','');
$ldapservers->SetValue($i,'login','pass','');
《解決方案》
沒有整合過,所有幫不了lz哦:mrgreen:
您可以嘗試安裝一下iredos,我知道裡面整合了ldap和phpldapadmin。看看它的配置。
或者您google吧
《解決方案》
用windows提供的ldp命令就行,phpLdapAdmin還需要裝一大堆東西
《解決方案》
lz首先要確保您的openldap能運行,而且在命令行下,可以執行add 、search等操作。然後再進行phpldapadmin的整合。
《解決方案》
原帖由 wwyhy 於 2009-4-11 13:17 發表 http://bbs3.chinaunix.net/images/common/back.gif
phpldapadmin的config文件改了以下:
$ldapservers->SetValue($i,'server','name','My LDAP Server');
$ldapservers->SetValue($i,'server','host','localhost');
$ldapservers->SetValue($i,'server',' ...
加上密碼$ldapservers->SetValue($i,'login','pass','07050927『);
我剛剛很快整合好!
我的環境是Cento5.2,除了phpldapadmin外,所有的關於ldap的包都是centos自帶的。
[ 本帖最後由 diyself 於 2009-4-12 21:51 編輯 ]
《解決方案》
加上密碼$ldapservers->SetValue($i,'login','pass','07050927『);
也不得行。
我netstat -lnp|grep 389 怎麼有2個在監聽啊:
tcp 0 0 0.0.0.0:389 0.0.0.0:* LISTEN 26828/slapd
tcp 0 0 :::389 :::* LISTEN 26828/slapd
只要我對openldap做操作,他服務就停止了,不知道為何?
《解決方案》
原帖由 wwyhy 於 2009-4-14 14:14 發表 http://bbs3.chinaunix.net/images/common/back.gif
加上密碼$ldapservers->SetValue($i,'login','pass','07050927『);
也不得行。
我netstat -lnp|grep 389 怎麼有2個在監聽啊:
tcp 0 0 0.0.0.0:389 0.0.0.0:* ...
您用ldapadd能不能添加數據啊?您的openldap究竟是不是正常運行先?
如果不能正常運行,先弄好它,再搞整合。
「服務就停止」,看看日誌提示什麼咯!