【问题标题】:Initial openLDAP Configuration初始 openLDAP 配置
【发布时间】:2012-03-21 03:35:53
【问题描述】:

我一直在尝试为登录页面设置我的第一个真正的 openLDAP 实例,但在启动它时遇到了一个大问题。每次我启动 LDAP 并进行初始搜索时,我都会收到一个响应,表明我没有设置域:

# extended LDIF
#
# LDAPv3
# base <> with scope baseObject
# filter: (objectclass=*)
# requesting: namingContexts 
#

#
dn:
namingContexts: dc=nodomain

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

但是,我的理解是,如果我编辑 /etc/ldap/slapd.conf 以更改后缀,我可以让服务器以我选择的域开始。为此,我有以下 slapd.conf:

# slapd.conf - configuration
include /etc/ldap/schema/core.schema
include /etc/ldap/schema/cosine.schema
include /etc/ldap/schema/inetorgperson.schema
pidfile /var/run/slapd/slapd.pid
argsfile /var/run/slapd/slapd.args
loglevel any
modulepath /usr/lib/ldap
# modelpath /usr/local/libexc/openldap
moduleload back_hdb
######################
# DB configuration   #
#####################
database hdb
suffix "dc=test,dc=com"
rootdn "cn=root,dc=test,dc=com"
rootpw secret
directory /var/lib/ldap
# directory /usr/local/var/openldap-data
index objectClass,cn eq
########    
# ACLs #
########
access to attrs=userPassword
       by anonymous auth
       by self write
       by * none
access to *
       by self write
       by * none

当我在调试切换到配置的情况下运行 slapd 时,我得到一些输出,我 认为 表明我的配置文件没有被加载;但我现在不完全确定要查看或查找什么,而且我在网上找到的教程都没有解决这个问题。如果它对任何人有帮助,我已经在 ubuntu-11.10 机器上使用 apt-get slapd 完成了所有安装和重新安装。这可能只是我自己的无知造成的一个愚蠢的错误,但我现在不知所措。

我还附上了下面的启动调试输出,以防有人发现它有用。

@(#) $OpenLDAP: slapd 2.4.25 (Nov 14 2011 21:34:11) $
    buildd@yellow:/build/buildd/openldap-2.4.25/debian/build/servers/slapd
loaded module back_hdb
module back_hdb: null module registered
index objectClass 0x0004
slapd starting

【问题讨论】:

  • 向我们展示搜索的命令行。
  • ldapsearch -x -b '' -s base '(objectclass=*)'namingContexts 我的理解是该命令应该列出服务器上所有可用的上下文。我也试过 ldapsearch -x -W -D 'cn=root,dc=test,dc=com' -b "" -s base

标签: configuration openldap ubuntu-11.10


【解决方案1】:

您应该使用带有 ldapsearch 的 -H 开关来指定要搜索的服务器。

侦听器是通过 /opt/symas/etc/openldap/symas-openldap.conf 中的 HOST_LIST 参数设置的。您可以检查此文件以检查当前设置。默认是监听环回地址。

【讨论】:

    【解决方案2】:

    使用slaptest 实用程序调试您的slapd.conf。请参阅文档。

    【讨论】:

    • Slaptest 没问题:slaptest -v -f slapd.conf 配置文件测试成功
    【解决方案3】:

    ldapsearch -x -h localhost -b "dc=test,dc=com"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-09-08
      • 1970-01-01
      • 1970-01-01
      • 2012-06-20
      • 2011-02-16
      • 2010-09-21
      • 2015-09-17
      相关资源
      最近更新 更多