Starting with OpenLDAP

Starting with OpenLDAP

1. Install OpenLDAP on Ubuntu
2. apt-get install slapd ldap-utils gq db4.8-util db4.8-doc jxplorer
3. Create slapd.conf /usr/share/slapd/slapd.conf or whereever you want only thing it should be readable. Change domain components and admin password, dn as per your requirement
4. Please check apparmor is off
5. Please check /var/run/slapd directory is there or not. If yes please check the permissions. It should be Read n write to openldap user
6. Also check for /var/lib/ldap
7. Create first.ldif… Change dn and cn values as per slapd.conf
In that put
    dn: dc=gurjar,dc=com
    objectclass: dcObject
    objectclass: organization
   o: Gurjar’s company
   dc: gurjar

   dn: cn=admin,dc=gurjar,dc=com
   objectclass: simpleSecurityObject
   objectclass: organizationalRole
   cn: admin
   userPassword: bigsecretword

   description: LDAP administrator
8. Add this and initialize Directory
For this first copy /usr/share/slapd/DB_CONFIG /var/lib/ldap/
give
slapadd -f /usr/share/slapd/slapd.conf -l first.ldif
chown -R openldap:openldap /var/lib/ldap

9. Test your configuration file
slaptest -f /usr/share/slapd/slapd.conf

If it shows succeed in last line then Go ahead otherwise troubleshoot the issue 🙂

10. Start Slapd server by below command
slapd -u openldap -g openldap -f /usr/share/slapd/slapd.conf

11. Check weather slapd is up or not
ps -ef|grep slapd
netstat -an|grep 389

If it is running try connecting it with Jxplorer and brows. If you can connect then we are going ahead 🙂

Neelesh Gurjar has written 122 articles

Leave a Reply