通过 mod_ldap 在 IBM HTTP Server 上使用 LDAP 进行认证

可以在 IBM® HTTP Server 上配置轻量级目录访问协议 (LDAP) 来认证和保护文件。

开始之前

[AIX Solaris HP-UX Linux Windows]最佳实践: 如果要将 mod_ibm_ldap 模块用于 LDAP 配置,请考虑迁移 mod_ibm_ldap 伪指令以使用 mod_ldap 模块。IBM HTTP Server 的此发行版提供了 mod_ibm_ldap 模块以与先前发行版兼容,但是,您必须迁移现有配置才能使用 mod_authnz_ldap 和 mod_ldap 模块,从而确保将来支持 LDAP 配置。

缺省情况下,用于 LDAP 的 LoadModule 伪指令未装入到 IBM HTTP Server 中。如果没有 LoadModule 伪指令,LDAP 功能就不可用。

要启用 LDAP 功能,请将 LoadModule 伪指令添加到 IBM HTTP Server httpd.conf 文件,如下所示:
LoadModule ldap_module modules/mod_ldap.so
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so

关于此任务

LDAP 认证由 mod_ldap 和 mod_authnz_ldap Apache 模块提供。
  • mod_ldap 模块提供 LDAP 连接池和高速缓存。
  • mod_authnz_ldap 使用 LDAP 连接池和高速缓存服务来提供 Web 客户机认证。
请参阅下列 Web 站点,以获取有关 LDAP(ldap_module 和 authnz_ldap_module)伪指令的详细描述:

过程

  1. 编辑 httpd.conf IBM HTTP Server 配置文件。
  2. 确定要对其限制访问的资源。 例如:<Directory "/secure_info">
  3. 如果 IBM HTTP Server 与 LDAP 服务器的连接是 SSL 连接,请将 LDAPTrustedGlobalCert 伪指令添加到 httpd.conf

    LDAPTrustedGlobalCert 伪指令指定在建立与 LDAP 服务器的 SSL 连接时,mod_ldap 使用的可信认证中心 (CA) 的目录路径和文件名。

    证书可以存储在 .kdb 文件或 SAF 密钥环中。如果使用了 .kdb 文件,那么 .sth 文件必须与它位于同一目录路径中并具有同一文件名,但扩展名必须为 .sth,而非 .kdb

    [AIX Solaris HP-UX Linux Windows] LDAPTrustedGlobalCert 伪指令必须是 CMS_KEYFILE 值类型。如果 LDAPTrustedGlobalCert 伪指令所指示的证书存储在 .kdb 文件中,请使用此值。

    [z/OS]LDAPTrustedGlobalCert 伪指令必须是 SAF_KEYRING 值类型。如果 LDAPTrustedGlobalCert 伪指令所指示的证书存储在 SAF 密钥环中,请使用此值。证书存储在 .kdb 文件中时的示例:

    [AIX Solaris HP-UX Linux Windows]
    LDAPTrustedGlobalCert CMS_KEYFILE /path/to/keyfile.kdb myKDBpassword
    证书存储在 SAF 密钥环中时的示例。[z/OS]
    LDAPTrustedGlobalCert SAF saf_keyring
    要点: 用于启动 IBM HTTP Server 的用户标识必须对此伪指令中指定的 SAF 密钥环具有访问权。如果该用户标识对 SAF 密钥环没有访问权,那么 SSL 初始化会失败。
    请参阅执行必需的 z/OS 系统配置,以获取有关访问在 RACF® 中定义的 SAF 密钥环的信息。
  4. 添加 AuthLDAPUrl 伪指令,它指定要使用的 LDAP 搜索参数。
    URL 的语法如下:
    ldap://host:port/basedn?attribute?scope?filter
  5. httpd.conf 中针对要使用特定于环境的值来保护的目录位置(容器)添加伪指令,例如:
    • Order deny 和 allow
    • Allow from all
    • AuthName Title of your protected Realm
    • AuthType Basic
    • AuthBasicProvider ldap
    • AuthLDAPURL your_ldap_url
    • Require valid-user
    • AuthLDAPBindDN "cn=Directory Manager"
    • AuthLDAPBindPassword auth_password
    除了允许 LDAP 存储库中提供的任何用户之外,mod_authnz_ldap 还提供了 Require ldap-userRequire ldap-groupRequire ldap-filter。使用多个 Require 伪指令时,如果任何(但不是所有) Require 伪指令与当前用户匹配,那么授权将成功。
    • Require ldap-user user1

      根据 AuthLDAPURL 查找“user1”,并确保其 DN 与已认证的用户的 DN 匹配

    • Require ldap-group cn=group1,o=example,c=US

      在列示的 LDAP 组中搜索当前已认证的用户

    • Require ldap-filter "|(someAttr=val1)(someVal=val2)"

      在提供的 LDAP 过滤器下搜索已认证的用户。如果该过滤器返回一个结果,那么授权已成功。

    对于 LDAP 服务器、保护设置和保护伪指令的各种组合,请对“位置”容器进行编码,类似于下面的示例:
    <Location /ldapdir>
      AuthName "whatever_LDAP"
      AuthType Basic
      AuthBasicProvider ldap
      AuthLDAPURL ldap://9.27.163.182:389/o=abc.xyz.com?cn?sub?
      Require valid-user
      AuthLDAPBindDN "cn=Directory Manager"
      AuthLDAPBindPassword d44radar
    </Location>
    http://publib.boulder.ibm.com/httpserv/manual70/mod/mod_authnz_ldap.html

指示主题类型的图标 任务主题



时间戳记图标 最近一次更新时间: last_date
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=ihs-dist&topic=tihs_apacheldapcfg
文件名:tihs_apacheldapcfg.html