免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 6911 | 回复: 13
打印 上一主题 下一主题

[ldap] 请教ldap和phpldapadmin的整合,报错不能连接 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-04-10 11:24 |只看该作者 |倒序浏览
我的ldap启动后马上就停止了,不知道什么原因,

错误提示1:
Spin loop detection.
Array
(
    [msg] => 不能连接到"192.168.20.230" 的"389"端口
    [session] => Array
        (
            [0] => Array
                (
                    [title] => 错误
                    [body] => 不能连接到"192.168.20.230" 的"389"端口
                    [type] => error
                )


我看日志,得到错误提示2:


[root@hw log]# cat ldap.log
Apr 10 11:24:00 hw slapd[5527]: @(#) $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[5527]: bdb_db_open: database "dc=heweisoft,dc=com": unclean shutdown detected; attempting recovery.
Apr 10 11:24:01 hw slapd[5527]: 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[5527]: bdb_monitor_db_open: monitoring disabled; configure monitor database to enable
Apr 10 11:24:01 hw slapd[5527]: slapd starting
Apr 10 11:24:03 hw slapd[5527]: daemon: shutdown requested and initiated.
Apr 10 11:24:03 hw slapd[5527]: slapd shutdown: waiting for 0 threads to terminate
Apr 10 11:24:03 hw slapd[5527]: slapd stopped.
Apr 10 11:24:09 hw slapd[5529]: @(#) $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[5530]: 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[5530]: bdb_monitor_db_open: monitoring disabled; configure monitor database to enable
Apr 10 11:24:09 hw slapd[5530]: slapd starting



谢谢大虾

论坛徽章:
0
2 [报告]
发表于 2009-04-11 13:11 |只看该作者
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 编辑 ]

论坛徽章:
0
3 [报告]
发表于 2009-04-11 13:13 |只看该作者
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 编辑 ]

论坛徽章:
0
4 [报告]
发表于 2009-04-11 13:17 |只看该作者
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','');

论坛徽章:
0
5 [报告]
发表于 2009-04-11 19:10 |只看该作者
没有整合过,所有帮不了lz哦


您可以尝试安装一下iredos,我知道里面整合了ldap和phpldapadmin。看看它的配置。

或者您google吧

论坛徽章:
0
6 [报告]
发表于 2009-04-12 20:41 |只看该作者
用windows提供的ldp命令就行,phpLdapAdmin还需要装一大堆东西

论坛徽章:
0
7 [报告]
发表于 2009-04-12 21:40 |只看该作者
lz首先要确保您的openldap能运行,而且在命令行下,可以执行add 、search等操作。然后再进行phpldapadmin的整合。

论坛徽章:
0
8 [报告]
发表于 2009-04-12 21:42 |只看该作者
原帖由 wwyhy 于 2009-4-11 13:17 发表
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 编辑 ]

论坛徽章:
0
9 [报告]
发表于 2009-04-14 14:14 |只看该作者
加上密码$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做操作,他服务就停止了,不知道为何?

论坛徽章:
0
10 [报告]
发表于 2009-04-14 14:17 |只看该作者
原帖由 wwyhy 于 2009-4-14 14:14 发表
加上密码$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究竟是不是正常运行先?

如果不能正常运行,先弄好它,再搞整合。


“服务就停止”,看看日志提示什么咯!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP