首页 > LAMP应用服务器 > Apache internal dummy connection 解决

Apache internal dummy connection 解决

2016年11月9日

Apache internal dummy connection 解决
http://liuyu.blog.51cto.com/183345/252514

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了

分类: LAMP应用服务器 标签:
本文的评论功能被关闭了.