Skip to main content
edited body; edited tags
Source Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 264

Recently, Mymy blog always shutdown, it use centos6.2+apache2.2+mysql5.5+php5.3. I have raised MaxClients in httpd.conf, but less useful.

So is it possible to write a shell script (Run with crontab every 10 minutes), to read the httpd/error_log, if the last message preg_match sending a SIGTERM do restart apache automatically?

Recently, My blog always shutdown, it use centos6.2+apache2.2+mysql5.5+php5.3. I have raised MaxClients in httpd.conf, but less useful.

So is it possible to write a shell script (Run with crontab every 10 minutes), to read the httpd/error_log, if the last message preg_match sending a SIGTERM do restart apache automatically?

Recently, my blog always shutdown, it use centos6.2+apache2.2+mysql5.5+php5.3. I have raised MaxClients in httpd.conf, but less useful.

So is it possible to write a shell script (Run with crontab every 10 minutes), to read the httpd/error_log, if the last message preg_match sending a SIGTERM do restart apache automatically?

Thanks not necessary on SO/SX http://meta.stackoverflow.com/a/3021/186664
Source Link
Anthon
  • 81.4k
  • 42
  • 174
  • 228

Recently, My blog always shutdown, it use centos6.2+apache2.2+mysql5.5+php5.3. I have raised MaxClients in httpd.conf, but less useful. So

So is it possible to write a shell script (Run with crontab every 10 minutes), to read the httpd/error_log, if the last message preg_match sending a SIGTERM do restart apache automaticllyautomatically? I am not good at writing a shell script. Only some idea, I home someone could help me. Many thanks.

Recently, My blog always shutdown, it use centos6.2+apache2.2+mysql5.5+php5.3. I have raised MaxClients in httpd.conf, but less useful. So is it possible to write a shell script (Run with crontab every 10 minutes), to read the httpd/error_log, if the last message preg_match sending a SIGTERM do restart apache automaticlly? I am not good at writing a shell script. Only some idea, I home someone could help me. Many thanks.

Recently, My blog always shutdown, it use centos6.2+apache2.2+mysql5.5+php5.3. I have raised MaxClients in httpd.conf, but less useful.

So is it possible to write a shell script (Run with crontab every 10 minutes), to read the httpd/error_log, if the last message preg_match sending a SIGTERM do restart apache automatically?

Source Link
yuli chika
  • 399
  • 3
  • 5
  • 9

How to write a shell script restart apache if `server reached MaxClients`

Recently, My blog always shutdown, it use centos6.2+apache2.2+mysql5.5+php5.3. I have raised MaxClients in httpd.conf, but less useful. So is it possible to write a shell script (Run with crontab every 10 minutes), to read the httpd/error_log, if the last message preg_match sending a SIGTERM do restart apache automaticlly? I am not good at writing a shell script. Only some idea, I home someone could help me. Many thanks.