Apache 2.4 和 LDAP

标签 apache ldap

我有一台运行 RHEL 6.5 和 httpd 2.2 的服务器,并且我对网页进行 LDAP 身份验证,与此完美配合:

<Directory /var/www/html/restricted>
  AuthType Basic
  AuthName "Restricted files"
  AuthBasicProvider file ldap
  AuthUserFile /etc/httpd/local_users
  AuthGroupFile /etc/httpd/local_groups

  AuthLDAPBindDN CN=bind,OU=Generic-Logon,OU=Generic,DC=example,DC=com
  AuthLDAPBindPassword lamepassword
  AuthLDAPURL ldaps://ldap.example.com:636/dc=example,dc=com?sAMAccountName?sub

  AuthzLDAPAuthoritative off

  require group restricted
  require ldap-group CN=ug-employees,OU=Dept,OU=Dept-Groups,DC=example,DC=com
  require ldap-group CN=ug-others,OU=Dept,OU=Dept-Groups,DC=example,DC=com
</Directory>

用户在访问受限页面时遇到过多的 500 个错误,一些谷歌搜索告诉我,从 httpd 2.2 到 2.4 可以解决这个问题。我安装了一台带有 RHEL 7 和 httpd 2.4 的新服务器,并且线路完全相同。但现在...

[~]$ sudo apachectl configtest
AH00526: Syntax error on line 426 of /etc/httpd/conf/httpd.conf:
Unknown Authn provider: ldap

这是怎么回事? RHEL 7 手册说 LDAP 身份验证已融入到 httpd 2.4 中,并且 AFAICT,我正在遵循 apache.org 的说明。 FWIW,我无法在 yum 中或在我的/etc/httpd/modules 中安装任何 LDAP 模块。

想法?我知道我错过了一些小东西。

谢谢!

最佳答案

根据 Redhat 的支持网站,您应该运行

# subscription-manager repos --enable rhel-7-server-optional-rpms
# yum install mod_ldap -y

参见:https://access.redhat.com/solutions/977573

关于Apache 2.4 和 LDAP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26476853/

相关文章:

apache - 在htaccess中仅将HTTP子域重定向到HTTPS子域

python - 无法在 Apache、WSGI、Django 和 Windows 中加载虚拟环境

c# - 如何使用 Active Directory 从属性中检索值?

c# - 如何检查 LDAP 用户是否存在/活跃?

ldap - 向 OpenLDAP 添加条目

python - 让 Django 与 Apache 一起工作

linux - Apache 中的自定义响应

PHP .htaccess 重写 url

java - 如何在 LDAP 中使用 DN 和密码在 Java 中进行绑定(bind)?

symfony - FOS 和 Fr3d ldap 与 symfony2.1 捆绑