歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu安裝OpenLDAP(附錯誤的詳細解決辦法)

Ubuntu安裝OpenLDAP(附錯誤的詳細解決辦法)

日期:2017/2/28 13:52:34   编辑:Linux教程

Ubuntu安裝OpenLDAP(附錯誤的詳細解決辦法)

1 下載OpenLDAP源碼

http://www.openldap.org/software/download/

或者

ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release.tgz

2 解壓到本地

# gunzip-c openldap-VERSION.tgz | tar xf -

# cd openldap-2.4.44

# ./configure

configure: error: BDB/HDB: BerkeleyDB notavailable

提示本地沒有安裝BerkeleyDB數據庫

3 安裝BerkeleyDB

去Oracle官網下載:

http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index.html

解壓到本地

切換到build_unix 目錄

# cd build_unix

# ../dist/configure

# make

# make install

root@cloudsoar-virtual-machine:/home/cloudsoar/db-6.2.23/build_unix#make install

Installing DB include files:/usr/local/BerkeleyDB.6.2/include ...

Installing DB library:/usr/local/BerkeleyDB.6.2/lib ...

libtool: install: cp -p .libs/libdb-6.2.so/usr/local/BerkeleyDB.6.2/lib/libdb-6.2.so

libtool: install: cp -p .libs/db_upgrade/usr/local/BerkeleyDB.6.2/bin/db_upgrade

libtool: install: cp -p .libs/db_verify/usr/local/BerkeleyDB.6.2/bin/db_verify

Installing documentation:/usr/local/BerkeleyDB.6.2/docs ...

4 查看安裝

5 設置到系統變量

不設置的話,等下安裝OpenLDAP時候執行./configure檢查時候還會報同樣的錯

# vim /etc/ld.so.conf

添加一行:/usr/local/BerkeleyDB.6.2/lib/

保存退出。

執行生效:# ldconfig –v

6 繼續安裝openldap-2.4.44

切換到openldap的源碼目錄下,重新執行configure文件

# ./configure CPPFLAGS="-I/usr/local/BerkeleyDB.6.2/include-D_GNU_SOURCE" LDFLAGS="-L/usr/local/BerkeleyDB.6.2/lib"

執行後報錯

error: BerkeleyDB version incompatible withBDB/HDB backends

這裡找不到原因,後來查看openladp-2.4.44,目錄的README文件發現如下內容:

郁悶,原來openldap-2.4.44要求用Oracle Berkeley 4.4-4.8或者5.0-5.1版本的,而我用的是db-6.2.23.tar.gz版本的。

沒辦法,只有重新去Oracle官網下載一個db-5.1.29.tar.gz版本的。

按照安裝Berkeley 6.2的方法再次安裝Berkeley DB 5.1。

# cd build_unix

# ../dist/configure

# make

# make install

# vim /etc/ld.so.conf

添加一行:/usr/local/BerkeleyDB.5.1/lib/

保存退出。

執行生效:ldconfig –v

8 安裝openldap

切換到openldap-2.4.44目錄

# ./configure CPPFLAGS="-I/usr/local/BerkeleyDB.5.1/include-D_GNU_SOURCE" LDFLAGS="-L/usr/local/BerkeleyDB.5.1/lib"

執行完畢可以看到提示我執行make depand了

9 編譯軟件

根據http://www.openldap.org/doc/admin24/install.html的安裝步驟繼續執行

執行命令:# make depend

執行命令:# make

10 測試軟件

根據官方文檔說明:Once the software has been properly configured and successfullymade, you should run the test suite to verify the build.

我們也需要測試一下安裝是否成功,執行命令:# make test

說明安裝環境是沒問題了。

11 安裝openldap到系統

根據官方文檔說明:By default OpenLDAP Software is installed in /usr/local. If youchanged this setting with the --prefix configure option, it will be installedin the location you provided.

我們可以加–prefix 參數來指定我們自己想要安裝的位置。默認是安裝到 /usr/local目錄下。

執行命令:# su root -c 'make install'

到這裡openldap-2.4.44已經成功的安裝到我的系統當中。默認的配置文件在 /usr/local/etc/openldap 下。

下一篇 Ubuntu安裝OpenLDAP之配置LDAP http://www.linuxidc.com/Linux/2016-05/130998.htm

Liferay Portal 配置使用Oracle和OpenLDAP http://www.linuxidc.com/Linux/2012-07/66928.htm

在CentOS 6.5上安裝OpenLDAP並配置LDAP方式用戶登錄 http://www.linuxidc.com/Linux/2015-04/116536.htm

RHEL7中OpenLDAP的安裝與配置 http://www.linuxidc.com/Linux/2015-03/115524.htm

Ubuntu下OpenLDAP服務器的部署步驟 http://www.linuxidc.com/Linux/2014-12/110775.htm

Axigen+OpenLDAP+BerkeleyDB+ejabberd多域+JWchat詳細配置 http://www.linuxidc.com/Linux/2012-06/61598.htm

CentOS部署OpenLDAP認證 http://www.linuxidc.com/Linux/2012-04/57932.htm

CentOS Linux安裝OpenLDAP服務器 http://www.linuxidc.com/Linux/2014-03/98087.htm

OpenLDAP 的詳細介紹:請點這裡
OpenLDAP 的下載地址:請點這裡

Copyright © Linux教程網 All Rights Reserved