1. 在配置文件里设置:
打开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.