WEB开发网
开发学院服务器WEB服务器Apache 如何检测和重启Apache和Lighttpd 阅读

如何检测和重启Apache和Lighttpd

 2007-03-04 00:00:00 来源:WEB开发网   
核心提示: b) Set syslog logging with the ‘daemon’ facility:set logfile syslog facility log_daemonc) Set mail server name to send email alertset ma

b) Set syslog logging with the ‘daemon’ facility:

set logfile syslog facility log_daemon

c) Set mail server name to send email alert

set mailserver mail.cyberciti.biz

Set email format such as from email

set mail-format { from: alert@nixcraft.in

subject: $SERVICE $EVENT at $DATE

message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION.

}

d) Now most important part, restart lighttpd or apache web server if failed or killed by Linux kernel due to any causes:

check process lighttpd with pidfile /var/run/lighttpd.pid

group lighttpd

start program = "/etc/init.d/lighttpd start"

stop program = "/etc/init.d/lighttpd stop"

if failed host 75.126.43.232 port 80

protocol http then restart

if 5 restarts within 5 cycles then timeout

Where,

  • check process lighttpd with pidfile /var/run/lighttpd.pid : You are specifying lighttpd pid file and daemon name
  • group lighttpd: Specify group name, which is allowed or used to start/restart lighttpd
  • start program = “/etc/init.d/lighttpd start” : Command to start lighttpd server
  • stop program = “/etc/init.d/lighttpd stop” : Command to stop lighttpd server
  • if failed host 127.0.0.1 port 80 : Server IP address and port number (80)
  • protocol http then restart : If above IP and port failed restart the webserver
  • if 5 restarts within 5 cycles then timeout : Try to restart 5 times; if monit cannot restart webserver 5 times; just time out to avoid race condition.
  • Here is my mysql server restart configuration directives:

    上一页  1 2 3 4  下一页

    Tags:如何 检测 重启

    编辑录入:爽爽 [复制链接] [打 印]
    赞助商链接