- 追加された行はこの色です。
- 削除された行はこの色です。
// 下階層用テンプレート
#topicpath
----
//ここにコンテンツを記述します。
httpd.confで以下の項目追加
<Directory "/opt/awstats/wwwroot"> <-認証をかけたいディレクトリ
AuthType Basic
AuthName "Awstats Secret Zone"
AuthUserFile /etc/httpd/conf/.htpasswd
Require user hogehogehoge <-ユーザ名
</Directory>
((Require user hogehogehoge は Require valid-userでもよいっぽい ))
以下のコマンドを実行
[root@www conf]# htpasswd -c /etc/httpd/conf/.htpasswd hogehogehoge
New password:
Re-type new password:
Adding password for user hogehogehoge
[root@www conf]#
ちなみにオプションの-cは上書きですね。上書きしないで追加の場合は何もオプションをつけなくてよいです。
Digest認証を行う場合は、
<Location "/framework"> <-URLのパスでもいい
AuthType Digest
AuthName "Subversion repository"
AuthUserFile /var/www/conf/.htdigest
Require valid-user <-こうかくと、認証されたユーザはOKとなる
</Location>
として以下のコマンドを実行します。
htdigest -c /etc/httpd/conf/.htdigest 'Subversion repository' hogehogehoge
引数の'Subversion repository'はAuthNameにあわせる必要があるようです。
ちなみに、ダイジェスト認証の処理シーケンスについてはWikipedia
-http://ja.wikipedia.org/wiki/Digest%E8%AA%8D%E8%A8%BC
に非常にわかりやすく説明されています。
***関連リンク [#se8f373f]
-[[Apacheでユーザー認証を行うには(Basic認証編)>http://www.atmarkit.co.jp/flinux/rensai/linuxtips/698apachebasic.html]]
-[[@IT:Apacheでユーザー認証を行うには(Digest認証編)>http://www.atmarkit.co.jp/flinux/rensai/linuxtips/699apachedigest.html]]
-[[Apache/Tips/Digest 認証 - Pocketstudio.jp Linux Wiki>http://pocketstudio.jp/linux/?Apache%2FTips%2FDigest%20%C7%A7%BE%DA]]
----
この記事は
#vote(おもしろかった[2],そうでもない[0])
#vote(おもしろかった[3],そうでもない[6])
#topicpath
SIZE(10){現在のアクセス:&counter;}