【发布时间】:2017-12-11 04:21:01
【问题描述】:
我正在我的服务器上设置 Fail2ban,最近有很多不良机器人正在抓取我的网站,导致我的 SQL 服务器停机
来自我的 Apache2 日志
51.255.65.13 - - [10/Dec/2017:12:03:19 +0800] "GET /crew/nm0935095-gary-winick HTTP/1.0" 200 17985 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.2; +http://ahrefs.com/robot/)"
51.255.65.30 - - [10/Dec/2017:12:03:31 +0800] "GET /movie/tt0498567-summer-time-machine-blues HTTP/1.0" 200 17658 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.2; +http://ahrefs.com/robot/)"
217.182.132.190 - - [10/Dec/2017:12:03:36 +0800] "GET /movie/tt1705064-genji-monogatari:-sennen-no-nazo/ HTTP/1.0" 200 17344 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.2; +http://ahrefs.com/robot/)"
如何为“ahrefs.com”创建一个失败的正则表达式?
非常感谢
【问题讨论】:
-
你不想要fail2ban,你想要Apache规则拒绝引荐来源。一个简单的
Apache deny referrer谷歌搜索将显示有关该主题的大量资源。 -
谢谢,这是暂时的,但我检查了日志,在出现几个 500 错误后机器人仍在工作,它仍在抓取我的网站:(