3

I'm configuring OPENLDAP 2.4.35. on Redhat Linux, I have already installed Berkley DB 4.8.30 as a prerequisite. I also checked the version compatibility from OPENLDAP's README file, which says:

    SLAPD:
    BDB and HDB backends require Oracle Berkeley DB 4.4 - 4.8,
    or 5.0 - 5.1.  It is highly recommended to apply the
    patches from Oracle for a given release.

Still I'm getting this error:

    checking db.h usability... yes
    checking db.h presence... yes
    checking for db.h... yes
    checking for Berkeley DB major version in db.h... 4
    checking for Berkeley DB minor version in db.h... 8
    checking if Berkeley DB version supported by BDB/HDB backends... yes
    checking for Berkeley DB link (-ldb-4.8)... yes
    *checking for Berkeley DB library and header version match... no
    configure: error: Berkeley DB version mismatch*

Kindly help

Eugène Adell
  • 3,089
  • 2
  • 18
  • 34
dig_123
  • 2,240
  • 6
  • 35
  • 59
  • http://stackoverflow.com/questions/3848064/openldap-installation-not-finding-the-berkelydb?rq=1 – Piotr Wadas Aug 02 '13 at 10:02
  • @PiotrWadas I already saw this link. This was something different. Here it's not able to locate the Berkeley DB at all. In my case, it's locating the DB properly, but showing "mismatch error" – dig_123 Aug 02 '13 at 10:09

1 Answers1

7

Now the configuration is working fine. I had to export the library path for Berkeley DB properly:

export LD_LIBRARY_PATH="/root/db-6.0.20/build_unix/.libs"

Edit :

The directory build_unix/.libs contains the necessary libs for OpenLDAP but also lots of other files produced during the Berkeley installation. I rather suggest to use the destination Berkeley lib directory which is created during the installation (it should be equal to PREFIX/lib), because you would remove/update your Berkeley source directory one day, breaking OpenLDAP runtime (see the end of my edit)

You can either export the LD_LIBRARY_PATH variable, or set it only at the configure time of OpenLDAP, this way :

LD_LIBRARY_PATH="/root/db-6.0.20.installed/lib" ./configure

Usually there would be other configuration options, I am omitting them here.

Once installed correctly, OpenLDAP may still fail to start with the following error message in the log :

5d34473d bdb_back_initialize: BDB library version mismatch: expected Berkeley DB 5.3.28: (September  9, 2013), got Berkeley DB 5.3.21: (May 11, 2012)

To solve this issue, the solution is again to force the LD_LIBRARY_PATH variable, this time in the startup script (wherever is yours, /etc/init.d/openldap for example). As we are talking about the runtime, it's important here to note we shouldn't call the build_unix/.libs directory which is considered temporary, but the created /lib directory.

Eugène Adell
  • 3,089
  • 2
  • 18
  • 34
dig_123
  • 2,240
  • 6
  • 35
  • 59
  • Where did you run this command? Also, is LD_LIBRARY_PATH supposed to be replaced with some path? I'm currently dealing with the same issue, and I'm very new to Linux. I'm using SUSE Linux. – Eki Nov 18 '13 at 19:46
  • 1
    @KartikeBhagat This has to be run on Linux terminal, as the user you are installing LDAP. Hope this helps – dig_123 Nov 29 '13 at 17:17
  • solution for OSX? I don't have `/root` – shashwat Dec 13 '16 at 03:54
  • 1
    @Eki This command has to be run before running the openldap configure, and the path should be set with what you have on your server. I will edit the answer to enhance its understanding. – Eugène Adell Jul 21 '19 at 11:00