How to stop Apache access.log grooving every few seconds?
Solution 1
You need to make some changes in /etc/apache2/apache2.conf
, specifically:
Create some environment tests with
SetEnvIf
, and;Then, use them on the CustomLog line.
As follows:
SetEnvIf Remote_Addr "127\.0\.0\.1" dontlog
SetEnvIf Remote_Addr "::1" dontlog
SetEnvIf User-Agent ".*internal dummy connection.*" dontlog
CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined env=!dontlog
That last line should already be in the file, just without the last bit.
Note that this will set the dontlog
environment variable if either of the 3 SetEnvIf
conditions are true. To avoid this, well, it's complicated; but this blog seems to have a solution.
Solution 2
This is Apache own doing for keeping processes live.
http://wiki.apache.org/httpd/InternalDummyConnection
http://www.electrictoolbox.com/apache-stop-logging-internal-dummy-connection/
Solution 3
check here. http://www.cathaycenturies.com/blog/?p=420
I think you need modify
/etc/apache2/sites-available/default
in order to make it work.
Related videos on Youtube
maninblack
Updated on September 18, 2022Comments
-
maninblack over 1 year
I installed a fresh Ubuntu 12.04 Server + Zend Server CE (MySQL / PHPmyadmin) from
deb http://repos.zend.com/zend-server/5.6.0_ubuntu1204/deb server non-free Repository
.My apache2/access.log looks like this and grooving every few seconds:
::1 - - [06/Aug/2012:13:27:59 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)" ::1 - - [06/Aug/2012:13:27:59 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)" ::1 - - [06/Aug/2012:13:27:59 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)" ::1 - - [06/Aug/2012:13:28:00 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)" ::1 - - [06/Aug/2012:13:28:00 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)" ::1 - - [06/Aug/2012:13:28:00 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)" ::1 - - [06/Aug/2012:13:28:00 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)" ::1 - - [06/Aug/2012:13:28:00 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)" 223.255.255.1 - - [06/Aug/2012:13:28:08 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-" 223.255.255.1 - - [06/Aug/2012:13:28:13 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-" 223.255.255.1 - - [06/Aug/2012:13:28:18 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-" 223.255.255.1 - - [06/Aug/2012:13:28:23 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-" 223.255.255.1 - - [06/Aug/2012:13:28:28 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-" 223.255.255.1 - - [06/Aug/2012:13:28:33 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-" 223.255.255.1 - - [06/Aug/2012:13:28:38 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-" 223.255.255.1 - - [06/Aug/2012:13:28:43 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-" 223.255.255.1 - - [06/Aug/2012:13:28:48 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-" 223.255.255.1 - - [06/Aug/2012:13:28:53 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-" 223.255.255.1 - - [06/Aug/2012:13:28:58 +0200] "HEAD / HTTP/1.1" 200 276 "-" "-"
Do you know why and how to prevent it?
-
Eliah Kagan over 11 yearsWelcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
-
Salvatorelab almost 11 yearsinstead of editing
/etc/apache2/apache2.conf
I've edited/etc/apache2/conf.d/other-vhosts-access-log
because I didn't find "CustomLog" in the first config file. Thanks and hope it helps -
Eric Carvalho almost 11 yearsWelcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
-
MarkHu almost 9 yearsNote one may have to add
LoadModule setenvif_module
andAddModule mod_setenvif.c
to httpd.conf file--ref httpd.apache.org/docs/2.2/mod/mod_setenvif.html