1. 在配置文件里設(shè)置:
打開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文件法(在網(wǎng)站根目錄下建立或打開.htaccess文件,加入如下內(nèi)容)
Order allow,deny
Allow from all
Deny from 124.114.0.
Deny from 124.115.0.