什么是ldap
https://www.linuxidc.com/Linux/2017-10/147562.htm?hmsr=toutiao.io
https://www.linuxidc.com/Linux/2017-10/147562.htm?hmsr=toutiao.io
~~~
wget ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-2.4.46.tgz
cd /usr/local/src/
wget ftp://mirror.switch.ch/mirror/OpenLDAP/openldap-release/openldap-2.4.46.tgz
tar zxvf openldap-2.4.46.tgz
cd openldap-2.4.46
./configure --prefix=/usr/local/openldap-2.4.46 \
--enable-sql \
--disable-bdb \
--disable-ndb \
--disable-hdb
make depend
make
make install
ln -s /usr/local/openldap-2.4.46/bin/* /usr/local/bin/
ln -s /usr/local/openldap-2.4.46/sbin/* /usr/local/bin/
~~~
卸載
~~~
ln -s /usr/local/openldap-2.4.44/bin/* /usr/local/bin/
[root@localhost openldap-2.4.44]# ln -s /usr/local/openldap-2.4.44/sbin/* /usr/local/sbin/
~~~
**簡單配置**
1. 安裝完成的openldap-2.4.44目錄結構
openldap安裝完成后相關目錄承載的功能如下:
bin/ --客戶端工具如ldapadd、ldapsearch
etc/ --包含主配置文件slapd.conf、schema、DB_CONFIG等
include/
lib/
libexec/ --服務端啟動工具slapd
sbin/ --服務端工具如slappasswd
share/
var/ --bdb數據、log存放目錄
~~~
slappasswd
~~~
密碼是111111
~~~
[root@fulinos openldap-2.4.46]# slappasswd
New password:
Re-enter new password:
{SSHA}2RlatrmlG7NA4tMPt+IWETJjKfDkdL8m
[root@fulinos openldap-2.4.46]#
~~~
cd /usr/local/openldap-2.4.46/etc/openldap/
啟動
/usr/local/openldap-2.4.46/libexec/slapd
ldapadmin
~~~
yum -y install httpd php php-ldap php-gd php-mbstring php-pear php-bcmath php-xml
yum -y install epel-release
yum --enablerepo=epel -y install phpldapadmin
~~~
yum install migrationtools -y
**bdb版本**
~~~
yum -y install openldap compat-openldap openldap-clients openldap-servers openldap-servers-sql openldap-devel migrationtools
slappasswd -s 111111|sed -e "s#{SSHA}#rootpw\t{SSHA}#g" >>/etc/openldap/slapd.conf
~~~
[root@fulinos ~]# slappasswd
New password:
Re-enter new password:
{SSHA}9a87klB9GRa2VGX4UFcRcBFSqECGg9mx
[root@fulinos openldap-servers]# slappasswd -s 111111|sed -e "s#{SSHA}#rootpw\t{SSHA}#g"
rootpw {SSHA}8JwkZiDPrZMHpN+JQj7pT2mNRg7yvJ7A
[root@fulinos openldap-servers]#