比如说用了阿里云的slb ,然后他会检测服务器是否正常运行,通常会发大量的HEAD 请求过来。

这样有规则的请求是可以屏蔽的。步骤如下:

  1. 在 <Directory />中添加 SetEnvIf Request_Method HEAD dontlog
  2. CustomLog 中修改成 CustomLog logs/access_log combined env=!dontlog
  3. reload 即可。

可参考http://www.howtoforge.com/setenvif_apache2

官网http://httpd.apache.org/docs/2.2/mod/mod_setenvif.html

不只是Request_Method 还有其他变量也可以进行判断

  • Host
  • User-Agent
  • Referer
  • Accept-Language
  • Remote_Host: the hostname (if available) of the client making the request.
  • Remote_Addr: the IP address of the client making the request.
  • Server_Addr: the IP address of the server on which the request was received (only with versions later than 2.0.43).
  • Request_Method: the name of the method being used (GET, POST, etc.).
  • Request_Protocol: the name and version of the protocol with which the request was made (e.g., "HTTP/0.9", "HTTP/1.1", etc.).
  • Request_URI: the resource requested on the HTTP request line - generally the portion of the URL following the scheme and host portion without the query string.

nginx 里面就简单一些

if ( $request_method = "HEAD" )

{

  access_log off ;

}

apache httpd 不记录head 的请求。的更多相关文章

  1. Apache日志不记录图片文件设置方法和来源日志的配置

    Apache日志不记录图片文件设置方法 <FilesMatch "\.(ico|gif|jpg|swf)">SetEnv IMAG 1</FilesMatch&g ...

  2. apache httpd.conf

    Apache的主配置文件:/etc/httpd/conf/httpd.conf 默认站点主目录:/var/www/html/ Apache服务器的配置信息全部存储在主配置文件/etc/httpd/co ...

  3. Apache httpd.conf配置文件 2(Main server configuration)

    ### Section 2: 'Main' server configuration # # The directives in this section set up the values used ...

  4. 由浅入深学习Apache httpd原理与配置

    一.apache简介: Apache HTTPD又可以简称为httpd或者Apache,它是Internet使用最广泛的web服务器之一,使用Apache提供的web服务器是由守护进程httpd,通过 ...

  5. Nginx为什么比Apache Httpd高效:原理篇

    一.进程.线程? 进程是具有一定独立功能的,在计算机中已经运行的程序的实体.在早期系统中(如linux 2.4以前),进程是基本运作单位,在支持线程的系统中(如windows,linux2.6)中,线 ...

  6. Fedora8上Apache Httpd与Tomcat6初集成

    系统信息: 环境: Linux version :2.6.23.1-42.fc8,gcc version 4.1.2 20070925 Apache Httpd version: 2.2.6.3-3 ...

  7. Apache httpd和JBoss构建高可用集群环境

    1. 前言 集群是指把不同的服务器集中在一起,组成一个服务器集合,这个集合给客户端提供一个虚拟的平台,使客户端在不知道服务器集合结构的情况下对这一服务器集合进行部署应用.获取服务等操作.集群是企业应用 ...

  8. 缓存(之一) 使用Apache Httpd实现http缓存

    http://www.tuicool.com/articles/EFfeu2 HTTP性能的问题与方案 一个最终用户访问一个网页,从浏览器发出请求,到接受请求,时间大体上消耗在了以下几个部分: 建立t ...

  9. 使用mod_cluster进行apache httpd server和jboss eap 6.1集群配置

    本文简单介绍,使用mod_cluster进行apache httpd server和jboss eap 6.1集群配置.本配置在windows上测试通过,linux下应该是一样的.可能要稍作调整.后面 ...

随机推荐

  1. Spring Cloud 系列之 Sleuth 链路追踪(二)

    本篇文章为系列文章,未读第一集的同学请猛戳这里:Spring Cloud 系列之 Sleuth 链路追踪(一) 本篇文章讲解 Sleuth 基于 Zipkin 存储链路追踪数据至 MySQL,Elas ...

  2. 串口字符串-HEX格式

    串口字符串-HEX格式 C++SerialSerialPortHEX 介绍 串口通信过程中 通常涉及一个数据的模拟过程以及数据发送过程, 一般来说, 我们会发送一串指令给下位机 68 05 00 84 ...

  3. Latex-0-latex2word

    Latex-0-latex2word LatexXeLaTex Latex 转 Word 虽然latex 格式很方便,能够满足绝大部分的排版要求,但是在与人沟通的时候不可避免地需要用到其他格式文件,比 ...

  4. Shutdown SpringBoot App

    文章目录 Shutdown Endpoint close Application Context 退出SpringApplication 从外部程序kill App Shutdown SpringBo ...

  5. Spring5参考指南: BeanWrapper和PropertyEditor

    文章目录 BeanWrapper PropertyEditor BeanWrapper 通常来说一个Bean包含一个默认的无参构造函数,和属性的get,set方法. org.springframewo ...

  6. 12.Python提供了哪些内建类型

    There are mutable and Immutable types of Pythons built in types Mutable built-in types: List Set Dic ...

  7. swift 3.0字符串的简单使用

    let str:String = "12314124" 获取某个指定位置的元素 print(str.characters[str.index(str.startIndex, off ...

  8. rabbitMQ消息队列原理

    MQ:Message Queue,消息队列,是一种应用程序对应用程序的通信方法:应用程序通过读写出入队列的消息(针对应用程序的数据)来通信,而无需专用连接来链接它们. 1      rabbitMQ入 ...

  9. 一份中外结合的 Machine Learning 自学计划

    看了Siraj Raval的3个月学习机器学习计划的视频,感觉非常好,地址:https://www.youtube.com/watch?v=Cr6VqTRO1v0 结合一些我们学习中的经验得出一份Hy ...

  10. ACM学习心得

    今天打比赛,调整好了心态,不管rank榜,所以做的比上次好,今天A了四个题,都很水,memset的清零时间,需要好长,因为memset 跟cin超时了,它的数据量1e6,所以超时了还是多用scanf, ...