Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/404.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Nginx 机场核心计划服务已停止_Nginx_Service_Restart - Fatal编程技术网

Nginx 机场核心计划服务已停止

Nginx 机场核心计划服务已停止,nginx,service,restart,Nginx,Service,Restart,我的服务器上有VestaCp和nginx,希望在服务停止时重新启动服务 例如,有时nginx停止并需要手动重新启动。因此,此时无法访问我的网站。我有Centos 7.1。我建议使用Monit软件。它是免费的,你可以在网上找到很多例子 Idk如果Centos在yum install monit上有该软件包,请确保它位于Debian repos上 在web服务器内部运行的web服务的基本监视器应在所需端口使用http检查,即80Front nginx或8080Apache2 reverse_prox

我的服务器上有VestaCp和nginx,希望在服务停止时重新启动服务


例如,有时nginx停止并需要手动重新启动。因此,此时无法访问我的网站。我有Centos 7.1。

我建议使用Monit软件。它是免费的,你可以在网上找到很多例子

Idk如果Centos在
yum install monit
上有该软件包,请确保它位于Debian repos上

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

例如:

最小nginx和警报配置:

# 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
它的作用不言而喻

通常,您应该为您监视的每个服务放置单独的文件,并保持它们干净。另外,示例服务提供程序,您可以启用它们,只需将它们放在正确的文件夹中即可

一个很好的文档和快速示例位于

我用它,它真的很酷。如您所见,在almos事件触发的情况下,您可以运行许多程序。您可以观看PID、端口和许多其他内容

你问起nginx,当然你也可以在维斯塔服务中心观看。Vesta管理面板运行在另一个nginx进程中,该进程不由安装的nginx服务处理,因为此进程用于托管nginx代理

因此,有两个nginx进程,您将同时观看,8083和80(以及443用于ssl)

我在过去通过pid监控apache2时遇到了一些问题,所以http检查更好。如果你听的是跑步


祝你好运。

请提供迄今为止的任何方法。
# 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