apache拒绝指定ip段内IP地址访问网站
可以从apache中封,既可以在httpd.conf配置文件中设置,也可以在.htaccess里设置。说明如下:
1、在apache配置文件中设置,打开httpd.conf文件进行编辑:
httpd.conf
复制代码 代码示例:
<directory “/var/www/html”>
options indexes followsymlinks
allowoverride none
order allow,deny
allow from all
deny from 124.114.0.
deny from 124.115.0.
</directory>
2、.htaccess文件配置方法,在网站根目录下建立或打开.htaccess文件,添加:
复制代码 代码示例:
order allow,deny
allow from all
deny from 124.114.0.
deny from 124.115.0.