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 下。

转自:http://www.linuxidc.com/Linux/2016-05/130997.htm

  

源码安装openldap(转)的更多相关文章

  1. Greenplum 源码安装教程 —— 以 CentOS 平台为例

    Greenplum 源码安装教程 作者:Arthur_Qin 禾众 Greenplum 主体以及orca ( 新一代优化器 ) 的代码以可以从 Github 上下载.如果不打算查看代码,想下载编译好的 ...

  2. lnmp之阿里云源码安装mysql5.7.17

    mysql5.7.17一直号称世界上最好的mysql 那么就在阿里云主机linux安装它(采用的源码安装mysql5.7.17) 我在阿里云主机上安装它 连接阿里云主机 进入,跟我们自己装的虚拟机一毛 ...

  3. 源码安装和配置zabbix 3.0 LST

    Zabbix是什么 Zabbix 是由Alexei Vladishev创建,目前由Zabbix SIA在持续开发和支持. Zabbix 是一个企业级的分布式开源监控方案. Zabbix是一款能够监控各 ...

  4. ubuntu php5.6源码安装

    本系列的lnmp的大框架基本上是按照http://www.linuxzen.com/lnmphuan-jing-da-jian-wan-quan-shou-ce-si-lnmpda-jian-yuan ...

  5. mono-3.4.0 源码安装时出现的问题 [do-install] Error 2 [install-pcl-targets] Error 1 解决方法

    Mono 3.4修复了很多bug,继续加强稳定性和性能(其实Mono 3.2.8 已经很稳定,性能也很好了),但是从http://download.mono-project.com/sources/m ...

  6. 搭建LNAMP环境(七)- PHP7源码安装Memcached和Memcache拓展

    上一篇:搭建LNAMP环境(六)- PHP7源码安装MongoDB和MongoDB拓展 一.安装Memcached 1.yum安装libevent事件触发管理器 yum -y install libe ...

  7. 搭建LNAMP环境(二)- 源码安装Nginx1.10

    上一篇:搭建LNAMP环境(一)- 源码安装MySQL5.6 1.yum安装编译nginx需要的包 yum -y install pcre pcre-devel zlib zlib-devel ope ...

  8. 搭建LNAMP环境(一)- 源码安装MySQL5.6

    1.yum安装编译mysql需要的包 yum -y install gcc-c++ make cmake bison-devel ncurses-devel perl 2.为mysql创建一个新的用户 ...

  9. salt源码安装软件和yum安装软件

    上面简单列出了源码安装的sls文件书写思路. 涉及到一些固定的思路:如, 1,拷贝 解压安装时候需要依赖tar.gz存在 如果已安装则无需再次安装. 2,启动脚本 加入chk时候需要文件存在,如果已添 ...

随机推荐

  1. Goland debug失败

    在使用goland使用debug调试代码出现 API server listening at: 127.0.0.1:56871could not launch process: debugserver ...

  2. Codeforces AIM Tech Round 5 (rated, Div. 1 + Div. 2)

    A. Find Square time limit per test: 1 second memory limit per test: 256 megabytes input: standard in ...

  3. linux +jenkins +python 集成测试

    1.jenkin安装部署 2.git 安装 3.git server 配置 4.contab

  4. @Value注解的使用

    前提它需要在spring 管理的Bean中有效 (如@Service...) #{...} 此方式可以使用 SpEL 表达式如 #{30-15} ${...} 可以获取配置文件中的值 如 ${jwt. ...

  5. 1143. Longest Common Subsequence

    link to problem Description: Given two strings text1 and text2, return the length of their longest c ...

  6. C:数值溢出问题

    当超过一个数据类型能够存放最大的范围时,数值会溢出. 有符号位最高位溢出的区别:符号位溢出会导致数的正负发生改变,但最高位的溢出会导致最高位丢失. #include <stdio.h> i ...

  7. GO面向接口

    Go 语言提供了另外一种数据类型即接口,它把所有的具有共性的方法定义在一起,任何其他类型只要实现了这些方法就是实现了这个接口. 实例 实例 /* 定义接口 */ type interface_name ...

  8. Java IO流详解(三)——字节流InputStream和OutPutStream

    我们都知道在计算机中,无论是文本.图片.音频还是视频,所有的文件都是以二进制(字节)形式存在的,IO流中针对字节的输入输出提供了一系列的流,统称为字节流.字节流是程序中最常用的流.在JDK中,提供了两 ...

  9. Educational Codeforces Round 73 (Rated for Div. 2)F(线段树,扫描线)

    这道题里线段树用来区间更新(每次给更大的区间加上当前区间的权重),用log的复杂度加快了更新速度,也用了区间查询(查询当前区间向右直至最右中以当前区间端点向右一段区间的和中最大的那一段的和),也用lo ...

  10. Educational Codeforces Round 81 + Gym 102267

    UPD:变色了!!!历史最高1618~ Educational Codeforces Round 81 (Rated for Div. 2) The 2019 University of Jordan ...