今早在www.aspalliance.com上看到一篇文章(Stopping Automated Web Robots Visiting ASP/asp.net Websites
,http://aspalliance.com/1018_Stopping_Automated_Web_Robots_Visiting_ASPASPNET_Websites),
主要是講了下如何采取一些措施,防止robot過度去抓你的網站。看了一下,有的東西還是值得探討下的,現歸納如下:
1、辨認ROBOT的一些參考標準
Large numbers of requests from a single ip address or a range of IP addresses within the same subnet (i.e. the first three numbers of the IP address are identical).
· Large numbers of requests for database driven content compared to the rest of the website.
· Many requests made from browsers that do not support ASP sessions.
· Lots of and increasing numbers of website visitors, but no corresponding increase in transactions (e.g. sales!).
· Large numbers of spam or automated requests being generated from online forms.
2、到http://www.robotstxt.org/wc/norobots.html上,可以找到一個組織提出的防御robot的建議標準(可惜這個不是什么權威標準拉,沒什么約束力),在這里有一些平常我們可以用到的例子和方法,主要是搞一個robot.txt文件,放在網站根目錄下,比如
User-agent: *
Disallow: /
禁止所有robot
允許所有的robot訪問:
User-agent: *
Disallow:
User-agent: *
Disallow: /cyberworld/map/ 不允許robot探訪/cyberworld/map目錄下的文件
User-agent: cybermapper 允許cybermapper這個robot
Disallow:
User-agent: *
Disallow: /cyberworld/map/
Disallow: /tmp/
Disallow: /foo.html 不允許訪問foo.html這個文件了
3、如果不方便設置robot.txt的話,還可以在meta里做手腳,比如用
<meta name="robots" content="noindex, nofollow">
可以單獨對某頁設置防御robot
4 減慢robot的瘋狂訪問。如果發現robot瘋狂對你的站訪問,而造成效率的降低的話,可以減低
robot的訪問,
User-agent: Slurp
Crawl-delay: 10
是針對yahoo的,具體可以到http://help.yahoo.com/help/us/ysearch/slurp/slurp-03.html
去看詳細情況。
但其實有的robot很智能的,有時不會那么蠢真的一擁而上地去訪問。
5、如果發現不單是ROBOT,是有惡意的攻擊某頁的話,文章中說可以找
http://www.peterblum.com/VAM/VISETools.aspx#SDM.
這個工具試試
當然,之前好象CNBLOGS也受到ROBOT的困擾,因此歡迎各位多發表意見,提下自己的一些
辦法。
http://www.cnblogs.com/jackyrong/archive/2006/09/26/514917.html
|
新聞熱點
疑難解答