Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Exclude 'internal dummy connection' entries in apache access log

Discussion in 'EasyApache' started by morrow95, Jun 28, 2017.

  1. morrow95

    morrow95 Well-Known Member

    Oct 8, 2006
    Likes Received:
    Trophy Points:
    So here is what is going on. I have a folder of php scripts that are accessed constantly (apache is serving 70 - 100 requests/sec - they are accessed a lot. I've been going through and removing the logging for this folder to prevent additional resources being used.

    1 - I have excluded these specific scripts from showing in their respective access log (/usr/local/apache/domlogs/ AND /usr/local/apache/domlogs/

    2 - I changed suphp.conf from info to warn (info creates a new entry for every single access)

    3 - Here is where I am having trouble accomplishing what I want to do......

    My /var/log/apache2/access_log has tons of lines like this :

    ::1 - - [28/Jun/2017:02:09:56 -0400] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (cPanel) OpenSSL/1.0.1e-fips mod_bwlimited/1.4 (internal dummy connection)"

    I'm talking anywhere from every second to every 10 seconds. I want to exclude those from being written. I found some information on the web about doing this by modifying the httpd.conf (or in this case I would be editing an include file so it is not overwritten when cpanel updates).

    My /usr/local/apache/conf/httpd.conf shows the following for the logging section :

    <IfModule mod_log_config.c>
    LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combinedvhost
    <IfModule logio_module>
    LogFormat "%v %{%s}t %I .\n%v %{%s}t %O ." bytesvhost
    LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b" common
    LogFormat "%{Referer}i -> %U" referer
    LogFormat "%{User-agent}i" agent
    <IfModule logio_module>
    CustomLog "|/usr/local/cpanel/bin/splitlogs --suffix=-bytes_log" bytesvhost
    CustomLog "|/usr/local/cpanel/bin/splitlogs --mainout=/etc/apache2/logs/access_log" combinedvhost

    What I have tried to do is add the following in the pre virtual host include in Apache Global Config of WHM (all scenario solution) :

    SetEnvIf Remote_Addr "127\.0\.0\.1" dontlog
    SetEnvIf Remote_Addr "::1" dontlog
    SetEnvIf User-Agent ".*internal dummy connection.*" dontlog
    CustomLog "|/usr/local/cpanel/bin/splitlogs --mainout=/etc/apache2/logs/access_log" combinedvhost env=!dontlog

    I still get the internal dummy connection entries added in the access log after restarting apache. How can I exclude these from being added in?
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator

    You may need to customize the EasyApache 4 template files to make these changes, similar to how it's done on the following thread:

    SOLVED - Global Log

    Thank you.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice