はじめに
apacheの認証のパターンのまとめ。
認証なし
説明
特に何も認証しないパターン。
設定例
alias /no_auth /var/www/html/test <Location /no_auth> Options Indexes </Location>
パスワード認証
解説
apache でベーシック認証を参照。
ユーザ名とパスワードの組合せのファイルを作成して認証するパターン。
Basic認証の場合、パスワードが平文で流れるので注意。
設定例
alias /auth1 /var/www/html/test <Location /auth1> AuthType Basic AuthName "auth test 1 file" AuthUserFile /var/www/html/htpasswd Require valid-user </Location>
LDAPによる認証
説明
Webdav & LDAPを参照。
LDAPに認証を任せるパターン。
Basic認証の場合、パスワードが平文で流れるので注意。
フィルタについて
AuthLDAPURL ldap://ldap.server/c=jp?uid?sub
の指定ではフィルタも書くことができる。
AuthLDAPURL ldap://ldap.server/c=jp?uid?sub?(serviceType=1)
とか。
ADと認証する場合
ADに接続できるユーザを準備して
AuthLDAPBindDN AuthLDAPBindPassword
を設定する必要がある。
AuthLDAPBindDN と AuthLDAPBindPassword を記述しないと anonymous バインドする。
ADのデフォルトの設定では、場合はanonymouse バインドできないので注意。
必要なモジュール
- ldap_module
- authnz_ldap_module
設定例
alias /auth2 /var/www/html/test <Location /auth2> AuthType Basic AuthName "auth test 2 LDAP" AuthBasicProvider ldap AuthzLDAPAuthoritative off AuthLDAPBindAuthoritative on #AuthLDAPBindDN "hoge@vmware.local" #AuthLDAPBindPassword "pass" AuthLDAPURL ldap://ldap.server/c=jp?uid?sub Require valid-user </Location>
PAMによる認証
説明
Webdav & pamを参照。
認証をOSに任せるパターン。OSがADに参加しているとADユーザの認証も可能。
Basic認証の場合、パスワードが平文で流れるので注意。
必要なモジュール
- od_auth_externa
- pwauth
設定例
AddExternalAuth pwauth /usr/local/libexec/pwauth SetExternalAuthMethod pwauth pipe alias /auth3 /var/www/html/test <Location /auth3> AuthType Basic AuthName "auth test3 pam" AuthExternal pwauth Require valid-user </Location>
シングルサインオン
説明
LinuxのApacheでADを利用したシングルサインオンを参照。
AD(認証サーバ)とWebサーバとクライアントでシングルサインオンするパターン。
以下の条件が必須
- OSがADに参加していること
- KeepAlive On
必要なモジュール
- auth_ntlm_winbind_module
設定例
LoadModule auth_ntlm_winbind_module /usr/lib64/httpd/modules/mod_auth_ntlm_winbind.so KeepAlive On alias /auth4 /var/www/html/test <Location /auth4> NTLMAuth on AuthType NTLM AuthName "auth test 4 ntlm" NTLMAuthHelper "/usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp" NTLMBasicAuthoritative on require valid-user </Location>
[カテゴリ: OS > Linux]
[通知用URL]
Tweet
最終更新時間:2014年10月04日 22時35分15秒