ubuntuでOpenLdapをインストールする

1589 ワード

OpenLdapのインストールにはBerkeleyDBのサポートが必要です.そうしないとconfigureで次のエラーが発生します.
configure: error: BDB/HDB: BerkeleyDB not available

1.BerkeleyDBのインストール

tar xvfz db-4.6.21.tar.gz
cd db-4.6.21/build_unix/
../dist/configure -prefix=/usr/local/BerkeleyDB
make
make install

2.環境変数の構成

vi /etc/profile
export CPPFLAGS="-I/usr/local/BerkeleyDB/include"
export LDFLAGS="-L/usr/local/BerkeleyDB/lib"

wq保存後に終了し、環境変数を有効にする
source /etc/profile
 

3.ファイルのコピー

cp /usr/local/BerkeleyDB/lib/* /usr/lib
cp /usr/local/BerkeleyDB/include/* /usr/include

注意:上記の手順に従わないと、次のエラーが発生する可能性があります.
 configure: error: Berkeley DB version mismatch

4.OpenLdapのインストール

tar zvxf openldap2.4.29.tgz
cd /openldap2.4.29
./configure --prefix=/usr/local/openldap
make depend
make
make test
make install

注:実行中./configureの場合、次のエラーが発生する可能性があります.
configure: error: MozNSS not found – please specify the location to the NSPR and NSS header files in CPPFLAGS and the location to the NSPR and NSS libraries in LDFLAGS (if not in the system location)
なぜならopenldapはopensslのライブラリファイルに依存してopenldapをインストールし、SSLの環境変数を構成する必要があるからです.
export CPPFLAGS="-I/usr/local/BerkeleyDB/include -I/usr/local/ssl/include "export LDFLAGS="-L/usr/local/BerkeleyDB/lib -L/usr/local/ssl/lib "