0
votes

I am trying to setup ldap server on my ubuntu 14.04. I had previous ldap server setup installed on centos 6 which uses flat-file configuration i.e slapd.conf method for ldap.

Now I want to setup openldap server on Ubuntu 14.04. I placed all contents from /etc/openldap from centos in /etc/ldap on ubuntu. When I try to install ldap using following

$ sudo apt-get install slapd

I am getting below error:

Setting up slapd (2.4.31-1ubuntu2) ...
  Creating initial configuration... mkdir: cannot create directory `/etc/ldap/slapd.conf': File exists
dpkg: error processing slapd (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 slapd
E: Sub-process /usr/bin/dpkg returned an error code (1)

I removed database files from /var/lib/ldap/

$ sudo rm -rf /var/lib/ldap/*

Then, I tried it to convert slapd.conf to slapd.d by using

$ sudo slaptest -f slapd.conf -F slapd.d

I am get error as below.

Unrecognized database type (bdb)  
546470b0 slapd.conf: line 99: <database> failed init (bdb)  
slaptest: bad configuration directory!

What should be done in order to use slapd.conf of my own and configure database.

1

1 Answers

0
votes

The following command converts a slapd.conf to slapd.d:

slaptest -f slapd.conf -F slapd.d