配置 Apache Web 服务器可对 Active Directory 或目录服务器进行认证。
关于此任务
对 Active Directory 或目录服务器进行认证有两个主要步骤。
下面显示的过程是典型配置的一个示例。
有关更多详细信息,请参阅 Apache 文档。
过程
- 找到 Apache 配置文件 httpd.conf。
- 打开 httpd.conf 文件。 必须保护产品位置 /ideas 才能请求 Active Directory 认证。
- 在 HTTP 头中,将 IV-User 属性值设置为 USERID。
注: Active Directory 或目录服务器认证所需的 Apache 模块如下所示:
- mod_headers
- mod_ldap
- mod_authnz_ldap
确保已装入的模块列表中存在这些模块。
- 在 httpd.conf 文件中添加以下文本。
<Location "/ideas">
# STEP 1 : authenticate users on AD
AuthBasicProvider ldap
AuthType Basic
AuthLDAPRemoteUserAttribute sAMAccountName
AuthName "Active Directory Authentication"
AuthzLDAPAuthoritative off
AuthLDAPURL "ldap://adsrv/DC=test,DC=ideas,DC=com?sAMAccountName?sub?(objectClass=*)"
AuthLDAPBindDN " CN=bind user,OU=Sub CDC Test,OU=CDC Test,DC=test,DC=ideas,DC=com"
AuthLDAPBindPassword "1234"
Require valid-user
# STEP 2 : Pass the user’s ID to IDEAS in the IV-User variable
RequestHeader add IV-User "%{AUTHENTICATE_sAMAccountName}e"
</Location>
# STEP 3 : Enable SSL authentication (see Apache documentation for more details)
SSLProxyEngine On
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
# STEP 4 : set proxy information (see Apache documentation for more details)
ProxyPreserveHost on
ProxyRequests on
ProxyPass / https://<IP _address_VA>/
ProxyPassReverse / https://<IP _address_VA>/
配置文本中使用的参数如下所示。
- sAMAccountName
- 此项包含用户的用户标识。
- AuthLDAPURL
- 此项是 Active Directory 域中的基本搜索 URL。
- AuthLDAPBindDN
- 此项是域用户的 DN,可用于在 Active Directory 树中进行搜索。 该域用户是域用户成员。
- AuthLDAPBindPassword
- 此项是域用户的密码。
下一步做什么
请参阅 Apache 文档,以了解涉及 Active Directory 认证的所有配置。