Skip to main content

Apache keeps restarting

Comments

18 comments

  • User Avatar
    twhiting9275
    This is likely caused by someone adding a domain or sub domain. Are there any errors before the restart?
    0
  • User Avatar
    Pedro Oliveira
    There are no errors and I'm the only one who has access.....I'm not adding any domains or sub domains.
    0
  • User Avatar
    cPanelMichael
    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!
    0
  • User Avatar
    Pedro Oliveira
    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.
    0
  • User Avatar
    cPanelMichael
    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.

    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:
    0
  • User Avatar
    Pedro Oliveira
    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
    0
  • User Avatar
    dalem
    webhost manager> update preferences note: you must be running easyapache4 easyapache3 does not auto update
    0
  • User Avatar
    Pedro Oliveira
    So I am running easyapache3. Can we keep this thread open? I'm going to see how it goes.
    0
  • User Avatar
    cPanelMichael
    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:
    grep restartsrv_httpd /var/cpanel/updatelogs/*
    An entry like this is normal during cPanel updates:
    *** 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.
    0
  • User Avatar
    Pedro Oliveira
    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
    0
  • User Avatar
    cPanelMichael
    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:
    cat /var/log/yum.log
    Your request for root access assistance is handled on the following thread: Root Access Thank you.
    0
  • User Avatar
    Pedro Oliveira
    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!
    0
  • User Avatar
    cPanelMichael
    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!

    Were you able to check the cPanel update logs referenced in the earlier post to this thread? Thank you.
    0
  • User Avatar
    Pedro Oliveira
    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?
    0
  • User Avatar
    cPanelMichael
    New Yes, sorry, I ran the grep command on the cpanel logs.

    Could you let us know the output when you run that command? Thank you.
    0
  • User Avatar
    Pedro Oliveira
    It returns nothing!
    0
  • User Avatar
    cPanelMichael
    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.
    0
  • User Avatar
    Pedro Oliveira
    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.
    0

Please sign in to leave a comment.