0
0

More than 5 years have passed since last update.

特定のIPからのアクセスは認証無しで、それ以外は認証

Last updated at Posted at 2016-03-25
  • 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
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0