1、OpenLDAP下载地址:http://download.bergmans.us/openldap/openldap-2.2.29/openldap-2.2.29-db-4.3.29-openssl-0.9.8a-win32_Setup.exe 下载后点击安装即可。
2、修改sldap.conf,添加下面内容。
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/corba.schema
include ./schema/dyngroup.schema
include ./schema/java.schema
include ./schema/misc.schema
include ./schema/nis.schema
include ./schema/openldap.schema
3、修改sldap.conf
#suffix "dc=my-domain,dc=com"
#rootdn "cn=Manager,dc=my-domain,dc=com"
修改成
suffix "dc=example,dc=com"
rootdn "cn=Manager,dc=example,dc=com"
4、启动openldap服务
sldap -d 1
用可以看到控制台下打印一片信息,openldap 默认是用的 Berkeley DB 数据库存储目录数据的。
5、测试是否启动成功
ldapsearch -x -s base (objectclass=*) namingContexts
如果返回:
dn:
namingContexts: dc=example,dc=com
则说明OpenLDAP成功启动
6、添加项目
在安装目录下,新建文件example.ldif,输入如下内容:
dn: dc=example,dc=com
objectclass: dcObject
objectclass: organization
o: Example Company
dc: example
dn: cn=Manager,dc=example,dc=com
objectclass: organizationalRole
cn: Manager
7、查询
ldapsearch -x -b dc=example,dc=com (objectclass=*)
ldapadd -x -D cn=Manager,dc=example,dc=com -W -f example.ldif
可能会要求输入密码:secret
8、图形化界面LDAPBrowser的配置
下载地址: http://files.blogjava.net/Unmi/LdapBrowser282.rar
解压后进入LdapBrowser282目录,打开配置文件OpenLdap_Localhost.cfg
修改配置:
basedn=dc=example,dc=com
managerdn=cn=Manager,dc=example,dc=com
运行lbe.bat进入图形界面后选择连接OpenLdap_Localhost即可。
2、修改sldap.conf,添加下面内容。
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/corba.schema
include ./schema/dyngroup.schema
include ./schema/java.schema
include ./schema/misc.schema
include ./schema/nis.schema
include ./schema/openldap.schema
3、修改sldap.conf
#suffix "dc=my-domain,dc=com"
#rootdn "cn=Manager,dc=my-domain,dc=com"
修改成
suffix "dc=example,dc=com"
rootdn "cn=Manager,dc=example,dc=com"
4、启动openldap服务
sldap -d 1
用可以看到控制台下打印一片信息,openldap 默认是用的 Berkeley DB 数据库存储目录数据的。
5、测试是否启动成功
ldapsearch -x -s base (objectclass=*) namingContexts
如果返回:
dn:
namingContexts: dc=example,dc=com
则说明OpenLDAP成功启动
6、添加项目
在安装目录下,新建文件example.ldif,输入如下内容:
dn: dc=example,dc=com
objectclass: dcObject
objectclass: organization
o: Example Company
dc: example
dn: cn=Manager,dc=example,dc=com
objectclass: organizationalRole
cn: Manager
7、查询
ldapsearch -x -b dc=example,dc=com (objectclass=*)
ldapadd -x -D cn=Manager,dc=example,dc=com -W -f example.ldif
可能会要求输入密码:secret
8、图形化界面LDAPBrowser的配置
下载地址: http://files.blogjava.net/Unmi/LdapBrowser282.rar
解压后进入LdapBrowser282目录,打开配置文件OpenLdap_Localhost.cfg
修改配置:
basedn=dc=example,dc=com
managerdn=cn=Manager,dc=example,dc=com
运行lbe.bat进入图形界面后选择连接OpenLdap_Localhost即可。