Apache log 的 internal dummy connection

當開啟 Apache 的 access_log 查看裡面的內容,查詢記錄內簡中會看到一堆 “internal dummy connection” 的記錄:

::1 – – [26/Mar/2017:03:34:02 +0800] “OPTIONS * HTTP/1.0” 200 – “-” “Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips PHP/5.4.16 (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 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:

# vi /etc/httpd/conf/httpd.conf

找到 access_log 那一行, access_log 預設是這樣:

在上面的上一行改成這樣,以略過 “::1” 的記錄:

最後重新啟動 Apache, 便會略過 internal dummy connection 的紀錄:

# systemctl restart httpd

No Responses

  1. Pingback: 通过 Apache 实现用户认证 | Mr.Cpp 02 November 2018

Leave a Reply