Debianでapache2落ちたら再起動

$ sudo apt-get install monit
Starting daemon monitor: monit won't be started/stopped
unless it it's configured
please configure monit and then edit /etc/default/monit
and set the "startup" variable to 1 in order to allow
monit to start

Debianでは/etc/default/monitを編集しないと起動しないみたい。

$ sudo vi /etc/monit/monitrc
set daemon 120
set logfile syslog facility log_daemon
set mailserver localhost
set mail-format { from: monit@kmsebisu.com }
set alert dev@actindi.net
check process apache with pidfile /var/run/apache2.pid
start program = "/etc/init.d/apache2 start"
stop program = "/etc/init.d/apache2 stop"
if failed host localhost port 80
protocol HTTP request / then restart
group www-data

便利だわぁ。こんな簡単なら早く使えばよかった・・・。

Comments


Option