<-
Apache > HTTP サーバ > ドキュメンテーション > バージョン 2.2 > モジュール

Please note

This document refers to the 2.2 version of Apache httpd, which is no longer maintained. The active release is documented here. If you have not already upgraded, please follow this link for more information.

You may follow this link to go to the current version of this document.

Apache モジュール mod_authn_file

翻訳済み言語:  en  |  fr  |  ja  |  ko 

説明:テキストファイルを用いたユーザ認証
ステータス:Base
モジュール識別子:authn_file_module
ソースファイル:mod_authn_file.c
互換性:Apache 2.1 以降

概要

本モジュールは mod_auth_digestmod_auth_basic といった認証フロントエンドに対して、 プレインテキストのパスワードファイル内からユーザを検索することで、 ユーザ認証機能を提供します。似たような機能は mod_authn_dbm でも提供されています。

mod_auth_basicmod_auth_digest を使用する際には、 AuthBasicProviderAuthDigestPrividerfile と指定することでこのモジュールは起動されます。

ディレクティブ

参照

top

AuthUserFile ディレクティブ

説明:認証に使用するユーザとパスワードの一覧が格納されている、 テキストファイルの名前を設定する
構文:AuthUserFile file-path
コンテキスト:ディレクトリ, .htaccess
上書き:AuthConfig
ステータス:Base
モジュール:mod_authn_file

AuthUserFile ディレクティブは、 ユーザ認証のためのユーザとパスワードの一覧を格納した テキストファイルの名前を設定します。file-path はユーザファイルへのパスです。 もし絶対パスでなければ、 ServerRoot からの相対パスとして扱われます。

ユーザファイルの各行には、ユーザ名、コロン、 暗号化したパスワードを記述します。 同一ユーザ ID が複数回登録された時は、 mod_authn_file は最初に見つかったパスワードを使用して認証します。

バイナリ配布の一部としてインストールされるか、 あるいは src/support にある htpasswd ユーティリティで、この HTTP 基本認証 用パスワードファイルをメインテナンスします。 詳細は man ページをご覧頂くとして、簡単には:

初期 ID username で、Filename というパスワードファイルを生成します。 次のコマンドを発行するとパスワードが要求されます:

htpasswd -c Filename username

パスワードファイル Filename に、username2 を追加したり修正したりします:

htpasswd Filename username2

(訳注: 非常に多くのユーザを登録すると大きなファイルになりますが) 大きなテキストファイルを検索するのは非常に効率が悪い ということに注意してください。そのような必要のある時は、 AuthDBMUserFile を代わりに使ってください。

HTTP ダイジェスト認証を使用する場合は、 htpasswd プログラムでは不十分です。その代わりに htdigest を使用してください。ダイジェスト認証用のデータと 基本認証用のデータを同一ファイルに混ぜて保存できない、 ということに注意してください。

セキュリティ

AuthUserFile は、ウェブサーバのドキュメントツリーの外側に保管するようにしてください。 保護しようとしているディレクトリ以下には、置かないで下さい。 そうしないと AuthUserFile は ダウンロードできてしまいます。

翻訳済み言語:  en  |  fr  |  ja  |  ko 

top

コメント

Notice:
This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Libera.chat, or sent to our mailing lists.