I am trying to create an OpenLDAP proxy in our DMZ to allow authentication from a Webserver to our ActiveDirectory through OpenLDAP Proxy.
I have spun up a couple servers, one Ubuntu 16.04 with the Latest OpenLDAP installed, and also a CentOS7 with the latest OpenLDAP installed. (I don't need two servers, I only spun up the CentOS because the article I was following was performed on a redhat os, so it made it easier to follow step by step)
I have been following these two guides to make this work:
However I've run into some trouble along the way, it seems neither of these guide work for me, the paths are never the same as what I have, or I get errors starting the slapd ldap service.
-- Unit slapd.service has begun starting up.Aug 17 09:36:13 D-APP02 runuser[38747]: pam_unix(runuser:session): session opened for user ldap by (uid=0)Aug 17 09:36:13 D-APP02 runuser[38747]: pam_unix(runuser:session): session closed for user ldapAug 17 09:36:13 D-APP02 check-config.sh[38744]: Checking configuration file failed:Aug 17 09:36:13 D-APP02 check-config.sh[38744]: Unrecognized database type (ldap)Aug 17 09:36:13 D-APP02 check-config.sh[38744]: 57b4684d /etc/openldap/slapd.conf: line 17: <database> failed init (ldapAug 17 09:36:13 D-APP02 check-config.sh[38744]: slaptest: bad configuration file!Aug 17 09:36:25 D-APP02 slapd[38758]: @(#) $OpenLDAP: slapd 2.4.40 (Mar 31 2016 15:24:52) $ mockbuild@worker1.bsys.centos.org:/builddir/build/BUILD/openldap-2.4.40/opAug 17 09:36:37 D-APP02 slapd[38758]: /etc/openldap/slapd.conf: line 17: <database> failed init (ldap)Aug 17 09:36:37 D-APP02 slapd[38758]: slapd destroy: freeing system resources.Aug 17 09:36:37 D-APP02 slapd[38758]: slapd stopped.Aug 17 09:36:37 D-APP02 slapd[38758]: connections_destroy: nothing to destroy.Aug 17 09:36:37 D-APP02 slapd[38758]: Unrecognized database type (ldap)Aug 17 09:36:37 D-APP02 polkitd[10164]: Unregistered Authentication Agent for unix-process:38729:7626184 (system bus namAug 17 09:36:37 D-APP02 systemd[1]: slapd.service: control process exited, code=exited status=1Aug 17 09:36:37 D-APP02 systemd[1]: Failed to start OpenLDAP Server Daemon.-- Subject: Unit slapd.service has failed
Oh crap, sorry - I've got three of these going trying to make this work - I've re installed and reconfigured these things a dozen times trying to get it to work... it's likely on a different server, sorry...
it was this I think:
# Import our schemainclude /etc/openldap/schema/core.schemainclude /etc/openldap/schema/cosine.schemainclude /etc/openldap/schema/inetorgperson.schemainclude /etc/openldap/schema/nis.schema# Support both LDAPv2 and LDAPv3allow bind_v2pidfile /var/run/openldap/slapd.pidargsfile /var/run/openldap/slapd.argsloglevel 1# Our slapd-ldap back end to connect to ADdatabase ldapsuffix "dc=county-lambton,dc=on,dc=ca"subordinaterebind-as-useruri "ldap://coldc1.county-lambton.on.ca"chase-referrals yes# Our primary back enddatabase bdbsuffix "dc=county-lambton,dc=on,dc=ca"rootdn "cn=coladmin,dc=county-lambton,dc=on,dc=ca"rootpw "mypassword"directory /var/lib/ldap# Indexes for this back endindex objectClass eq,presindex ou,cn,mail,surname,givenname eq,pres,subindex uid eq,pres,sub
slapd does not like whatever is on line 17.