1. 使用yum安装OpenLDAP
yum -y install openldap openldap-clients openldap-servers
2.配置修改
vi /etc/openldap/ldap.conf
没有特许修改用默认值就行,默认slapd使用389端口。
防火墙开放端口
firewall-cmd --zone=public --add-port=389/tcp --permanent
firewall-cmd --reload #更新规则
3. Web管理工具安装
LDAP Account Manager
http://prdownloads.sourceforge.net/lam/ldap-account-manager-6.2.tar.bz2?download
解压缩 ldap-account-manager-6.2.tar.bz2tar -jxvf ldap-account-manager-6.2.tar.bz2
发现没有安装bzip2
yum -y instal bzip2安装后再解压缩即可
cd ldap-account-manager-6.2
./configure
然后会生成一个Makefile,注意修改makefile中的user和php-fpm一致
grep -w "user =" /etc/php-fpm.d/www.confmake install
cd /usr/local/lam/config
cp config.cfg.sample config.cfg配置nginx php fastcgi。
vi /etc/nginx/conf.d/lam.conf
注意lam的安装目录是
/usr/local/lam
location / {
index index.html;
alias /usr/share/lam;
autoindex off;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php7-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
location ~ /(tmp/internal|sess|config|lib|help|locale) {
deny all;
return 403;
}
}