(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
[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