Apache interneal dummy connections for localhost (127.0.0.1 - - [] "OPTIONS * HTTP/1.0" 200 -)

For anyone interested in this, here's what I did:

1 -- Backed up the httpd.conf file.

2 -- Pico-ed into the httpd.conf file and scrolled down to the LogFormat section.

3 -- You will see a section that starts with this:


LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common

CustomLog logs/access_log common

Just change the CustomLog line, and enter a new line just above it. So your final will look like this:



LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common

SetEnvIf Remote_Addr "127\.0\.0\.1" exclude_from_log
CustomLog logs/access_log common env=!exclude_from_log



4 -- Restart Apache and now you should see no such entires when tailing /usr/local/apache/logs/access_log

Please note, that on one of our servers I had to use the following line instead, because the localhost entries were starting with ::1 rather than 127.0.0.1

SetEnvIf Remote_Addr "\:\:1" exclude_from_log

Also note ---> If you try this and it screws something up (it shouldn't), I take absolutely no responsibility. Again, be sure to backup your httpd.conf file before doing ANY work with this.

This removed the entries from the whm apache status as well as the logs.
Its nice not having the logs so large for something so silly.

Thank You.

Here are some useful links regarding this post:
http://forums.cpanel.net/f5/apache-strange-request-78449.html
http://www.linuxquestions.org/questions/linux-software-2/apache-...-internal-dummy-connection-506054/

    0 comments: