10

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?

Braiam
  • 66,947
  • 30
  • 177
  • 264
codeeditor
  • 151
  • 1
  • 1
  • 3

4 Answers4

8

You need to make some changes in /etc/apache2/apache2.conf, specifically:

  1. Create some environment tests with SetEnvIf, and;

  2. 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.

David Foerster
  • 35,754
  • 55
  • 92
  • 145
karora
  • 181
  • 4
  • 7
  • 1
    instead 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 – Salvatorelab May 10 '13 at 11:10
  • Note one may have to add `LoadModule setenvif_module` and `AddModule mod_setenvif.c` to httpd.conf file--ref http://httpd.apache.org/docs/2.2/mod/mod_setenvif.html – MarkHu Jun 05 '15 at 22:29
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/

Zvika Dror
  • 21
  • 1
  • 3
    Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, [it would be preferable](http://meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Eliah Kagan Aug 10 '12 at 09:35
1

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.

sean
  • 11
  • 1
  • 3
    Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, [it would be preferable](http://meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Eric Carvalho Jun 26 '13 at 01:05
0

This is work for me

SetEnvIf Remote_Addr "127\.0\.0\.1" loopback
CustomLog logs/access_log combined env=!loopback

I hope this work you too.

Radu Rădeanu
  • 166,822
  • 48
  • 327
  • 400
Sohbet
  • 1
  • 1