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.

Apache keeps restarting

Discussion in 'EasyApache' started by Pedro Oliveira, Jul 13, 2016.

  1. Pedro Oliveira

    Joined:
    Jul 13, 2016
    Messages:
    16
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Toronto
    cPanel Access Level:
    Root Administrator
    Hi guys,

    Apache keeps restarting gracefully and I don't know why!

    Here is a snippet from the logs:
    Jul 13 14:52:49 2016] [error] [client 98.221.10.74] File does not exist: /usr/local/apache/htdocs/405.shtml
    [Wed Jul 13 14:52:49 2016] [error] [client 98.221.10.74] File does not exist: /usr/local/apache/htdocs/405.shtml
    [Wed Jul 13 15:12:29 2016] [error] [client 24.15.14.95] File does not exist: /usr/local/apache/htdocs/favicon.ico, referer:
    [Wed Jul 13 16:03:28 2016] [notice] Graceful restart requested, doing restart
    [Wed Jul 13 16:03:28 2016] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
    [Wed Jul 13 16:03:28 2016] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
    [Wed Jul 13 16:03:28 2016] [notice] Apache/2.2.26 (Unix) mod_ssl/2.2.26 OpenSSL/1.0.0-fips mod_bwlimited/1.4 configured -- resuming normal operations
    [Wed Jul 13 16:03:40 2016] [error] [client 100.0.82.196] File does not exist: /usr/local/apache/htdocs/405.shtml
    [Wed Jul 13 16:03:40 2016] [error] [client 100.0.82.196] File does not exist: /usr/local/apache/htdocs/405.shtml

    This happens almost every 2 hours or randomly. Sometimes it goes hours without restarting. It looks like it started happening 5 days ago.

    Attached is a pic of my memory usage. I don't think it's that. I've enabled piped logs after reading about it here.

    Can you guys point me in the right directin?
     
  2. twhiting9275

    twhiting9275 Well-Known Member

    Joined:
    Sep 26, 2002
    Messages:
    538
    Likes Received:
    15
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    This is likely caused by someone adding a domain or sub domain. Are there any errors before the restart?
     
  3. Pedro Oliveira

    Joined:
    Jul 13, 2016
    Messages:
    16
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Toronto
    cPanel Access Level:
    Root Administrator
    There are no errors and I'm the only one who has access.....I'm not adding any domains or sub domains.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    The following post explains why Apache restarts every two hours by default, and why it's normal:

    Why is Apache restarting every two hours?

    Let us know if you have any questions about this post.

    Thanks!
     
  5. Pedro Oliveira

    Joined:
    Jul 13, 2016
    Messages:
    16
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Toronto
    cPanel Access Level:
    Root Administrator
    Thanks Michael!

    Informative. Just one question though. I hadn't been on WHM in months and this all of a suddenly started happening on the 8th. I enabled piped logging after reading a few posts here (somehow I missed the one you linked, apologies) and it still restart last night at midnight. Shouldn't it have not restarted last night? I enabled piped logging yesterday evening.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    You will also notice Apache restarts when a cPanel or WHM user performs a change that involves modifying the httpd.conf file (e.g. adding/removing addon or subdomains). Or, in some cases, you may notice this with automatic package updates on EasyApache 4. Keep in mind that "Graceful Restarts" are generally accepted and don't result in downtown. There's documentation from Apache that explains this:

    https://httpd.apache.org/docs/current/stopping.html

    Thank you.
     
  7. Pedro Oliveira

    Joined:
    Jul 13, 2016
    Messages:
    16
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Toronto
    cPanel Access Level:
    Root Administrator
    Thanks Michael,

    I'm a total noob so can you tell me where I check for automatic updates?

    Certainly no one else is making changes to httpd.conf.

    Thanks,
    Pedro
     
  8. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    webhost manager> update preferences
    note: you must be running easyapache4 easyapache3 does not auto update
     
  9. Pedro Oliveira

    Joined:
    Jul 13, 2016
    Messages:
    16
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Toronto
    cPanel Access Level:
    Root Administrator
    So I am running easyapache3.

    Can we keep this thread open? I'm going to see how it goes.
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You can review the YUM log at:

    /var/log/yum.log

    You can also check the the cPanel update log with a command such as:

    Code:
    grep restartsrv_httpd /var/cpanel/updatelogs/*
    An entry like this is normal during cPanel updates:

    Code:
    *** Running updateuserdomains ***
    *** Done updateuserdomains ***
    *** Running apache_conf_distiller ***
    Distilled successfully
    *** Done apache_conf_distiller ***
    *** Running build_apache_conf ***
    Built /usr/local/apache/conf/httpd.conf OK
    *** Done build_apache_conf ***
    *** Running restartsrv_httpd ***
    Waiting for “httpd” to restart ………waiting for “httpd” to initialize ………finished.
    Thank you.
     
  11. Pedro Oliveira

    Joined:
    Jul 13, 2016
    Messages:
    16
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Toronto
    cPanel Access Level:
    Root Administrator
    Hi,

    So I get permission denied when running those commands. I can't even sudo them. Where in WHM or cpanel are the user accounts listed? I need to change password on root as I don't know it.

    Thanks,
    Pedro
     
  12. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Are you sure that you are reviewing /var/log/yum.log with a command such as "cat" instead of simply entering the path to the log file? For instance, you would view a log file like this with a command such as:

    Code:
    cat  /var/log/yum.log
    Your request for root access assistance is handled on the following thread:

    Root Access

    Thank you.
     
  13. Pedro Oliveira

    Joined:
    Jul 13, 2016
    Messages:
    16
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Toronto
    cPanel Access Level:
    Root Administrator
    So no entries in the yum.log for that string Michael!

    Is there any other logs I should be checking? The restarts only started to happen around July 8th, just curious as to what changed as I certainly did not log into it WHM/Cpanel and make changes.

    ..and thank you very much for your help, it's been great!
     
  14. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Were you able to check the cPanel update logs referenced in the earlier post to this thread?

    Thank you.
     
  15. Pedro Oliveira

    Joined:
    Jul 13, 2016
    Messages:
    16
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Toronto
    cPanel Access Level:
    Root Administrator
    Yes, sorry, I ran the grep command on the cpanel logs.
    I looked at the yum log, maybe I missed something. What am I looking for there?
     
  16. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Could you let us know the output when you run that command?

    Thank you.
     
  17. Pedro Oliveira

    Joined:
    Jul 13, 2016
    Messages:
    16
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Toronto
    cPanel Access Level:
    Root Administrator
    It returns nothing!
     
  18. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Keep in mind the Apache restarts are by design. It's likely a subdomain was added, or some other normal action resulted in the restart. Feel free to open a support ticket using the link in my signature so we can take a closer look and determine which action resulted in the graceful restart. You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
  19. Pedro Oliveira

    Joined:
    Jul 13, 2016
    Messages:
    16
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Toronto
    cPanel Access Level:
    Root Administrator
    Hmm, I don't have any of those type of accounts, I don't think.

    It's not restarting any longer (except at midnight which is fine) so the problem is solved. I just wanted to know why it started doing it all of a sudden. I'll wait until it happens again.

    THank you very much for your help Michael, really appreciate it.
     
    cPanelMichael likes this.
Loading...

Share This Page