官网:http://phpldapadmin.sourceforge.net
源码
注:官方最新源码不兼容PHP 7,改造成本较大,推荐下载第三方代码
- https://github.com/leenooks/phpLDAPadmin //经测试在 PHP 7.2上报错
- https://github.com/breisig/phpLDAPadmin //经测试在 PHP 7.2 及 7.3 上正常运行
配置
# cp config/config.php.example config/config.php
若search报错:
E_WARNING: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
# vim lib/QueryRender.php
找到:
if (! $results) {
echo _('Search returned no results');
continue;
}
改为:
if (! $results) {
echo _('Search returned no results');
break;
}
Nginx配置
server {
listen 80;
server_name ldap.yezhou.cc;
index index.html index.htm index.php;
root /data/www/phpldapadmin;
server_name_in_redirect off;
# 配置ip限制策略
include blockip.conf;
location ~ .+\.php($|/)
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
#伪静态及日志
#include /data/server/nginx/conf/rewrite/index.conf;
error_log /data/www/logs/phpldapadmin-error.log;
access_log /data/www/logs/phpldapadmin-access.log;
}
登录
在浏览器输入OpenLDAP服务端的域名:https://ldap.yezhou.cc
登陆:用户cn=admin,dc=sys,dc=com,密码:123456