- Basic認証
AuthName "User Authentication Required!"
AuthType Basic
Require Valid-User #登録ユーザーであれば可
AuthUserFile /path/to/.htpasswd #パスワードファイルの場所
$ cd /path/to
$ su
# htpasswd -c .htpasswd user1
New password:
Re-type new password:
- Digest認証
AuthName "User Authentication Required!"
AuthType Digest
Require Valid-User #登録ユーザーであれば可
AuthDigestFile /path/to/.htpasswd #パスワードファイルの場所
$ cd /path/to
$ su
# htdigest -c .htpasswd test user1
New password:
Re-type new password:
- dataをブラウザから見えなくする
order deny,allow
deny from all
- .htaccessや.htpasswdの中身が見られることを防ぐ
<Files ~ "^?.ht">
deny from all
</Files>
- 特定ホストからのみアクセス許可
order deny,allow
deny from all
allow from <自分の使うIPアドレス範囲>(ホスト名でも可)