2015年2月28日土曜日

htpasswd setting memo

(1).htpasswdファイルを新規作成する場合
[root@vm-fedora user_name]# htpasswd -b -c -m /etc/httpd/conf/.htpasswd user_name xxxxxxx
Adding password for user user_name

(2)既存の.htpasswdファイルへユーザーを追加する場合
htpasswd -b -m /etc/httpd/conf/.htpasswd user passwd

(3)ユーザー登録確認
cat /etc/httpd/conf/.htpasswd

(4).htaccessファイル作成
vi /target_dir/.htaccess

SSLRequireSSL
AuthUserFile /etc/httpd/conf/.htpasswd
AuthGroupFile /dev/null
AuthName "secret page"
AuthType Basic
require user user_name

0 件のコメント:

コメントを投稿