最近博客一直有人恶意扫描,现在我们开始封IP吧.
apache封IP有两种方法。

httpd.conf

<Directory “网站地址”> 
    Options Indexes FollowSymLinks  
    AllowOverride None  
    Order allow,deny  
    Allow from all  
    Deny from 124.114.0. // 需要封的IP  
    Deny from 124.115.0.  

</Directory>

.htaccess

Order allow,deny
Allow from all
Deny from 124.114.0. // 需要封的IP
Deny from 124.115.0. // 需要封的IP

需要注意的是,这两种方法修改后 需要重启APACHE服务。

下面的恶意扫本博客的IP

176.113.115.214
139.59.174.107
39.104.173.109
176.151.44.172
176.113.115.214
193.118.53.202

都是些 国外IP

APACHE 封 UA 方法

RewriteCond %{HTTP_USER_AGENT} “.*EmbeddedWB.*” [OR]
RewriteCond %{HTTP_USER_AGENT} “.*QunarBot.*” [OR]
RewriteCond %{HTTP_USER_AGENT} “.*Windows 98.*” [OR]
RewriteCond %{HTTP_USER_AGENT} “^Mozilla/4.0$”
RewriteRule ^(.*)$ http://cao.ni.ma/