查看apache2的日志,发现有大量
::1 - - [25/Dec/2009:13:07:51 +0800] "GET / HTTP/1.0" 302 - "-" "Apache/2.2.6 (Unix) PHP/5.2.9 (internal dummy connection)"
   
     查看Apache 官方的說明如下:
"When 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... These requests are perfectly normal and you do not, in general, need to worry about them. They can simply be ignored.
    原来是http的子进程的缘故,internal dummy connection是因为apache使用了prefork方式,若用worker 则不会使用pop(pipe of death)在进程间通信,就不会出现internal dummy connections了。
 
解決的方式:
1. 減少它發生的機會(修改 /etc/apache2/apach2.conf),找到 IfModule mpm_worker_module 這一段:
StartServers 15
MinSpareServers 5
MaxSpareServers 20
MaxClients 150
MaxRequestsPerChild 0
     增加 MaxSpareServers 的數量(請依您 server 的連線狀況來做調整),這個可以減少它發生的機率。但是这个方法不可取,视服务器的配置而定,若太高服务器会down掉。
 
2. 減少發生還是會發生,所以把這 Request 導到一個固定的網頁:
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
RewriteRule ^/$ /blank.html [L]
 
3. 不要把這資訊寫到 log 裡:
SetEnvIf Remote_Addr "::1" dontlog
CustomLog /var/log/httpd/access.log combined env=!dontlog
 
屏蔽"::1",可以过滤字符,不写入log中。