1. First enable module mod_authnz_ldap. You can do it by typing
sudo a2enmod authnz_ldap
After the mod_authnz_ldap is successfully installed, you should see file authnz_ldap.load under /etc/apache2/mods-enabled folder.
2. On the active directory server, you need to create a user (does not need to be an administrator account, just domain user is ok). In the example below, the user is called AD_VIEWER with the password as password123.
3. Modify the file /etc/apache2/sites-enabled/000-default. I have included the sample file below.
deny from all
require ldap-user user1 user2
AuthLDAPURL maybe the hardest part to configure. You need to make sure the user you want to validate against are in the proper OU group. Otherwise the authenticaion process won’t work. For instance, if the user is located under OU = Sales which is under OU = Canada, then you need to specify OU=Sales, OU=Canada, dc=yourdomain,dc=com etc.