●openldapのインストール

 LDAP (Lightweight Directory Access Protocol)サーバのインストールについて
紹介していきます。現在LDAPを扱うソフトウェアとしては、OpenLDAP,SunJava Systems
Directory Server, Novell eDirectory,Active Directory, IBM Directory Serverなどがあります。
他にも
アプライアンス製品としても色々なメーカーから売り出されています。
 今回はオープンソースであるOpenLDAPを使って行きます。商用製品よりオープンソースを
扱うことで、LDAPの動きの詳細を理解できると思います。
現在よくldapが用いられるのは

・システムユーザ認証
・DNSのホスト管理
・radiusサーバのデータ管理
・sambaユーザの認証
・apacheユーザ認証
MS Outlookのアドレス帳
・Netscapeのアドレス帳、ブックマーク
・Netcapeの証明書発行
・MTA(postfix,sendmail,qmail)の複数メールホストやホールバックホスト・アカウント管理
・POP/IMAPユーザのユーザ認証
他にもかなりたくさんあると思います

[先にインストールするべきソフト]
●openssl(インストールはこちら参照)
※トランスポート層(OSI4層)の
 セキュリティライブラリが必要

●kerberos
※openldapはSASL/GSSAPI認証メカニズムを使うには
 HeimdalかMIT Kerberos Vが必要
※今回はインストールしないが強力な認証サービスが必要な場
合はKerberosようなものを入れることが推奨されている。

●Cyrus SASL
※OpenLDAPクライアントもサーバーもこれらのライブラリが必
要 OSによってはもともと入っている。FedoraCoreやRHELなど

http://asg.web.cmu.edu/sasl/sasl-library.html
から最新版のをダウンロード

[root@solaris ldap]# gzip -dc cyrus-sasl-2.1.21.tar.gz|tar xf -
[root@solaris ldap]# cd cyrus-sasl-2.1.21
[root@solaris cyrus-sasl-2.1.21]# ./configure --with-openssl=/usr/local/ssl ¥
--with-gnu-ld 2>&1|tee configure.log;

digestmd5.c:1048: parse error before ')' token
digestmd5.c:1050: dereferencing pointer to incomplete type
make[2]: *** [digestmd5.lo] Error 1
make[2]: Leaving directory
`/var/tmp/src/ldap/cyrus-sasl-2.1.21/plugins'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/var/tmp/src/ldap/cyrus-sasl-2.1.21'
make: *** [all] Error 2

のようにエラーが出る場合があるかもしれません。
linuxでコンパイルする場合はほとんどないとは思いますが。
見つからないといわれるヘッダ見つけれるように
環境変数入れてconfigureしなおしておきましょう。
[root@solaris ldap]# CPPFLAGS="-I/usr/local/ssl/include \
-I/usr/local/ssl/include/openssl" export CPPFLAGS;

[root@solaris ldap]# rm config.cache
再度configureを前述と同じようにしておく

[root@solaris cyrus-sasl-2.1.21]# make install 2>&1|tee make_install.log

/usr/local/lib/sasl2にpluginがインストールされるので
LD_LIBRARY_PATHに追加しておきましょう。
後はデフォルトの/usr/local/libに入ります。

●BerkleyDB(インストールはこちら)
※slapdがDBDを使ってprimaryデータベースとして動きます。
  DBD4.2以上をインストールする必要があります。

●TCP WRAPPERインストールはこちら
※openldapはサポートするので使えるようにしておく



【準備】
http://www.openldap.org/software/download/
から最新版のopenldapをダウンロード

[インストール]
[root@solaris ldap]# gunzip -c openldap-2.3.11.tgz| tar xvf -
[root@solaris ldap]# cd openldap-2.3.11

--enable-ipv6           enable IPv6 support [auto]
--with-cyrus-sasl       with Cyrus SASL support [auto]
--enable-crypt        enable crypt(3) passwords [no]
--enable-spasswd      enable (Cyrus) SASL passwordverification [no]
--enable-wrappers     enable tcp wrapper support [no]
--enable-ldap         enable ldap backend no|yes|mod [no]

をつけてコンパイルできるようにしたい

[root@solaris openldap-2.3.11]# CPPFLAGS="-I/usr/local/BerkeleyDB.4.2/include \
-I/usr/local/include \
-I/usr/local/ssl/include \
-I/usr/local/ssl/openssl \
-I/usr/sfw/include" export CPPFLAGS;

[root@solaris openldap-2.3.11]# LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/BerkeleyDB.4.2/lib \
export LD_LIBRARY_PATH;

[root@solaris openldap-2.3.11]# LDFLAGS="-L/var/tmp/cyrus-sasl-2.1.21/lib \
-L/usr/local/BerkeleyDB.4.2/lib \
-L/usr/local/lib" export LDFLAGS;

[root@solaris openldap-2.3.11]#CC=gcc export CC

Linuxでコンパイルする場合はCPPFLAGS,LD_LIBRARY_PATH,LDFLAGSを設定しなくても
configureるはず。
solarisの場合は上記のように通さないといかない場合があります。



[root@solaris openldap-2.3.11]# ./configure \
--enable-crypt \
--enable-spasswd \
--enable-wrappers \
--enable-ldap \
--with-gnu-ld 2>&1|tee configure.log

※GNU LDを使わない場合は--with-gnu-ldはいらない
  GNU LDはshutilsを入れていると入っています。

[root@solaris openldap-2.3.11]# make depend2>&1|tee make_depend.log
[root@solaris openldap-2.3.11]# make 2>&1|teemake.log

少々時間かかります

[root@solaris openldap-2.3.11]# make test 2>&1|teemake_test.log

※tcp_wrpperを組み込んでいるので
 make testする前に/etc/hosts.allowファイルに「slapd:all:allow」
 を入れておかないと失敗します。

↓このように

[root@solaris openldap-2.3.11]# make test
cd tests; make test
make[1]: Entering directory
`/var/tmp/src/ldap/openldap-2.3.11/tests'
make[2]: Entering directory
`/var/tmp/src/ldap/openldap-2.3.11/tests'
Initiating LDAP tests for BDB...
Cleaning up test run directory leftover from previous run.
Running ./scripts/all...
>>>>> Executing all LDAP tests for bdb
>>>>> Starting test000-rootdse ...
running defines.sh
Starting slapd on TCP/IP port 9011...
Using ldapsearch to retrieve the root DSE...
Waiting 5 seconds for slapd to start...
Waiting 5 seconds for slapd to start...
Waiting 5 seconds for slapd to start...
Waiting 5 seconds for slapd to start...
Waiting 5 seconds for slapd to start...
Waiting 5 seconds for slapd to start...
ldap_bind: Can't contact LDAP server (-1)
>>>>> Test failed
>>>>> ./scripts/test000-rootdse failed (exit 1)
make[2]: *** [bdb-yes] Error 1
make[2]: Leaving directory
`/var/tmp/src/ldap/openldap-2.3.11/tests'
make[1]: *** [test] Error 2
make[1]: Leaving directory
`/var/tmp/src/ldap/openldap-2.3.11/tests'
make: *** [test] Error 2
[root@solaris openldap-2.3.11]#

うまくいくと結構時間はかかります。

[root@solaris openldap-2.3.11]# make install 2>&1|tee make_install.log

[設定]
[root@solaris openldap]# vi slapd.conf

#必要なスキーマをインクルードします。
#最初はOpenLAPに付属のものは
#/etc/openldap/schemaの中にあるものです。
#他のソフトウェアから提供されているスキーマをインクルードする
#必要がある場合はここでインクルードを追加します。

include         /etc/openldap/schema/core.schema
include         /etc/openldap/schema/cosine.schema
include         /etc/openldap/schema/inetorgperson.schema
include         /etc/openldap/schema/nis.schema
include         /etc/openldap/schema/samba.schema

#V3が通常ですが古いバージョン2もbindを許可する
allow bind_v2

#pidとargsfileの位置を指定
#必要に応じて変更します。

pidfile         /var/run/slapd.pid
argsfile        /var/run/slapd.args

#アクセス権の設定を行います。
#ココは適宜変更する必要があるかもしれません。

#今はとりあえず全てに対してread権を与えておきます。
access to * by * read
        by self write
        by anonymous auth
#バックエンドDBはBerkleyDBを使う場合はdbdを指定
database        bdb

#ここは自分で決めた名前に変更。
suffix          "dc=testdom,dc=jp"

#rootdn名を指定
rootdn          "cn=Manager,dc=testdom,dc=jp"

#rootのパスワードを指定暗号化の方法は後述参照
rootpw          {crypt}t.b8kzfe8o/ic

#OpenLDAPが使用するディレクトリを指定
directory       /var/lib/ldap

#インデックスの指定
index objectClass eq,pres
index ou,cn,mail,surname,givenname eq,pres,sub
index uidNumber,gidNumber,loginShell eq,pres
index uid,memberUid eq,pres,sub
index nisMapName,nisMapEntry eq,pres,sub

rootpwのパスワードをsecretでhashをcryptとする場合
# slappasswd -h {crypt} -s secret
{CRYPT}AqwoXi3kgeqUw
{CRYPT}, {MD5}, {SMD5}, {SSHA}, {SHA}のいずれかを指定する

[ログ出力の設定]
openldapのログはlocal4のファシリティでsyslogdに渡されます。
なのでsyslogの設定を変更しておきます。

# vi /etc/syslog.conf

<linux>
local4.* /var/log/slapd.log

<solaris>
local4.debug /var/log/slapd.log

※solarisでは*が使えないのでdebugとしておきましょう。
 TAB必ず記述します。スペースではありません。

# touch /var/log/slapd.log
# chmod ldap:ldap /var/logl/slapd.log
# pkill -HUP syslogd

[起動]
[root@solaris openldap]# /usr/local/libexec/slapd -f /usr/local/openldap/etc/slapd.conf
[root@solaris openldap]# ps -ef |grep slapd

    root  5533 25995  0 15:59:20 pts/3    0:00 grep slapd
    root  5531     1  0 15:59:16 ?        0:00 /usr/local/libexec/slapd


うまく起動しない場合はslapd -d 128などとしてデバッグオプションをつけることで
起動ができない原因を見つけることができます。

例えばRHELの標準でついているldap-serverを使用する場合は
/etc/openldap/cacertsディレクトリがないために起動ができないときなど
すぐに見つけることができます。


もしログファイルにslapd起動時に下記のようなwarningが出る場合

Apr 13 23:11:31 solaris10 slapd[10580]: [ID 735782 local4.debug] bdb_db_open: Warning - No DB_CONFIG file found in directory /usr/local/var/openldap-data: (2)

出る場合は

#cp /usr/local/etc/openldap/DB_CONFIG.example $PREFIX/var/openldap-data/DB_CONFIG

をしておくことでwarningがなくなります。

[root@solaris openldap]# ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts

# extended LDIF
#
# LDAPv3
# base <> with scope base
# filter: (objectclass=*)
# requesting: namingContexts
#

#
dn:
namingContexts: dc=testdom,dc=jp

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

・全属性の検索
[05:51pm root@solaris openldap]# ldapsearch -h localhost -x -b '' -s base '(objectclass=*)' '*' '+'
※-h ldapサーバの指定
  -x SASLの代わりにシンプル認証
 -b デフォルトではなくstartポイントを指定する
 -s ベースオブジェクトの指定

# extended LDIF
#
# LDAPv3
# base <> with scope base
# filter: (objectclass=*)
# requesting: * +
#

#
dn:
objectClass: top
objectClass: OpenLDAProotDSE
structuralObjectClass: OpenLDAProotDSE
namingContexts: dc=testdom,dc=jp
supportedControl: 2.16.840.1.113730.3.4.18
supportedControl: 2.16.840.1.113730.3.4.2
supportedControl: 1.3.6.1.4.1.4203.1.10.1
supportedControl: 1.2.840.113556.1.4.1413
supportedControl: 1.2.840.113556.1.4.1339
supportedControl: 1.2.840.113556.1.4.319
supportedControl: 1.2.826.0.1.334810.2.3
supportedExtension: 1.3.6.1.4.1.1466.20037
supportedExtension: 1.3.6.1.4.1.4203.1.11.1
supportedExtension: 1.3.6.1.4.1.4203.1.11.3
supportedFeatures: 1.3.6.1.4.1.4203.1.5.1
supportedFeatures: 1.3.6.1.4.1.4203.1.5.2
supportedFeatures: 1.3.6.1.4.1.4203.1.5.3
supportedFeatures: 1.3.6.1.4.1.4203.1.5.4
supportedFeatures: 1.3.6.1.4.1.4203.1.5.5
supportedLDAPVersion: 2
supportedLDAPVersion: 3
supportedSASLMechanisms: CRAM-MD5
supportedSASLMechanisms: DIGEST-MD5
subschemaSubentry: cn=Subschema

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

これでひとまず起動確認はできる。
インストールはこれで終了になる。

基本的なldap関連コマンドの使い方。

[ldapadd]
# ldapadd -x -h localhost -D "cn=Manager,dc=testdom,dc=jp" -w secret -f test.ldif
-x:SASLで暗号化しない
-h:ldapサーバ指定
-D:bind DN
-w:パスワード-Wでプロンプト表示で入力
-f:登録するldifファイルの指定


[ldapcompare]
# ldapcompare -x "uid=test,ou=People,dc=testdom,dc=jp" uidNumber:10000
 ldapcompare [options] DN <attr:value|attr::b64value>
-x:SASLで暗号化しない
結果が「true」か「false」で帰ってくる
[ldapdelete]
# ldapdelete -x uid=test,ou=People,dc=testdom,dc=jp -D "cn=Manager,dc=testdom,dc=jp" -w secret
 ldapdelete -x DN -D binddn -w password

[ldapmodify]
# ldapmodify -x -D "cn=Manager,dc=testdom,dc=jp" -w secret -f testuser.ldif
 ldapmodify -x -D binddn -w password -f file
[ldapmodrdn]
# ldapmodrdn -x -r -f rnd.ldif -D "cn=manager,dc=testdom,dc=jp" -w secret
-r:古いrdnは消す
rdn.ldifファイルには

uid=test2,ou=People,dc=testdom,dc=jp
uid=test

のように変更前と変更後を記述しておきます。
[ldappasswd]
# ldappasswd -x -D "cn=Manager,dc=testdom,dc=jp" -w secret \ "uid=test,ou=People,dc=testdom,dc=jp" -a test -s test
-w:binddnのパスワード
-a:古いパスワード,-Aとするとプロンプトで入力
-s:古いパスワード、-Sとするとプロンプトで入力


実際に一般ユーザが自分のパスワードを変更するときは
$ ldappasswd -x -D 'uid=test,ou=people,dc=testdom,dc=jp' \
-W 'uid=test,ou=people,dc=testdom,dc=jp' -S

New password:
Re-enter new password:
Enter LDAP Password:
Result: Success (0)

[ldapsearch]
# ldapsearch -x -L -b ou=people,dc=testdom,dc=jp uid=test
-L:ldifv1フォーマットで出力
-b:ベースDN名
uid=testは検索条件


[ldapwhoami]
# ldapwhoami -x -D "cn=manager,dc=testdom,dc=jp" -w secret

以上でldapサーバのインストールを終了します。

[クライアント設定]
クライアントの設定をする場合は
・ldap.confの作成
# vi /etc/ldap.conf

host 192.168.
base dc=testdom,dc=jp
ssl no
pam_password md5

[GUIツール]

ldap関連コマンドは非常に長くて複雑です。
そこでGUIツールとして

LDAP Browser/Editor
GQ
phpldapadmin

というものが存在します。
こちらはコマンドラインの意味が分かっていればGNUは非常に便利にです。


●LDAP Browser/Editor
素人向けのツールではないかもしれませんが
いちいちコマンドラインで長いコマンドを打たなくても
LDAPの仕組みさえ分かっていれば、非常に使いやすいです。

ダウンロードして解凍し、lbe.batで起動。

起動したらldapサーバへのコネクションの設定をします。

NEWボタンをクリック

・セッション名を決定(任意)


・接続先の設定

全て入力したら「Save」をクリック

・接続

決定した接続名を選択し「Connect」

・接続したら成功


コマンドが全て「Edit」メニューから実行可能です。




使い方は非常に簡単です。
一度実際に使ってみればすぐにldapのデータを編集することが実感できると思います。

apacheのユーザ認証にldapを使用

サンプルとしてapacheのユーザ認証ldapを使う!

[データベースの登録]
・トップツリーの登録
# vi top.ldif

# Organization For Example Corporation
dn: dc=testdom,dc=jp
objectClass: dcObject
objectClass: organization
dc: testdom
o: testdom
description: testdom test

# Organizational Role for Directory Manager
dn: cn=Manager,dc=testdom,dc=jp
objectClass: organizationalRole
cn:Manager
description: Direcotry Manager
###ココまでがトップツリー
###↓一気に次のpeopleツリーもgroupツリーも書いておきます。


# Peple Oganization Unit
dn: ou=People,dc=testdom,dc=jp
ou: people
objectclass: organizationalUnit


# Group Oganization Unit
dn: ou=Group,dc=testdom,dc=jp
ou: Group
objectclass: organizationalUnit

# ldapadd -x -D "cn=Manager,dc=testdom,dc=jp" -w secret -f top.ldif

adding new entry "dc=testdom,dc=jp"
adding new entry "dn: cn=Manager,dc=testdom,dc=jp"
adding new entry "ou=People,dc=testdom,dc=jp"
adding new entry "ou=Group,dc=testdom,dc=jp"

※-x saslを使わない
 -D rootdn名
 -w 認証で使うパスワード
 -f ファイルを指定

topツリーの登録が済んだら次はアカウント情報を
登録します。testというユーザを追加します。

# vi test.ldif

dn: uid=test,ou=People,dc=testdom,dc=jp
uid: test
cn: test
objectclass: posixAccount
objectClass: account
userPassword: {MD5}CY9rzUYh03PK3k6DJie09g==
loginShell: /bin/bash
uidNumber: 10000
gidNumber: 10000
homeDirectory: /var/tmp
gecos: test
description: "Nitta test"

# ldapadd -x -D "cn=Manager,dc=testdom,dc=jp" -w secret -f test.ldif

adding new entry "uid=test,ou=People,dc=testdom,dc=jp"

※userPasswordは
# slappasswd -h {MD5} -s test
パスワードtestをMD5にすることができます。

group名を登録します。

# vi testgroup.ldif

dn: cn=test,ou=Group,dc=testdom,dc=jp
cn: test
objectClass: posixGroup
gidNumber: 10000
memberUid: 10000

# ldapadd -x -D "cn=Manager,dc=testdom,dc=jp" -w secret -f testgroup.ldif

adding new entry "cn=test,ou=Group,dc=testdom,dc=jp"

[確認]
# ldapsearch -x -L -b "ou=people,dc=testdom,dc=jp" uid=test

version: 1

#
# LDAPv3
# base <dc=testdom,dc=jp> with scope sub
# filter: uid=test
# requesting: ALL
#

# test, people, testdom.jp
dn: uid=test,ou=people,dc=testdom,dc=jp
uid: test
cn: test
objectClass: account
objectClass: posixAccount
userPassword:: e01ENX1DWTlyelVZaDAzUEszazZESmllMDlnPT0=
loginShell: /bin/bash
uidNumber: 10000
gidNumber: 10000
homeDirectory: /home/test
gecos: test
description: "Nitta test"

# search result

# numResponses: 2
# numEntries: 1

[root@localhost ~]#  ldapsearch -x -b "ou=group,dc=testdom,dc=jp" cn=test -L

version: 1

#
# LDAPv3
# base <ou=group,dc=testdom,dc=jp> with scope sub
# filter: cn=test
# requesting: ALL
#

# test, Group, testdom.jp
dn: cn=test,ou=Group,dc=testdom,dc=jp
cn: test
objectClass: posixGroup
gidNumber: 10000
memberUid: 10000

# search result

# numResponses: 2
# numEntries: 1



[apacheの設定]


特にaprとapr-utilがないとldap関連のモジュールが
組み込めないので
http://apr.apache.org/
からダウンロードして入れておく。
[apr]
# ./configure --enable-profile \
 --enable-threads \
 --with-gnu-ld \
 --with-devrandom 2>&1|tee configure.log


# make 2>&1|tee make.log
# make install 2>&1|tee make_install.log
※/usr/local/aprにインストールされます

[apr-util]
# ./configure --with-apr=/usr/local/apr \
 --with-ldap-include=/usr/local/include \
 --with-ldap-lib=/usr/local/lib \
 --with-berkeley-db=/usr/local/BerkeleyDB.4.2 2>&1|tee
configure.log

# make 2>&1|tee make.log
# make install 2>&1|tee make_install.log

両方をインストールしたら
LD_LIBRARY_PATHに/usr/local/apr/lib
を追加しておきましょう。

apacheにmod_auth_ldapを組み込んで
apacheの認証をldapを使えるようにする。

# CPPFLAGS=-I/usr/local/apr/inlude export CPPFLAGS

※事前にBerkeleyDB,OpenSSLやGNU関連は
全てインストールしているものとする。
当然openldapも上記のようにインストールしている。

 
[mod_auth_ldap]
#openldap使ってない場合はSUNからSDKをとってこないとダメ
です。
#今回はopenldap使ってるのでいりません。
#まずはldap SDKを入れておく。
#http://wwws.sun.com/software/download/app_dev.html#sdks
#からSun ONE Directory SDK for C 5.08ダウンロード

http://www.muquit.com/muquit/software/mod_auth_ldap/mod_auth_ldap_apache2.html
からmod_auth_ldapダウンロード

# tar zxf modauthldap_apache2.tar.gz
# cd modauthldap_apache2
# ./configure --with-apxs=/usr/local/apache2/bin/apxs \
 --with-ldap-dir=/usr/local 2>&1|tee configure.log


※iplanetのSDK使ってる場合は--with-ldap-dir=/usr/local/iplanet
もつけましょう。
※linuxのパッケージに含まれているものであれば--with-ldap-dir=/usr

/usr/local/apache2/bin/httpd -l
でmod_so.cがロードされているか確認しましょう。
されていれば次のステップに、されていなければこちらを参考
にDSOサポートで
apacheをコンパイルしなおしましょう。

# make 2>&1|tee make.log

openldapでTLS使ってる場合は

*** Warning: Linking the shared library mod_auth_ldap.la
against the non-libtool
*** objects mod_auth_ldap.o is not portable!

のようなwarningが出ますが無視してかまいません。

# make install 2>&1|tee make_install.log
この時も同じく

*** Warning: Linking the shared library mod_auth_ldap.la
against the non-libtool
*** objects  mod_auth_ldap.o is not portable!

がでますが無視してかまいません。
これでmod_auth_ldapのインストールは終了です。


[apacheの設定]

すでにhttpd.confの設定ファイルには

LoadModule auth_ldap_module   modules/mod_auth_ldap.so

が記入されてロードされている状態になっています。


# mkdir /var/tmp/apache2/htdocs/foo
# chown www:www /var/tmp/apache2/htdocs/foo
# vi /usr/local/apache2/conf/httpd.conf

<Directory "/var/tmp/apache2/htdocs/foo">

Options Indexes FollowSymLinks
AllowOverride None
order allow,deny
allow from all
#AuthAuthoritative Off
AuthName "RCS Staff only"
AuthType Basic
#AuthOnBind Off
#Sub_DNou=CIS,ou=People
#LDAP_Persistent On
#Bind_Tries 5
#LDAP_Debug On
#LDAP_Protocol_Version 3
#LDAP_Deref NEVER

LDAP_StartTLS Off
LDAP_Server 10.208.36.166
LDAP_Port 389
# Connect timeout in seconds
# LDAP_Connect_Timeout 3
# If SSL is on, must specify the LDAP SSL port, usually 636
#LDAP_Port 636
#LDAP_CertDbDir /usr/foo/ssl

Base_DN "dc=testdom,dc=jp"
#Bind_DN "uid=admin,o=Fox Chase Cancer Center,c=US"
#Bind_Pass "secret"

UID_Attr uid
#UID_Attr_Alt "mail"
#Group_Attr uniqueMember
#SupportNestedGroupsOff
#require valid-user
require user test
#require roomnumber "123 Center Building"
#require filter "(&(telephonenumber=1234)(roomnumber=123))"
#require group cn=rcs,ou=Groups

</Directory>

http://www.muquit.com/muquit/software/mod_auth_ldap/mod_auth_ldap_apache2.html#directives
に全部のディレクティブの説明があります。


[動作確認]

実際にhttp://webserver/foo/
にアクセスして見ます。

ログファイルに以下のような出力が出て認証が成功することが
分かります。

access_log

10.208.36.66 - - [09/Nov/2005:15:00:40 +0900] "GET /foo/
HTTP/1.1" 401 517
10.208.36.66 -
test [09/Nov/2005:15:00:45 +0900] "GET /foo/ HTTP/1.1" 200 589
10.208.36.66 - - [09/Nov/2005:15:00:45 +0900] "GET /icons/blank.gif HTTP/1.1" 200 148
10.208.36.66 - - [09/Nov/2005:15:00:45 +0900] "GET /icons/back.gif HTTP/1.1" 200 216

error_log

[Wed Nov 09 15:00:45 2005] [error] [client 10.208.36.66] [mod_auth_ldap.c (1083) ]- mod_auth_ldap v2.12 (compiled with OpenLDAP TLS) url: http://muquit.com/
[Wed Nov 09 15:00:45 2005] [error] [client 10.208.36.66] [mod_auth_ldap.c (1096)] - LDAP server=10.208.36.166,Port=389
[Wed Nov 09 15:00:45 2005] [error] [client 10.208.36.66] [mod_auth_ldap.c (1214)] - Using already open ldap connection: 848c930, pid=27845
[Wed Nov 09 15:00:45 2005] [error] [client 10.208.36.66] [mod_auth_ldap.c (1249)] - you didn't compile with iPlanet C SDK, connect timeout will not be available
[Wed Nov 09 15:00:45 2005] [error] [client 10.208.36.66] [mod_auth_ldap.c (749) ] - Using LDAP filter:
(uid=test)
[Wed Nov 09 15:00:45 2005] [error] [client 10.208.36.66] [mod_auth_ldap.c (1351)] - Bind attempt# 1,
pid=27845,User DN: uid=test,ou=People,dc=testdom,dc=jp

apacheのユーザ認証をldapで行うのは非常に簡単です。
また、OpenLDAPではなくSunJava Directory Serverを使用した場合でも
設定方法は全く一緒です。