Apache 2.4 and LDAP
I had a server running RHEL 6.5 with httpd 2.2 and I had LDAP authentication for web pages working fine with this:
<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>
Users were getting a superfluous 500 errors accessing restricted pages, and some from Google reported that moving from httpd 2.2 to 2.4 could fix this problem. I installed a new server with RHEL 7 and httpd 2.4 and this is exactly the same line. But now...
[~]$ sudo apachectl configtest
AH00526: Syntax error on line 426 of /etc/httpd/conf/httpd.conf:
Unknown Authn provider: ldap
What's going on here? The RHEL 7 manual says LDAP authentication is baked into httpd 2.4, and AFAICT, I am following instructions from apache.org. FWIW, I cannot have any LDAP modules in yum or install in my / etc / httpd / modules.
Thoughts? I know I am missing something tiny.
Thank!
source to share
These instructions on the Red Hat website explain how to enable the appropriate repositories yum
to show mod_ldap
, as well as other packages that may depend on or be useful in your situation.
Also, in short, this is what I had to do to get it to work on RHEL 7:
---- Displays which repos are enabled/disabled
$ sudo yum repolist all
---- Enable these two repos to get mod_ldap and other things...
$ sudo yum-config-manager --enable rhel-server-rhscl-7-rpms
$ sudo yum-config-manager --enable rhel-7-server-optional-rpms
source to share