end0tknr's kipple - 新web写経開発

http://d.hatena.ne.jp/end0tknr/ から移転しました

apache 2.2 のbasic認証をldapで行う

次のような感じです

configure; make ; make install

$ ./configure --prefix=/home/endo/local/apache22_2 \
             --with-mpm=prefork \
             --enable-proxy \
             --enable-modules=all \
             --with-ldap \
             --enable-authnz-ldap=shared \
             --enable-ldap=shared \
             --enable-so
$ make
$ make install

httpd.conf - apacheの設定ファイル

LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
LoadModule ldap_module        modules/mod_ldap.so

<Directory "/home/endo/dev/test">
    AllowOverride All
    Order allow,deny
    Allow from all

    ## basic auth by passwd file
#    AuthType BASIC
#    AuthUserFile /home/endo/dev/htpasswd
#    AuthName "COLINUX MEMBERS"
#    require valid-user

    ## BASIC AUTH by LDAP
    AuthName "User/Password"
    AuthType Basic
    AuthBasicProvider ldap
    AuthzLDAPAuthoritative  off
    AuthLDAPURL  ldap://colinux.a4.jp/ou=People,dc=my-domain,dc=com?cn?sub
    Require valid-user

    <Files "*.pl">
       Options ExecCGI
       AddHandler cgi-script .pl
    </Files>

</Directory>
Alias /test /home/endo/dev/test