1。安裝 mod_authz_ldap
yum install mod_authz_ldap
2。設定 apache ,vi /etc/httpd/conf.d/htaccess.conf
<Directory /var/www/html/test>
AuthzLDAPMethod ldap
AuthzLDAPAuthoritative on
AuthzLDAPServer 10.10.10.123:389 # AD 的IP
AuthzLDAPUserBase “DC=cross,DC=local” # AD的網域名稱,我的是 cross.local
AuthzLDAPUserKey sAMAccountName
AuthzLDAPUserScope subtree
AuthzLDAPBindDN “cross” # AD 管理者的帳號
AuthzLDAPBindPassword “crosspassword” # AD 管理者的密碼
AuthName “Need Password with using AD”
AuthType Basic
require valid-user
</Directory>
3。重啟apache
4。瀏覽 http://10.10.10.111/test ,測試登入帳密是否可以成功用AD的帳密登入
留言