How to configure Active Directory authentication with Apache web server
Authentication through Active Directory or LDAP is convenient and makes it easier to manage users within an organization. Apache can also authenticate through AD. With just a few changes to its configuration files, you can manage access through AD.
Configuring Apache to authenticate through Active Directory takes just three simple steps:
-
Edit /etc/http/conf/httpd.conf and uncomment the following lines.
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so -
Add the following lines. Change Directory to the path containing your files, and adjust the LDAP authentication settings.
############## LDAP Authen ######################### AuthBasicProvider ldap AuthType Basic AuthzLDAPAuthoritative on AuthName "Enter your LDAP username and Password" Require ldap-group CN=EzGroup,OU=GROUPS,DC=ezylinux,DC=com AuthLDAPURL "ldap://ldap.ezylinux.com/OU=Staff,DC=ezylinux,DC=com?SAMAccountName" AuthLDAPBindDN "CN=ldapsearch,OU=Corporate,DC=ezylinux,DC=com" AuthLDAPBindPassword "your-password" ################################################ Options Indexes FollowSymLinks AllowOverride None Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all -
Restart Apache with this command.
[root@Ezylinux ~]# service httpd graceful