- apache 2.4 + ubuntu16.04で確認
Digest認証
a2enmod auth_digest
service apache2 restart
.htaccess
AuthType Digest
AuthName "Secret Zone"
AuthUserFile /opt/htdigest
Require valid-user
Satisfy any
order deny,allow
allow from 222.222.111.111
deny from all
認証用ファイル作成
htdigest -c /opt/htdigest 'Secret Zone' user1
Basic認証
.htaccess
AuthType Basic
AuthName "Secret Zone"
AuthUserFile /opt/htpasswd
Require valid-user
Satisfy any
order deny,allow
allow from 222.222.111.111
deny from all
認証用ファイル作成
htpasswd -c -b /opt/htpasswd username password