服务器(Ubuntu服务器)因为360Spider每秒运行的请求太多而失败了,我试图在.htaccess文件中使用此配置来解决这个问题:
BrowserMatchNoCase "360Spider" bots
BrowserMatchNoCase ^360Spider bots
Order Allow,Deny
Allow from ALL
Deny from env=bots
部分工作因为error.log记录了一些事件:
[Sun Jul 20 23:30:15 2014] [error] [client 10.183.200.5] client denied by server configuration: /var/www/view, referer: http://www.mysite.org/
但是access.log仍在保存有关360Spider的信息:
10.183.200.5 - - [20/Jul/2014:23:31:33 -0400] "GET /view/article/154967 HTTP/1.1" 403 536 "http://www.mysite.org/view/article/154967/" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0); 360Spider"
我想阻止所有拥有360Spider一词的人。
PD:我无法使用ip阻止机器人,因为所有流量都带有相同的IP。我只能使用.htaccess文件。答案 0 :(得分:0)
任何IP地址或访问网址/网站的机器人很可能会发出GET
请求 - Apache会将其记录。仅仅因为你在日志中看到它并不意味着它没有被阻止; 您的access.log清楚地显示它。
当机器人尝试GET /view/article/154967
时,它被拒绝(403 Forbidden)。