0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

apache2.2で特定のIPからのアクセスを制限するには、以下のように書く

許可するIPが先、拒否するIPが後の場合

Order allow,deny
Allow from xxx.xxx.xxx.xxx
Deny from xxx.xxx.xxx.xxx

拒否するIPが先、許可するIPが後の場合

Order deny,allow
Allow from xxx.xxx.xxx.xxx
Deny from xxx.xxx.xxx.xxx

気をつける点

特定のIPだけ許可して、それ以外は全拒否したい場合
以下の場合、許可した後に全拒否されるので、意図した動作にならない

Order allow,deny
Allow from xxx.xxx.xxx.xxx
Deny from all

正しくは以下

全拒否した後に特定のIPだけ許可できる
つまり、Orderの順がキモということ

Order deny,allow
Allow from xxx.xxx.xxx.xxx
Deny from all
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?