【1】 安装模块
yum install mod_authz_ldap
【2】 编辑配置文件
【3】 重启apache服务
【5】 (额外) userpassword 的生成过程 输入 123
Re-enter new password:
{MD5}ICy5YqxZB1uWSwcVLSNLcA==
yum install mod_authz_ldap
【2】 编辑配置文件
vim /etc/httpd/conf.d/authz_ldap.conf
LoadModule authz_ldap_module modules/mod_authz_ldap.so
<IfModule mod_authz_ldap.c>
lias /tmp/testldap "/www1"
<Directory "/tmp/testldap/">
# AuthzLDAPEngine on
AuthzLDAPMethod ldap
AuthzLDAPServer 192.168.1.221
AuthzLDAPUserBase ou=Apache,dc=uplooking,dc=com
AuthzLDAPUserKey cn
AuthzLDAPUserScope base
AuthType basic
AuthName "ldap@uplooking.com"
require valid-user
</Directory>
</IfModule>
【3】 重启apache服务
service httpd restart
dn: cn=u1,ou=Apache,dc=uplooking,dc=com
cn: u2
objectclass: person
objectclass: top
sn: 2
userpassword: {MD5}ICy5YqxZB1uWSwcVLSNLcA==
dn: cn=u1,ou=Apache,dc=uplooking,dc=com
cn: u3
objectclass: person
objectclass: top
sn: 3
userpassword: {MD5}ICy5YqxZB1uWSwcVLSNLcA==
【5】 (额外) userpassword 的生成过程 输入 123
[root@uplooking ~]# slappasswd -h {md5}
New password:Re-enter new password:
{MD5}ICy5YqxZB1uWSwcVLSNLcA==