Installation OpenLDAP on CentOS 7

17,971

Solution 1

Use CentOS OpenLDAP help page. It is very concise and no fluff. Prior to doing so - please revert all the config files to their original state. Can be confirmed via:

# rpm -V openldap-server

If above command shows any files modified - either remove and reinstall openldap-server or fetch files over from backup.

Solution 2

I also used that guide to set up OpenLDAP on CentOS 7. Once I only installed openldap-servers without the client and it completely failed; there were permissions issues and slapd failed to start, etc. I agree with others about starting over and following the directions exactly.

But even so, there are some issues in the guide that are helpful to have documented:

  • If you copy-paste from the guide into the ldif files, be sure to fix any wrapped lines, they caused errors for me (chdomain.ldif in particular).
  • In basedomain.ldif, o: Server World and dc: Server should be changed to the correct domain, otherwise you get this error:

    ldap_add: Naming violation (64) additional info: value of single-valued naming attribute 'dc' conflicts with value present in entry

  • The final ldapadd command should also be changed to the correct domain or else you will get invalid credentials errors.

Those errors really weren't intuitive, but I was able to complete the guide and configure OpenLDAP.

Share:
17,971

Related videos on Youtube

Neil
Author by

Neil

Updated on September 18, 2022

Comments

  • Neil
    Neil almost 2 years

    I'm following this OpenLDAP step by step tutorial: http://www.server-world.info/en/note?os=CentOS_7&p=openldap&f=1 Important: I'm working on CentOS 7

    But when in the first part I try to start slapd with: systemctl start slapd, it throws me an error that I can't solve.

    I looked for in web, StackOverflow and Server Fault but anyone has the same problem.

    This is the error:

    # systemctl start slapd
    Job for slapd.service failed. See 'systemctl status slapd.service' and 'journalctl -xn' for details.
    

    And here the stack trace or error when I check the systemctl status.

     [root@localhost openldap]# systemctl status slapd -l
        slapd.service - OpenLDAP Server Daemon
           Loaded: loaded (/usr/lib/systemd/system/slapd.service; disabled)
           Active: failed (Result: exit-code) since dv 2015-01-09 12:03:41 CET; 3min 9s ago
          Process: 5507 ExecStart=/usr/sbin/slapd -u ldap -h ${SLAPD_URLS} $SLAPD_OPTIONS (code=exited, status=1/FAILURE)
          Process: 5492 ExecStartPre=/usr/libexec/openldap/check-config.sh (code=exited, status=0/SUCCESS)
    
        gen 09 12:03:41 localhost.localdomain runuser[5495]: pam_unix(runuser:session): session opened for user ldap by (uid=0)
        gen 09 12:03:41 localhost.localdomain check-config.sh[5492]: Checking configuration file failed:
        gen 09 12:03:41 localhost.localdomain check-config.sh[5492]: 54afb58d ldif_read_file: checksum error on "/etc/openldap/slapd.d/cn=config/olcDatabase={0}config.ldif"
        gen 09 12:03:41 localhost.localdomain check-config.sh[5492]: 54afb58d unable to open file "/openldap/slapd.pid": 2 (No such file or directory)
        gen 09 12:03:41 localhost.localdomain slapcat[5500]: DIGEST-MD5 common mech free
        gen 09 12:03:41 localhost.localdomain slapd[5507]: @(#) $OpenLDAP: slapd 2.4.39 (Jun  9 2014 23:23:12) $
                                                                   [email protected]:/builddir/build/BUILD/openldap-2.4.39/openldap-2.4.39/servers/slapd
        gen 09 12:03:41 localhost.localdomain slapd[5509]: DIGEST-MD5 common mech free
        gen 09 12:03:41 localhost.localdomain systemd[1]: slapd.service: control process exited, code=exited status=1
        gen 09 12:03:41 localhost.localdomain systemd[1]: Failed to start OpenLDAP Server Daemon.
        gen 09 12:03:41 localhost.localdomain systemd[1]: Unit slapd.service entered failed state.
    

    My question is: How can I do? Is there any solution? Or what is the guideline to follow for fix the problem?

    How I can start to solve this?

  • Neil
    Neil over 9 years
    I can't finish any LDAP tutorial. T.T Do you know any tutorial for very beginners? Please, help me.