Apache Undergoing graceful restart every two hours

0
898

one of the servers I am managing, I faced the following issue, like Apache was getting restarted gracefully every two hours.

#grep Graceful /usr/local/apache/logs/error_log
[Tue Feb 05 18:16:08 2013] [notice] Graceful restart requested, doing restart
[Tue Feb 05 20:12:53 2013] [notice] Graceful restart requested, doing restart
[Tue Feb 05 22:09:39 2013] [notice] Graceful restart requested, doing restart
[Wed Feb 06 00:06:24 2013] [notice] Graceful restart requested, doing restart
[Wed Feb 06 02:03:09 2013] [notice] Graceful restart requested, doing restart
[Wed Feb 06 04:16:35 2013] [notice] Graceful restart requested, doing restart

I came to know this is due to log processing. And I fixed the issue by enabling piped Apache logs. This can be done by either of the following methods;

Make a backup of the Apache configuration file;
———————————————-
#cp -rp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf_prepipedlogging
Edit /var/cpanel/cpanel.config:
——————————
#vi /var/cpanel/cpanel.config
Add the following
—————–
enable_piped_logs=1
Make cPanel aware of the change:
——————————-
/usr/local/cpanel/whostmgr/bin/whostmgr2 –updatetweaksettings
Rebuild the Apache config:
————————-
/scripts/rebuildhttpdconf
Stop and Start Apache:
———————
/etc/init.d/httpd stop
/etc/init.d/httpd start

Or you can enable piped logs via WHM using the following steps;

*Make a backup of the Apache configuration file,cp -rp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf_prepipedlogging
*Login to WHM
*Click Service Configuration
*Click Apache Configuration
*Click Piped Log Configuration
*Check the box labeled Enable piped Apache logs
*Click the Save button

LEAVE A REPLY

Please enter your comment!
Please enter your name here