Configuring Apache 2.2 LDAP auth to an Active Directory server

I greatly appreciated finding this page through a few Google searches, on how to configure Apache v2.2 web server to authenticate against an Active Directory server using LDAP.

The steps are also listed here in short-form incase the source site is lost in time.

a) Turn of ‘referrals’ in /etc/ldap/ldap.conf with

REFERRALS off

b) Install and enable the Apache ‘module’ authnz_ldap using your Operating Systems package tools.

c) The Apache config extract for the auth sections are:


AuthBasicProvider ldap
AuthType Basic
AuthLDAPURL "ldap://your-AD.server.hostname:389/DC=your-domain,DC=your-dc?sAMAccountName?sub?(objectClass=user)" NONE
AuthLDAPBindDN "LDAPROUser@DOMAIN"
AuthLDAPBindPassword "foo"
require ldap-attribute objectClass=user

Then restart your Apache, it’s that easy.

This entry was posted in Network Presence and tagged . Bookmark the permalink.