OpenLDAP 系列6 --- 安装PHPLdapAdmin

一、概要

1. 承上启下

Open LDAP 系列

2. 环境

(1) CentOS 7.9 + PHPLdapAdmin 1.2.5

(2) Rocky Linux 9.3 + PHPLdapAdmin 1.2.6.6

3. 准备

(1) RHEL 安装 EPEL

(2) 关闭SELinux

二、安装包安装

1. 安装PHPLdapAdmin

sudo yum install phpldapadmin -y

2. 配置phpldapadmin.conf

sudo vi /etc/httpd/conf.d/phpldapadmin.conf

3. 配置config.php

(1) 编辑config.php

sudo vi /etc/phpldapadmin/config.php

(2) Useful important configuration overrides部分

a. Timezone

$config->custom->appearance['timezone'] = 'Asia/Shanghai';

(3) Define your LDAP servers in this section部分

a. 基础配置

$servers->setValue('server','name','CentOS LDAP'); //该名称会显示在PHPLDAPAdmin首页;
$servers->setValue('server','base',array('dc=example,dc=com')); //Base DN

b. TLS

$servers->setValue('server','host','127.0.0.1');
$servers->setValue('server','port',389);
$servers->setValue('login','tls',true);

c. ldaps(不推荐)

$servers->setValue('server','host','ldaps://127.0.0.1');
$servers->setValue('server','port',0);

(4) SASL Authentication节

a. 登录方式

$servers->setValue('login','attr','dn'); //解锁该行;
//$servers->setValue('login','attr','uid'); //注释该行;

b. 取消匿名登录

$servers->setValue('login','anon_bind',false); //该行将在PHPAdmin的登录页面去掉匿名登录的选项

4. 配置httpd

(1) 服务配置

sudo systemctl start httpd
sudo systemctl enable httpd

(2) 加入防火墙

//Rocky Linux 9.3
sudo firewall-cmd --add-service={http,https} --permanent

sudo firewall-cmd --add-service=httpd --permanent sudo firewall-cmd --reload

5. 访问

(1) http://server_ip/phpldapadmin

(2) 登录

(3) 登录后:

6. Https

参考: Apache HTTP Server 的安装与配置

7. Nginx

PhpLdapAdmin安装包预置了一些目录的权限设置,它与Apache的集成比较好,但是对Nginx的支持却较差。

四、参考

1. 官方

https://phpldapadmin.sourceforge.net/wiki/index.php/Config.php

https://phpldapadmin.sourceforge.net/wiki/index.php/Server:server:host

https://phpldapadmin.sourceforge.net/wiki/index.php/Server:server:tls

2. 其他

https://www.ezeelogin.com/kb/article/how-to-install-openldap-and-phpldapadmin-in-centos-426.html

https://www.itzgeek.com/how-tos/linux/centos-how-tos/install-configure-phpldapadmin-centos-7-ubuntu-16-04.html

http://muzso.hu/2012/03/29/how-to-configure-phpldapadmin-to-connect-to-an-ldap-server-via-ssl-ie.-ldaps

https://medium.com/analytics-vidhya/install-openldap-with-phpldapadmin-on-ubuntu-9e56e57f741e

https://www.zyxware.com/articles/5560/how-to-configure-phpldapadmin-in-ubuntu

https://kifarunix.com/install-and-setup-phpldapadmin-on-ubuntu-20-04/

https://kifarunix.com/install-phpldapadmin-on-centos-8/

https://www.howtoforge.com/how-to-install-and-configure-openldap-phpldapadmin-on-ubuntu-2004/

posted @ 2022-12-17 20:37  白马黑衣  阅读(865)  评论(0编辑  收藏  举报