以前使用过php_LDAP来实现网页登录认证,但是apache本身也有LDAP认证模块,自httpd-2.2以后更名为mod_authz_ldap,实现与LDAP/Active Directory服务器联合认证。本次操作实现于CentOS 5.3,默认安装Apache HTTPD组件,mod_authz_ldap模块需要手动安装:
引用
root@wardking:~ # yum -y install mod_authz_ldap


顺利安装后,/etc/httpd/conf.d/目录下会有authz_ldap.conf配置文件,使用vi编辑器打开后,可以看到mod_authz_ldap已经加载
引用
LodaModule authz_ldap_module modules/mod_authz_ldap.so


准备Active Directory认证所需要的设置信息:
首先需要确定登录用户所在的节点位置(OU),可以使用LDAP Browser等工具获得,例如:
引用
OU=Users, OU=University, DC=nottingham, DC=edu, DC=cn


另外,需要一个AD验证账号,实现LDAP Bind,不需要域管理员权限,这里设置为ldap,密码为ABCabc123

编辑authz_ldap.conf文件,对需要进行认证访问的目录做相关设置如下:

  AuthzLDAPMethod ldap
  AuthzLDAPAuthoritative on
  AuthzLDAPServer ldap.wardking.com:389
  AuthzLDAPUserBase "OU=users,OU=Studio,DC=wardking,DC=com"
  AuthzLDAPUserKey sAMAccountName
  AuthzLDAPUserScope subtree
  AuthzLDAPBindDN "ldap@wardking.com"
  AuthzLDAPBindPassword "ABCabc123"
  AuthType Basic
  AuthName "Wardking Studio"
  require valid-user


最后重启 httpd服务检测设置是否通过,遇到错误时先查看/var/log/httpd/error
Extra Info
This entry comes from 本站原创.It has been read for 1572 times.You may Leave a comment or 引用(0) this entry.
0 Responses
发表评论
昵称

网址

电邮

打开HTML 打开UBB 表情 打开表情 隐藏 记住我 [注册]