ITPub博客

首页 > IT职业 > IT生活 > Openldap2.0.25 install in AS2.1,比较老的学习文档了.

Openldap2.0.25 install in AS2.1,比较老的学习文档了.

原创 IT生活 作者:yj11 时间:2008-07-09 18:48:25 0 删除 编辑

Openldap2.0.25 install in AS2.1

[@more@]

、Openldap2.0.25安装

./configure --prefix=/home/openldap --with-ldbm-api=gdbm

./make

./make intall

我测试机的sldap.conf需要添加如下:

include /usr/local/openldap/etc/openldap/schema/core.schema

include /usr/local/openldap/etc/openldap/schema/cosine.schema

include /usr/local/openldap/etc/openldap/schema/inetorgperson.schema

#上面两项在编译完生成的slapd.conf中是没有添加的,所以需要我们手工添加。

#因为下面的例子不如的objectClass:inetOrgPerson是在inetorgperson.schema中定义的,所以如果不在此处include加入的话,在导入ldif文件的时候会提示不识别inetOrgPerson这个属性的。

#######################################################################

# ldbm database definitions

#######################################################################

database ldbm

suffix "dc=stooges,dc=com"

rootdn "cn=Manager,dc=stooges,dc=com"

rootpw secret

directory /var/lib/ldap/stooges

lastmod on

并且stooges.ldif文件内容为:

dn: dc=stooges,dc=com

objectClass:dcObject

objectClass: organization

o: stooges

dc: stooges

description: this is stooges domain

dn: uid=bbb,dc=stooges,dc=com

objectClass: Person

objectClass: inetOrgPerson

uid: bbb

sn: bbb

cn: bbb

telephoneNumber: 111-111-111

mail: bbb@stooges.com

dn: uid=ccc,dc=stooges,dc=com

objectClass: Person

objectClass: inetOrgPerson

uid: ccc

sn: ccc

cn: ccc

telephoneNumber: 222-111-111

[root@oradb openldap]#libexec/slapd 启动slapd进程,只有启动进程后,才可以看ldap中添加数据库

[root@oradb openldap]#ps -ef | grep slapd

[root@oradb openldap]# ps -ef | grep slapd

root 27461 1 0 21:32 ? 00:00:00 libexec/slapd

root 27462 27461 0 21:32 ? 00:00:00 libexec/slapd

root 27463 27462 0 21:32 ? 00:00:00 libexec/slapd

root 27465 27462 0 21:32 ? 00:00:00 libexec/slapd

root 27466 27462 0 21:32 ? 00:00:00 libexec/slapd

root 27474 6419 0 21:36 pts/0 00:00:00 grep slapd

[root@oradb openldap]# bin/ldapadd -f stooges.ldif -W -x -D 'cn=Manager,dc=stooges,dc=com' 将数据添加到ldap数据库中

Enter LDAP Password:

adding new entry "dc=stooges,dc=com"

adding new entry "uid=bbb,dc=stooges,dc=com"

adding new entry "uid=ccc,dc=stooges,dc=com"

[root@oradb openldap]#

#ldpasearch -LLL -b 'dc=stooges,dc=com' -W -x

查询数据库的内容

[root@oradb openldap]# bin/ldapsearch -LLL -b 'dc=stooges,dc=com' -W -x

Enter LDAP Password:

dn: dc=stooges,dc=com

objectClass: dcObject

objectClass: organization

o: stooges

dc: stooges

description: this is stooges domain

dn: uid=bbb,dc=stooges,dc=com

objectClass: Person

objectClass: inetOrgPerson

uid: bbb

sn: bbb

cn: bbb

telephoneNumber: 111-111-111

mail: bbb@stooges.com

dn: uid=ccc,dc=stooges,dc=com

objectClass: Person

objectClass: inetOrgPerson

uid: ccc

sn: ccc

cn: ccc

telephoneNumber: 222-111-111

mail: ccc@stooges.com

[root@oradb openldap]#

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/1806527/viewspace-1007048/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    12
  • 访问量
    54564