Portal Home > Knowledgebase > Articles Database > Help please, Apache2 restarted by itself, again
Help please, Apache2 restarted by itself, again
Posted by concorde, 05-08-2006, 05:26 AM |
My server at softlayer works great and the only problem now is Apache2 restarts automatically after a few days (maybe weekly). It's not a serious problem but I want to find the reason.
First, I use plesk and I didn't visit the plesk panel during the last 7 days, so it's not a restart caused by plesk configuration.
Second, the restart time of Apache2 is Sunday, 07-May-2006 04:02:14 CDT. And the first few lines of /var/log/httpd/error_log looks like this:
[Sun May 07 04:02:13 2006] [notice] SIGHUP received. Attempting to restart
[Sun May 07 04:02:13 2006] [notice] Digest: generating secret for digest authentication ...
[Sun May 07 04:02:13 2006] [notice] Digest: done
[Sun May 07 04:02:13 2006] [notice] LDAP: Built with OpenLDAP LDAP SDK
[Sun May 07 04:02:13 2006] [notice] LDAP: SSL support unavailable
[Sun May 07 04:02:14 2006] [notice] mod_python: Creating 4 session mutexes based on 350 max processes and 0 max threads.
[Sun May 07 04:02:14 2006] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
....
[Sun May 07 04:02:14 2006] [notice] Apache configured -- resuming normal operations
And the last line of cron log looks like this:
May 7 04:02:12 server2 anacron[23781]: Updated timestamp for job `cron.daily' to 2006-05-07
And the related lines in messages log looks like this:
May 7 04:02:13 server2 syslogd 1.4.1: restart.
May 7 04:02:13 server2 snmpd[23837]: NET-SNMP version 5.1.2
May 7 04:02:14 server2 crond(pam_unix)[23373]: session closed for user root
May 7 04:07:01 server2 crond(pam_unix)[24064]: session opened for user root by (uid=0)
So is there a way to figure out the problem caused the restart?
|
Posted by squeak, 05-08-2006, 06:56 AM |
Looks like logrotate is running on your server.
Check under /etc/logrotate.d, look at httpd.. you'll probably see the command to send a HUP following a rotate in there somewhere.
It's a necessary step in the rotation of your apache logs. It flushes the logs and reopens all the files.
|
Posted by concorde, 05-08-2006, 08:34 AM |
What's that? In my /etc/logrotate.d/httpd
/var/log/httpd/*log {
missingok
notifempty
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
endscript
}
My another server don't have this restart problem, so what to do?
|
Posted by warp2cris, 05-08-2006, 12:33 PM |
if you will look at the hour for all things, you will see the same (aprox) time.
these entries are from crontab doing his daily/weekly/mothly tasks
maybe on the other server you dont have crontab running? or logrotate installed ? which you should, both.
|
Posted by squeak, 05-08-2006, 04:45 PM |
The line I've emboldened matches up with this from your logs:
Most servers are set up by default to run logrotate at 4:00AM local server time. Assuming a 2 minute 13 second rotate time, logrotate sends a HUP (stands for hangup, but since modems are pretty much gone it's used for other purposes now) signal to tell Apache to flush it's log files.
|
Posted by concorde, 05-08-2006, 11:20 PM |
Dose this mean the most servers should have apache restart by itself automatically?
|
Posted by squeak, 05-09-2006, 12:03 AM |
It's technically not even restarting, it's just flushing the logs.
Your server is fine. Yes, most servers do this by default.
|
Posted by jhoseinii, 07-07-2015, 04:51 PM |
Hi,
at first , sorry for updating this old topic,
I have just same issue.
[Tue Jul 07 16:44:32 2015] [notice] SIGHUP received. Attempting to restart
but with a difference,
this apache restart, is happening in every 5 minutes !
all clients are seeing the "can not display" page in apache restart duration.
any suggestion?
|
Add to Favourites Print this Article
Also Read