Apache2.0でLDAP(Active Directory)認証
Apache2.0でLDAP認証する方法について調べてみたが、あまり日本語の情報がなくて苦労したのでここに備忘録として書いておく。
- 環境
- Apache2.0.55(Windows)
- Windows Server 2003(Active Directory)
Apacheの設定
- モジュールの組み込み
httpd.confのLoadModuleの書いてあるセクションの末尾に、以下を追記*1
LoadModule ldap_module modules/util_ldap.so
LoadModule auth_ldap_module modules/mod_auth_ldap.so
- LDAPサーバ情報の記述
認証したい部分に、下記のように認証を行うLDAPサーバ情報を記載する。
AuthType Basic
AuthName "Auth LDAP"
# for Active Directory
AuthLDAPUrl ldap://ldap.example.com:389/ou=Users,dc=example,dc=com?samAccountName?sub?(objectClass=*)
# for Other LDAP Server(ex.OpenLDAP)
#AuthLDAPUrl ldap://ldap.example.com:389/ou=Users,dc=example,dc=com?uid?subRequire valid-user