46
53

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Apacheで特定のIPの場合、BASIC認証を回避する

Posted at
hoge.conf
<Directory "/var/www/vhosts/example.com/htdocs">
    Satisfy Any

    AuthType Basic
    AuthName "Abababa"
    AuthUserFile /var/www/vhosts/.htpasswd
    Require valid-user

    Order deny,allow
    Deny from all
    Allow from 192.168.1.0/24

    AllowOverride All
    Options Indexes FollowSymLinks
</Directory>

SatisfyをAnyに設定することで、BASIC認証・IP制限のどちらかをパスすればOKということになる。Satisfy All にすると、両方をパスしないと駄目。

まぁ、あんまり使う機会はないと思うけど。

46
53
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
46
53

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?