Monday, 19 September 2011

Apache LDAP Authentication

<IfModule !mod_auth_ldap.c>
  LoadModule auth_ldap_module modules/auth_ldap.so
</IfModule>

<IfModule mod_auth_ldap.c>
  LDAPSharedCacheFile logs/ldap_cache
</IfModule>

<Directory /caps/wwwstatus/>

        AuthName "My Restricted Area"
        AuthType Basic

        # AuthLDAPURL should point to your ldap server
        AuthLDAPURL ldap://localhost:389/o=ORG?cn

        # LDAP Login
        AuthLDAPBindDN cn=auser,ou=serviceusers,ou=services,o=ORG
        AuthLDAPBindPassword pwd

        # AuthLDAPGroupAttribute memberUid
        AuthLDAPGroupAttributeIsDN on
        require group cn=GROUP,ou=GROUPS,o=ORG
</Directory>

<Directory /caps/wwwstatus/data/>
        # Allow access to Javadoc without authentication - needed to link when generating javadoc
        Satisfy Any
        Allow from all
</Directory>