How to Remove Apache logs “internal dummy connection”

Valic —  February 7, 2012 — 2 Comments

If you have tons of entries like this in apache2 log and you want to get rig of them:

127.0.0.1 – - [07/Feb/2012:02:56:15 +0200] “OPTIONS * HTTP/1.0″ 200 152 “-” “Apache/2.2.16 (Debian) (internal dummy connection)”
127.0.0.1 – - [07/Feb/2012:02:56:16 +0200] “OPTIONS * HTTP/1.0″ 200 152 “-” “Apache/2.2.16 (Debian) (internal dummy connection)”
127.0.0.1 – - [07/Feb/2012:02:56:17 +0200] “OPTIONS * HTTP/1.0″ 200 152 “-” “Apache/2.2.16 (Debian) (internal dummy connection)”
127.0.0.1 – - [07/Feb/2012:02:56:07 +0200] “OPTIONS * HTTP/1.0″ 200 152 “-” “Apache/2.2.16 (Debian) (internal dummy connection)”
127.0.0.1 – - [07/Feb/2012:02:56:20 +0200] “OPTIONS * HTTP/1.0″ 200 152 “-” “Apache/2.2.16 (Debian) (internal dummy connection)”
127.0.0.1 – - [07/Feb/2012:02:56:21 +0200] “OPTIONS * HTTP/1.0″ 200 152 “-” “Apache/2.2.16 (Debian) (internal dummy connection)”
127.0.0.1 – - [07/Feb/2012:02:56:22 +0200] “OPTIONS * HTTP/1.0″ 200 152 “-” “Apache/2.2.16 (Debian) (internal dummy connection)”
127.0.0.1 – - [07/Feb/2012:02:56:23 +0200] “OPTIONS * HTTP/1.0″ 200 152 “-” “Apache/2.2.16 (Debian) (internal dummy connection)”

Here is how to remove them.:

Step1. Edit /etc/apache2/apache2.conf:

vim /etc/apache2/apache2.conf

Here we will create a filter called local or any other name you want:

# Filters
SetEnvIf REMOTE_ADDR “127.0.0.1″ local
SetEnvIf REMOTE_ADDR “: a” local

Step2. Enable this filter definition file for your sites:
We must change the following line in all sites enabled in /etc/apache2/sites-enabled/ folder:

CustomLog / var/log/apache2/www-access.log combined env =! Local

Step3. Restart apache2.

/etc/init.d/apache2 restart

Enjoy.

Valic

Posts Twitter Facebook

Editor in Chief at Debian-Tutorials, Linux enthusiast.

2 responses to How to Remove Apache logs “internal dummy connection”

  1. nice one. thanks.. is there a simpler way to do this in the latest debian version?

  2. I think this will work on the latest debian version..

Leave a Reply