jip*_*pie 8 performance limit load apache-httpd
我的网站被谷歌网络蜘蛛 DoS 攻击。欢迎 Google 为我的网站编制索引,但有时它在我的网站上查询标签云的速度比我的网络服务器产生结果的速度要快,从而使我的网络服务器资源耗尽。
如何以不影响普通访问者的方式限制对我的网络服务器的访问?
robots.txt 不是选项,因为它会阻止整个站点被索引。
iptables -m recent
很棘手,因为有些页面有很多图像或其他数据文件,并且“最近”也触发了这些文件(通常是我的 RSS 聚合器,加载图像和提要)。
iptables -m limit
有同样的缺点,最重要的是,我无法对每个 IP 源地址进行选择性。
如何限制导致服务器负载过高的访问者?
我在 VirtualBox VM 的 Ubuntu 服务器上运行 apache2。
尝试mod_qos Apache 模块。当前版本具有以下控制机制。
文档中的这个示例条件规则应该能让您朝着正确的方向前进。
# set the conditional variable to spider if detecting a
# "slurp" or "googlebot" search engine:
BrowserMatch "slurp" QS_Cond=spider
BrowserMatch "googlebot" QS_Cond=spider
# limits the number of concurrent requests to two applications
# (/app/b and /app/c) to 300 but does not allow access by a "spider"
# if the number of concurrent requests exceeds the limit of 10:
QS_LocRequestLimitMatch "^(/app/b/|/app/c/).*$" 300
QS_CondLocRequestLimitMatch "^(/app/b/|/app/c/).*$" 10 spider
Run Code Online (Sandbox Code Playgroud)