Apache internal dummy connection 解决

 Apache 日志出现大量的::1 - - [27/Dec/2009:16:36:44 +0800] "OPTIONS * HTTP/1.0" 200 - "-" "Apache (internal dummy connection)"
日志。。其实对系统无影响。
这些日志是apache2.2版本后,对自身进程的监听所产生的日志~~

具体说明下:
When the Apache HTTP Server manages its child processes, it needs a way to wake up processes that are listening for new connections. To do this, it sends a simple HTTP request back to itself. This request will appear in the access_log file with the remote address set to the loop-back interface (typically 127.0.0.1 or ::1 if IPv6 is configured). If you log the User-Agent string (as in the combined log format), you will see the server signature followed by "(internal dummy connection) " on non-SSL servers. During certain periods you may see up to one such request for each httpd  child process. 

你可以过滤掉这些日志
在WIKI已经有解决方法:
http://wiki.apache.org/httpd/InternalDummyConnection

具体是设置:
SetEnvIf Remote_Addr "127\.0\.0\.1" loopback
在你的CustomLog 未尾加上 env=!loopback

例如:
SetEnvIf Remote_Addr "::1" loopback
CustomLog "|cronolog -r /usr/bin/gzip logs/ads_access_log.%Y%m%d" combined env=!loopback

SetEnvIf Remote_Addr "127\.0\.0\.1" loopback
这里引号里会出现2种情况。随便改~~

还有一种解决方案:就是在httpd.conf 新建一个虚拟主机。必须排在最前面。
因为apache这种机制,只针对第一个虚拟主机有效

你再不保存access日志就OK了


本文转自守住每一天51CTO博客,原文链接:http://blog.51cto.com/liuyu/252514,如需转载请自行联系原作者

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值