I was trying to setup an LDAP server for my development. For this purpose, I have chose CentOS 6.3 install it in VirtualBox host in Fedora 17. I'm following this tutorial to guide me on this setup, anyhow when I start the service using this command service slapd start, I got this error:

Checking configuration files for slapd:   [FAILED]
/etc/openldap/slapd.conf: line 9: bad config line.
slaptest: bad configuration file!

I'm sure I have this file /etc/openldap/slapd.conf to the owner of ldap. May I know any idea to rectified this problem?


I have extract the first few lines of text from slapd.conf, looking at line 9, that is an empty line.

# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
include     /etc/openldap/schema/core.schema
include     /etc/openldap/schema/cosine.schema
include     /etc/openldap/schema/inetorgperson.schema
include     /etc/openldap/schema/nis.schema

# Added for policy
include /etc/openldap/schema/ppolicy.schema

# Allow LDAPv2 client connections.  This is NOT the default.
allow bind_v2

# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral   ldap://root.openldap.org

pidfile     /var/run/openldap/slapd.pid
argsfile    /var/run/openldap/slapd.args
  • 3
    maybe first check out what the line 9 on the config says... vi /etc/openldap/slapd.conf then :9 . – maniat1k Jan 30 '13 at 14:06
  • I have check on that file, but it is an empty line there. Any clue on this? – huahsin68 Feb 1 '13 at 0:55
  • It may not be the answer to your question, but have you tried Apache Directory studio? It comes with an integrated LDAP server and with a cool GUI LDAP editor which i found perfect for quick LDAP development: directory.apache.org/studio – Martino Dino Feb 1 '13 at 2:30
  • 1
    if line 9 is empty maybe the problem is on line 8: /etc/openldap/schema/nis.schema what about this schema? – maniat1k Feb 1 '13 at 15:22

Remove the blank lines in your slapd.conf file; that fixed it for me.

| improve this answer | |
  • I removed the blank space but still the same problum.. – user81758 Aug 23 '14 at 11:15
  • You have to remove all the blank lines. Did you do that? – Alan Cabrera Aug 23 '14 at 15:40
  • Ensure that there are no trailing whitespaces. – stillanoob Jan 9 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.