Home >Backend Development >PHP Tutorial >apache 怎么禁止某个ip?

apache 怎么禁止某个ip?

WBOY
WBOYOriginal
2016-06-06 20:06:251320browse

apache怎么禁止某个ip地址访问网站, 比如禁止23.84.9.9

回复内容:

apache怎么禁止某个ip地址访问网站, 比如禁止23.84.9.9

如果要控制禁止某些非法IP访问,在Directory选项控制:

<code><directory>
Order allow,deny
Allow from all
Deny from 23.84.9.9 #阻止一个IP
Deny from 192.168.0.0/24 #阻止一个IP段
</directory>
</code>

或者配置.htaccess文件

<code>Deny from 23.84.9.9 #阻止一个IP
Deny from 192.168.0.0/24 #阻止一个IP段</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn