Apache LDAP authentication
This guide will show how to configure the Apache web server to authenticate users against Microsoft Active Directory. The most difficult part was to get the correct LDAP path for the AuthLDAPUrl
and AuthLDAPBindDN
parameters. Without the exact correct path it will NOT work, because LDAP does not traverse the Active Directoy for specified users, but relies on the exact full path specified.
CentOS – Apache, authenticating Microsoft Active Directory users:
vi /etc/httpd/conf/httpd.conf
Make sure the following 3 lines are NOT hashed out:
1 2 3 |
|
Wherever your web directory is, still in /etc/httpd/conf/httpd.conf
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
vi /etc/openldap/ldap.conf
Hash everything out and add the following line:
1
|
|
Restart Apache
1
|
|
Now if you go to your web server’s root with your browser, you will be prompted for a username and password. If you do have a valid Active Directory user account, you will be authenticated against AD.