• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

httpd is stopping automaticly

C

Claus Lundholm

Guest
Hi

I've got a problem that my httpd is stopping automaticly sometimes -making all sites unreachable. Something is stopping my httpd -but what. I can start the httpd manualy again, and then it can run for weeks before it's stops again.

What can be the problem here?
 
Originally posted by EvolutionCrazy
do you get any error in your

/var/log/httpd/error_log

after it stops?

The only thing i can see is this:

[Fri Jun 17 11:44:40 2005] [error] OpenSSL: error:140760FC:lib(20):func(118):reason(252)
[Fri Jun 17 12:17:12 2005] [notice] SIGUSR1 received. Doing graceful restart
[Fri Jun 17 12:17:13 2005] [warn] module mod_frontpage.c is already added, skipping
[Fri Jun 17 12:17:13 2005] [notice] Apache/1.3.27 (Unix) (Red-Hat/Linux) FrontPage/5.0.2.2623 mod_python/2.7.8 Python/1.5.2 mod_ssl/2.8.12 OpenSSL/0.9.6b PHP/4.3.8 mod_perl/1.26 configured -- resuming normal operations
[Fri Jun 17 12:17:13 2005] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Jun 17 12:17:13 2005] [notice] Accept mutex: sysvsem (Default: sysvsem)

But's it's before i restarted the https myself.
 
I had a similar problem and made the following script that checks the number of httpd related processes and restarts it if it goes out of bounds :

Save it as /etc/httpd/httpdwatch
--------------------------------------------------

#!/bin/sh

#
# Restart HTTPD if fewer than 6 httpd related processes or more than 99 httpd related processes
#
# Use in a cron job run every minute
#
# /etc/httpd/httpdwatch>>/var/log/httpd/watch_log
#
# V 1.01 - May 15, 2005 - E. Vinter / Pages-Web.com
#
#

mn=`date +%M`
if [ $mn -eq 0 ]
then
mn=`date`
echo $mn
fi
CNT=`ps ax | grep -v grep | grep -c httpd`
echo $CNT
if [ $CNT -gt 99 ]
then
CNT=0
fi
if [ $CNT -le 5 ]
then
mn=`date`
echo $mn '- Restarting HTTPD...'
/etc/init.d/httpd restart
fi

--------------------------------------------------
A root cron job launch it every minute.
the log is put in /var/log/httpd/ (automatic log rotation)

/etc/httpd/httpdwatch>>/var/log/httpd/watch_log

To test it, just stop the httpd server either through SSH ( /etc/init.d/httpd stop ) or through the control panel.

The next minute, it should be back, and the event should be properly recorded in the log.

Hope this helps ...
 
Back
Top