LDAP启动:slaptest: bad configuration file!

报错:config error processing cn={1}core,cn=schema,cn=config: olcAttributeTypes: Duplicate attributeType: "2.5.4.2"


原因:

更新slapd.d配置文件

slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d

命令时出错,新建touch /etc/openldap/slapd.conf,修改后的配置内容如下:


include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/duaconf.schema
include /etc/openldap/schema/dyngroup.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/java.schema
include /etc/openldap/schema/misc.schema
include /etc/openldap/schema/nis.schema
include /etc/openldap/schema/openldap.schema
include /etc/openldap/schema/ppolicy.schema
include /etc/openldap/schema/collective.schema
include /etc/openldap/schema/kerberos.schema

pidfile /var/run/openldap/slapd.pid
argsfile /var/run/openldap/slapd.args


注意:记得先备份目录/etc/openldap/slapd.d, /etc/openldap/slapd.conf添加include /etc/openldap/schema/corba.schema存在问题,不导入此*.schema,否则就会报上述错误


$ slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d

$ chown -R ldap:ldap /etc/openldap/slapd.d && chmod -R 700 /etc/openldap/slapd.d


启动 LDAP 服务:

service slapd start


如果启动失败,则运行下面命令来启动 slapd 服务并查看日志:

$ slapd -h ldap://127.0.0.1 -d 481





你可能感兴趣的:(LDAP)