![[AIX Solaris HP-UX Linux Windows]](../images/dist.gif)
![[z/OS]](../images/ngzos.gif)
mod_ibm_ldap 伪指令迁移
本文中包含的信息可以帮助从使用 mod_ibm_ldap 模块的现有伪指令进行迁移,以使用开放式源代码 LDAP 模块(mod_authnz_ldap 和 mod_ldap)。迁移可确保在将来支持您的 LDAP 配置。
开放式源代码 LDAP 功能部件由两个模块提供。AuthLDAP 伪指令由 mod_authnz_ldap 模块提供,而 LDAP 伪指令由 mod_ldap 模块提供。需要装入这两个模块,LDAP 功能部件才可用。在下面一节中,使用通用名称 mod_ldap 引用开放式源代码 LDAP 模块。
ldapCodePageDir
mod_ldap 模块不提供用于指定 codepages 目录的伪指令。codepages 目录自动安装在正确的目录中,并且不能从其安装位置移动。
ldapCodePageDir /location/of/codepages
LDAPConfigfile
mod_ldap 模块不提供用于指定 LDAP 配置文件的伪指令。虽然没有用于指定 LDAP 配置文件的 mod_ldap 伪指令,但是如果您要将 LDAP 配置放置在单独的文件中,那么可以使用 Apache include 伪指令。
ldapConfigFile ldap.prop转换为以下内容:
Include /location/of/ldap_conf/apache_ldap.conf
迁移 mod_ibm_ldap LDAPConfigfile 伪指令的另一替代方法是使用 mod_authn_alias 模块 AuthnProviderAlias 容器来创建一组或多组 LDAP 伪指令,然后在需要的地方通过引用别名标签来使用这些伪指令
LdapRequire
mod_ldap 模块提供 Require 伪指令和 LDAP 扩展以实现 LDAP 认证安全性。
如果您之前对 IBM HTTP Server 使用了 require valid-user,那么可以保留此 Require 伪指令,而无需进行修改。为了实现最高级别的 LDAP 认证安全性,应该将 require valid-user 迁移至针对性更强的格式。有关更多信息,请参阅 Apache 文档以了解下列 Require 伪指令:ldap-user、ldap-dn、ldap-attribute、ldap-group、ldap-filter 和 valid-user。
LdapRequire filter "(&(objectclass=person)(cn=*)(ou=OurUnit)(o=OurOrg))" LdapRequire group MyDepartment转换为以下内容:
require ldap-filter &(objectclass=person)(cn=*)(ou=OurUnit)(o=OurOrg) require ldap-group cn=MyDepartment,o=OurOrg,c=US
ldap.application.authType
mod_ldap 模块不提供用于指定认证类型的伪指令。如果为 AuthLDAPBindDN 伪指令指定了值,那么将会启用基本认证。如果没有为 AuthLDAPBindDN 伪指令指定值,那么会启用 mod_ibm_ldap 模块的先前认证类型 None 或匿名。
ldap.application.authType=[None | Basic | Cert]
ldap.application.DN
mod_ldap 模块提供 AuthLDAPBindDN 伪指令以确定应用程序认证类型。
如果为 AuthLDAPBindDN 伪指令指定了值,那么 authType 伪指令的值为 Basic。如果未启用 AuthLDAPBindDN 伪指令,那么 authType 伪指令的值为 None。如果为 LDAPTrustedClientCert 伪指令指定了值,那么 authType 伪指令的值为 Cert。
ldap.application.DN=cn=ldapadm,ou=OurDirectory,o=OurCompany,c=US转换为以下内容:
AuthLDAPBindDN "cn=ldapadm,ou=OurDirectory,o=OurCompany,c=US"
ldap.application.password
mod_ldap 模块提供 AuthLDAPBindPassword 伪指令以指定 BIND 密码。该值以明文形式存储在配置文件中。因此,应该限制对配置文件的访问
ldap.application.password=mypassword转换为以下内容:
AuthLDAPBindPassword mypassword
ldap.application.password.stashFile
mod_ldap 模块不提供用于隐藏密码的伪指令。伪指令 AuthLDAPBindPassword 是指定密码的唯一方法,并且该值以明文形式存储在配置文件中。因此,应该限制对配置文件的访问。
ldap.application.password.stashfile=/path/to/stashfile.sth
ldap.cache.timeout
mod_ldap 模块提供 LDAPCacheTTL 伪指令以指定 LDAP 高速缓存的超时。LDAPCacheTTL 伪指令的作用域为全局,它必须位于配置文件的顶层。这不同于 mod_ibm_ldap 模块,因为 ldap.cache.timeout 伪指令可以位于配置文件中的任何位置。
ldap.cache.timeout=60转换为以下内容:
LDAPCacheTTL 60缺省值为 600 秒。
ldap.group.dnattributes
mod_ldap 模块提供 AuthLDAPSubGroupClass 伪指令以指定用于标识组的对象类。对于 mod_ibm_ldap 模块,所有值都在一个伪指令行上指定;但对于 mod_ldap 模块,可以在一行或多行上指定所有值,每一行包含该伪指令和一个值。
ldap.group.dnattributes=groupOfNames GroupOfUniqueNames转换为以下内容:
AuthLDAPSubGroupClass groupOfNames AuthLDAPSubGroupClass groupOfUniqueNames它们是缺省值。
ldap.group.memberattribute
mod_ldap 模块提供 AuthLDAPSubGroupAttribute 伪指令以指定用于标识当前组的子组成员的标签。对于 mod_ibm_ldap 模块,只能指定一个标签;但对于 mod_ldap 模块,可以指定多个标签(在一个伪指令行上列出所有标签,或提供多个伪指令行,每个标签在一个单独的伪指令行上列出)。
ldap.group.memberattribute=member转换为以下内容:
AuthLDAPSubGroupAttribute member AuthLDAPSubGroupAttribute uniqueMember
ldap.group.memberattributes
mod_ldap 模块提供 AuthLDAPGroupAttribute 伪指令以指定用于标识当前组的任何成员(例如用户或子组)的标签。对于 mod_ibm_ldap 模块,在一个伪指令行上指定所有标签;但对于 mod_ldap 模块,可以在一个伪指令行上指定所有标签,也可以在单独的伪指令行上指定每个标签。
ldap.group.membreattributes=member uniqueMember转换为以下内容:
AuthLDAPGroupAttribute member AuthLDAPGroupAttribute uniqueMember
ldap.group.name.filter
mod_ldap 模块不提供伪指令以指定独立的用户和组过滤器。mod_ldap 模块使用在 AuthLDAPURL 伪指令的末尾提供的过滤器。可以使用 mod_authn_alias 模块提供的 AuthnProviderAlias 容器伪指令来创建包含所需 LDAP 伪指令的独立的 my_ldap_user_alias 和 my_ldap_group_alias 别名。然后,可以在通过组成员资格控制授权的位置使用组别名。
ldap.group.name.filter=(&(cn=%v1)(|(objectclass=groupofnames)(objectclass=groupofuniquenames)))
ldap.group.search.depth
mod_ldap 模块提供 AuthLDAPMaxSubGroupDepth 伪指令以限制停止尝试在嵌套组中查找用户之前可继续的递归深度。
ldap.group.search.depth=5转换为以下内容:
AuthLDAPMaxSubGroupDepth 5缺省值为 10。
ldap.group.URL
mod_ldap 模块不提供用于指定授权组成员资格的 LDAP 服务器(其不同于用于认证用户的 LDAP 服务器)的伪指令。
您还必须在容器的 AuthLDAPURL 伪指令中指定 LDAP 组服务器。请确保为每个组指定正确的过滤器。
ldap.group.URL=ldap://groups_ldap.server.org:389/o=OurOrg,c=US ldap.group.URL=ldaps://groups_ldap.server.org:636/o=OurOrg,c=US
ldap.idleConnection.timeout
mod_ldap 模块不提供用于指定与 LDAP 服务器已建立的连接(已处于空闲状态)何时应该超时的伪指令。mod_ldap 模块自动检测 LDAP 服务器何时使连接到期,但不会导致连接到期。
ldap.idleConnection.timeout=60
ldap.key.file.password.stashfile
如果未在 LDAPTrustedGlobalCert 伪指令中指定密码,那么 mod_ldap 模块会自动使用 /path/to/keyfile.sth 文件(假定 /path/to/keyfile.kdb 是在 LDAPTrustedGlobalCert 伪指令中指定的密钥文件)。
有关如何指定密钥文件密码的信息,请参阅 Apache 信息以了解 LDAPTrustedGlobalCert 伪指令。该值以明文形式存储在配置文件中。因此,应该限制对配置文件的访问。
ldap.key.file.password.stashfile=/path/to/ldap.sth
ldap.key.fileName
mod_ldap 模块提供 LDAPTrustedGlobalCert 伪指令以指定装入证书时要使用的密钥文件。mod_ldap 模块还使用这些伪指令来以明文形式在配置文件中指定密码。因此,应该限制对配置文件的访问。
ldap.key.filename=/path/to/keyfile.kdb转换为以下内容:
![[AIX Solaris HP-UX Linux Windows]](../images/dist.gif)
LDAPTrustedGlobalCert CMS_KEYFILE /path/to/keyfile.kdb myKDBpassword
![[z/OS]](../images/ngzos.gif)
LDAPTrustedGlobalCert SAF saf_keyring
ldap.key.label
mod_ldap 模块提供 LDAPTrustedClientCert 伪指令以指定要使用 KDB 密钥文件中的哪个证书。如果使用缺省证书,那么不需要为这些伪指令指定值。
ldap.key.label=certname_from_kdb转换为以下内容:
LDAPTrustedClientCert CMS_LABEL certname_from_kdb
ldap.ReferralHopLimit
mod_ldap 模块提供 LDAPReferralHopLimit 伪指令,以限制停止尝试在分布式目录树中查找用户之前追踪引用的次数。
ldapReferralHopLimit 5转换为以下内容:
LDAPReferralHopLimit 5缺省值为 5。
ldapReferrals
mod_ldap 模块提供 LDAPReferrals 伪指令,用于允许或禁止在分布式目录树中查找用户时追踪引用。
ldapReferrals On转换为以下内容:
LDAPReferrals On缺省值为 On。
ldap.realm
mod_ldap 模块提供 AuthName 伪指令以指定授权域。
ldap.realm=Some identifying text转换为以下内容:
AuthName “Some identifying text”
ldap.search.timeout
mod_ldap 模块提供 LDAPSearchTimeout 伪指令以指定何时应放弃搜索请求。
ldap.search.timeout=10转换为以下内容:
LDAPSearchTimeout 10缺省值为 10 秒。
ldap.transport
mod_ldap 模块提供 LDAPTrustedMode 伪指令以指定与 LDAP 服务器通信时要使用的网络传输类型。
如果没有在 AuthLDAPURL 伪指令上指定任何端口,那么 mod_ldap 模块会忽略 LDAPTrustedMode 伪指令,并指定网络传输值 SSL。有关更多信息,请参阅 Apache 文档以了解 LDAPTrustedMode 和 AuthLDAPURL 伪指令。
- None 或 TCP,表示不加密。如果没有在 AuthLDAPURL 伪指令上指定端口,那么将使用端口 389。
- SSL。如果指定了值 None,那么会使用端口 636。
- TLS 或 STARTTLS。IBM HTTP Server 不支持这些开放式源代码类型。
ldap.transport=TCP (or SSL)转换为以下内容:
LDAPTrustedMode NONE(或 SSL)如果指定了 ldaps://URL,那么方式将变成 SSL 并且会忽略 LDAPTrustedMode 的设置。
ldap.URL
mod_ldap 模块提供 AuthLDAPURL 伪指令以指定 LDAP 服务器主机名和端口以及连接到服务器时要使用的基本 DN。mod_ldap 模块还提供用于指定用户属性、作用域、用户过滤器和传输方式的方法。有关更多信息,请参阅 Apache 文档以了解 AuthLDAPURL 伪指令。
ldap.URL=ldap://our_ldap.server.org:389/o=OurOrg,c=US ldap.URL=ldaps://our_ldap.server.org:636/o=OurOrg,c=US转换为以下内容:
AuthLDAPURL ldap://our_ldap.server.org:389/o=OurOrg,c=US?cn?sub?(objectclass=person) AuthLDAPURL ldaps://our_ldap.server.org:636/o=OurOrg,c=US?cn?sub?(objectclass=person)
ldap.user.authType
mod_ldap 模块不提供用于指定用户认证类型的伪指令。mod_ldap 模块根据提供的用户标识和密码凭证对用户进行认证。
ldap.user.authType=Basic [Basic | Cert | BasicIfNoCert]
ldap.user.cert.filter
mod_ldap 模块不提供用于过滤客户机证书的伪指令。mod_ldap 模块不会直接使用客户机证书。
ldap.user.cert.filter=(&(objectclass=person)(cn=%v1)(ou=%v2)(o=%v3)(c=%v4))
ldap.user.name.fieldSep
mod_ldap 模块不提供用于将提供的凭证解析为子组成部分的伪指令。mod_ibm_ldap 模块使用 ldap.user.name.fieldSep 伪指令来指定用于将凭证解析为 %v1, %v2, ...%vN 令牌的分隔符。
ldap.user.name.fieldSep=/ ,
ldap.user.name.filter
mod_ldap 模块不提供用于指定用户名过滤器的伪指令。mod_ldap 模块将用户名过滤器指定为 AuthLDAPURL 伪指令的一部分。
AuthLDAPURL 伪指令将在伪指令中指定的用户属性与提供的过滤器合并在一起以创建搜索过滤器。提供的过滤器遵循标准搜索过滤器规范。mod_ldap 模块也不提供可用于 mod_ibm_ldap 模块的 %vx 令牌解析功能。
ldap.user.name.filter=(&(objectclass=person)(cn=%v1 %v2))
ldap.version
mod_ldap 模块不提供用于指定 LDAP 版本的伪指令。mod_ldap 模块仅使用 LDAP V3。
ldap.version=2 (or 3)
ldap.waitToRetryConnection.interval
mod_ldap 模块不提供用于指定重试失败的连接尝试之前的时间长度的伪指令。当连接尝试失败时,mod_ldap 模块不会在连接重试之间进行定时延迟。请求失败之前,连接尝试最多自动重试 10 次。
当新的请求需要访问同一台 LDAP 服务器时,最多会再重试连接 10 次。重试调速基于发送至 LDAP 服务器的新请求量。
ldap.waitToRetryConnection.interval=300