首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Vestacp服务已停止

Vestacp服务已停止
EN

Stack Overflow用户
提问于 2015-12-13 07:38:32
回答 1查看 2.2K关注 0票数 0

我的服务器上有VestaCp和nginx,我想在服务停止时重新启动它。

例如,有时nginx会停止并需要重新启动manually.So,此时我的网站无法访问。

EN

回答 1

Stack Overflow用户

发布于 2016-01-29 05:46:28

我推荐Monit软件。它是免费的,你可以在互联网上找到很多例子。

Idk如果Centos在yum install monit上有这个包,它肯定在Debian repos上。

在web服务器内部运行的web服务的基本监视器应在所需端口使用http检查,即80 front nginx或8080 apache2 reverse_proxy。

git examples上的示例

代码语言:javascript
复制
# nginx
check process nginx with pidfile /opt/nginx/logs/nginx.pid
start program = "/etc/init.d/nginx start"
stop  program = "/etc/init.d/nginx stop"
if failed host 127.0.0.1 port 80 then restart
if cpu is greater than 40% for 2 cycles then alert
if cpu > 60% for 5 cycles then restart 
if 10 restarts within 10 cycles then timeout

nginx和alert的最低配置:

代码语言:javascript
复制
# email alerts
set mailserver localhost
set mail-format { from: monit@localhost OR you@your-domain.com }
set alert your-email@your-domain.com
# nginx
check process nginx with pidfile /opt/nginx/logs/nginx.pid
start program = "/etc/init.d/nginx start"
stop  program = "/etc/init.d/nginx stop"
if failed host 127.0.0.1 port 80 then restart
if failed host 127.0.0.1 port 80 then alert

它的作用是不言而喻的。

通常,您应该为您监视的每个服务放置单独的文件,并保持它们的整洁。此外,示例服务是提供者,您只需将它们放在正确的文件夹中即可启用它们。

that link上有一个包含快速示例的很好的文档

我使用它,它真的很酷。如你所见,你可以运行许多程序,以避免任何事件触发器。你可以观看pids,港口和许多其他的东西。

你可以询问nginx,当然你也可以在vesta服务上观看。Vesta管理面板在另一个nginx进程中运行,该进程不是由安装的nginx服务处理的,因为这个进程用于主机上的nginx代理。

因此,这里有2个nginx进程,您将同时看到8083和80 (以及ssl的443 )

我在过去通过pid监控apache2时遇到了一些问题,所以http检查更好。如果listen正在运行。

祝你好运。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34246299

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档