2012-03-21 58 views
0

我一直在试图建立我的第一个真正的OpenLDAP的实例登录页面,我遇到了一个大问题得到它intially开始。每次启动LDAP,做一个初步的搜索,我得到指示,我有没有域设立了回应:初始OPENLDAP配置

# 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) $ 
    [email protected]:/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 
+0

向我们显示搜索命令行。 – EJP 2012-03-22 21:29:43

+0

ldapsearch -x -b''-s base'(objectclass = *)'namingContexts 我的理解是该命令应该列出服务器上所有可用的上下文。我也试过 ldapsearch -x -W -D'cn = root,dc = test,dc = com'-b“”-s base – SD47 2012-03-24 18:17:01

回答

0

你应该使用-H开关与ldapsearch来指定要搜索什么样的服务器。

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

0

使用slaptest工具来调试slapd.conf。请参阅文档。

+0

Slaptest很好: slaptest -v -f slapd.conf config file测试成功 – SD47 2012-03-22 01:52:15

0

ldapsearch -x -h localhost -b“dc = test,dc = com”