毎回ぐぐるので
htaccess に記述
AuthUserfile /app/.htpasswd
AuthGroupfile /dev/null
AuthName "Please enter your ID and password"
AuthType Basic
require valid-user
AuthUserfile
には .htpasswd
のパスを記載する。
htpasswd を作成
htpasswd -b ./.htpasswd {username} {password}
htpasswd
コマンドを使用して htpasswd
ファイルにユーザを追加出来る。
-c
オプションを付けるとファイルの生成まで行ってくれる模様。