OpenLDAP安装
# 安装openldap及相关工具
apt install -y slapd ldap-utils
# 配置openldap(slapd)
dpkg-reconfigure slapd
---------------------------------------------------------------------
│ Omit OpenLDAP server configuration? <No>
│ DNS domain name: test.com
│ Organization name: test
│ Administrator password: mypasswd
│ Confirm password: mypasswd
│ Do you want the database to be removed when slapd is purged? <Yes>
│ Move old database? <Yes>
---------------------------------------------------------------------
PhpLdapAdmin安装
# 安装phpldapadmin
apt-get install -y phpldapadmin
# 配置config.php
vim /etc/phpldapadmin/config.php
-------------------------------------------------------------------------------------------
$config->custom->appearance['hide_template_warning'] = true; # 隐藏WEB页面template模版
$servers->setValue('server','name','My LDAP Server'); # 服务名,默认即可
$servers->setValue('server','host','127.0.0.1'); # 设置host地址,这里默认
$servers->;setValue('server','base',array('dc=test,dc=com')); # 设置BaseDn
$servers->setValue('login','auth_type','session'); # 认证类型,默认即可
$servers->setValue('login','bind_id','cn=admin,dc=test,dc=com'); # 设置Bind用户(WEB登陆界面中会自动填写该用户名)
$servers->setValue('auto_number','min',array('uidNumber'=>10000,'gidNumber'=>10000)); # 根据情况修改,默认也可以
-------------------------------------------------------------------------------------------
# 关闭默认站点并重启apache
a2dissite 000-default.conf
systemctl restart apache2
# 登陆管理页面
http://SERVER_IP/phpldapadmin
# 老版本在PHP7以上环境下可能工作异常,存在Bug,可尝试替换最新版: https://github.com/leenooks/phpLDAPadmin
# 推荐另外一款LDAP管理工具,LdapBrowser:https://ldapbrowserwindows.com