The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how to stop apache from writting to error_log

Discussion in 'EasyApache' started by alphafi, Aug 30, 2005.

  1. alphafi

    alphafi Member

    Joined:
    Jun 9, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    Traffic has increased on website on Cpanel/Apache enterprise box. Due to a scipt the apache error log is increasing in size rapidly.

    As this script is vital for business I can't just disable it. However the error log rapidly goes to 2GB and apache drops.

    Is there a way to stop temporarily apache from writting errors to the error_log (i.e. just discard the errors) until I fix the script? Is there a way to do it in WHM? If not how do I do it? Will this break cpanel?

    Please help!!!! Thank you!!!!!
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    You could try by simply commenting out the ErrorLog line in httpd.conf or pointing it to /dev/null

    If that doesn't work, you could try clearing out the error_log in situ via a cron job, though this is definitely not recommended (i.e. you should fix the script) runs once an hour:

    0 * * * * cat /dev/null > /usr/local/apache/logs/error_log
     
  3. alphafi

    alphafi Member

    Joined:
    Jun 9, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hi chirpy thanks for the reply! Sorry for my "duftness"... which line do I have to comment out and how do I do it?
     
  4. ecwebtechie

    ecwebtechie Well-Known Member

    Joined:
    Mar 22, 2005
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    edit /usr/local/apache/conf/httpd.conf

    find the line

    ErrorLog /usr/local/apache/logs/error_log

    then change to

    #ErrorLog /usr/local/apache/logs/error_log

    service httpd restart | graceful | stop | start
     
  5. alphafi

    alphafi Member

    Joined:
    Jun 9, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    This is weird the log file that is getting big in size and creating the problem is:

    /etc/httpd/logs/error_log

    But there is no mention of it in httpd.conf?
     
  6. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    That's the same file as /usr/local/apache/logs/error_log. /etc/httpd is a symlink to /usr/local/apache
     
Loading...

Share This Page