https://help.ubuntu.com/12.04/serverguide/openldap-server.html
ubuntu安装openldap经历了一系列挫折,网上找了半天资料都是一模一样,根本不能解决问题。
直接创建slapd.conf,备份删除slapd.d文件夹:
sudo touch /etc/ldap/slapd.conf
sudo mv /etc/ldap/slapd.d /etc/ldap/slap.d.bak -f
编辑slapd.conf文件,配置如下:
# slapd.conf - Configuration file for LDAP SLAPD
##########
# Basics #
##########
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 none
modulepath /usr/lib/ldap
# modulepath /usr/local/libexec/openldap
moduleload back_hdb
##########################
# Database Configuration #
##########################
database hdb
suffix "dc=example,dc=com"
rootdn "cn=Manager,dc=example,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
重启openldap,
关闭:sudo kill `pgrep slapd`或者sudo service slapd stop
打开:sudo slapd或者sudo service slapd start
重启:sudo service restart或者 sudo invoke-rc.d slapd restart
查看openldap运行情况,只显示grep --color=auto slapd,说明没有运行。
ps aux | grep slapd
参考资料: http://hi.baidu.com/ankchl/item/5a93d1f972399d0985d27870