Easily configure a performant, secure, and stable NGINX server.Learn More
Does anybody know for both domain & subdirectory at the same time how to set up monit?
I have already setup monit for main domain(code below) but I am stuck for the subdirectory.
check process nginx with pidfile /var/run/nginx.pid
start program = “/etc/init.d/nginx start”
stop program = “/etc/init.d/nginx stop”
if failed host example.com port 80 protocol http then restart
if 5 restarts within 5 cycles then timeout
check process mysql with pidfile /var/run/mysqld/mysqld.pid start program = "/etc/init.d/mysql start" stop program = "/etc/init.d/mysql stop" if failed unixsocket /var/run/mysqld/mysqld.sock then restart if 5 restarts within 5 cycles then timeout check process php7.0-fpm with pidfile /var/run/php7.0-fpm.pid start program = "/etc/init.d/php7.0-fpm start" stop program = "/etc/init.d/php7.0-fpm stop" if failed host example.com port 80 protocol http then restart if 5 restarts within 5 cycles then timeout
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×