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