當開啟 Apache 的 access_log 查看裡面的內容,查詢記錄內簡中會看到一堆 “internal dummy connection” 的記錄:
根據 Apache 官方的說明, 這是 Apache HTTP Sever 管理它的子進程時,需要喚醒進程並建立的新連線,這個也是十分正常的 Log 記錄:
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.
即然這個訊息沒有問題,可能不用理會,或者直接設定將它略過,不會出現在 Access Log 裡面,先開啟 httpd.conf:
找到 access_log 那一行, access_log 預設是這樣:
|
1 |
CustomLog logs/access_log combined |
在上面的上一行改成這樣,以略過 “::1” 的記錄:
|
1 2 |
SetEnvIf Remote_Addr "::1" dontlog CustomLog logs/access_log combined env=!dontlog |
最後重新啟動 Apache, 便會略過 internal dummy connection 的紀錄: