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!

How do I disable apache error.log globally?

Discussion in 'EasyApache' started by OooLong, Jul 18, 2018.

  1. OooLong

    OooLong Well-Known Member

    Joined:
    Mar 16, 2011
    Messages:
    104
    Likes Received:
    1
    Trophy Points:
    66
    cPanel Access Level:
    Website Owner
    I want to know how to disable error.log globally. I understand the risk that come with it. I just want to do it. I was able to find one for access_log and disable it:

    #CustomLog logs/access_log combined

    but error_log does not exist in /etc/apache2/conf/httpd.conf

    Where do one go to disable it /etc/apache2/logs/error_log?
     
  2. webhostuk

    webhostuk Well-Known Member

    Joined:
    Sep 11, 2013
    Messages:
    145
    Likes Received:
    15
    Trophy Points:
    18
    Location:
    UK
    cPanel Access Level:
    Website Owner
    Twitter:
    Any reason to completely disable it? is it taking to much of your space if so why not think about adding a cron to clear them on a regular time interval?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,961
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    You can disable error logging for all virtual hosts on the system, but note that you will still see a limited number of entries in the Apache error log (e.g. Apache restarts). To do this, you should first create the required directory and include file:

    Code:
    mkdir /etc/apache2/conf.d/userdata
    touch /etc/apache2/conf.d/userdata/errorlog.conf
    Then, edit /etc/apache2/conf.d/userdata/errorlog.conf so that it contains the following line:

    Code:
    ErrorLog /dev/null
    The last step is to rebuild the Apache configuration file and restart Apache:

    Code:
    /scripts/rebuildhttpdconf
    /scripts/restartsrv_httpd
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

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