如何检测和重启Apache和Lighttpd
2007-03-04 00:00:00 来源:WEB开发网Personally I always install and configure monit on all boxes which are under my control.
Install monit under Debian or Ubuntu LinuxUse apt-get command to install monit
# apt-get install monitOR$ sudo apt-get install monit
Install monit under Red Hat enterprise Linux (source code installation)Many distributions include monit. However monit is not included in official Red hat enterprise Linux. Just download monit source code from official web site using wget command:
# cd /opt
# wget http://www.tildeslash.com/monit/dist/monit-4.8.2.tar.gz
Untar monit
# tar -zcvf monit-4.8.2.tar.gz
# cd monit-4.8.2
Configure and compile monit:# ./configure
# make
Install monit
# make install
Copy monit configuration file:# cp monitrc /etc/monitrc
By default monit is located at /usr/local/bin/monit
How do I Configure monit?monitrc is name of monit configuration file and it is by default located at /etc/monitrc location. However each distribution places file in different location: .
=> Source code installation : /etc/monitrc
=> Debian / Unentu Linux installation : /etc/monit/monitrc
Open monit configuration file and setup values as follows:
# vi /etc/monitrc
a) Run it as daemon and check the services (such as web, mysql, sshd) at 2-minute
intervals.
set daemon 120
更多精彩
赞助商链接