CWP7は、監視エラーでnginx接続が失敗する問題を解決します

CWP7 Monitの監視エラーのトラブルシューティング:監視中にnginxへの接続に失敗しました

CWP7は、監視エラーでnginx接続が失敗する問題を解決します

前回、Chen Weiliang氏がCWPコントロールパネル(CWP7)にMonit監視ソフトウェアをインストールした際、起動時にMonit監視プロセスが消えてしまう問題(monit.serviceが失敗)を解決しました。

今、私は新しい問題を抱えています-Nginx接続の監視に失敗しました...

monitで失敗したnginx接続を解決するには?

nginx Connection failed in monit エラーの問題を解決する方法:

まず、以下のコマンドにSSHで接続▼

ps -ef|grep nginx

nginx 構成ファイルが見つかりました。

[root@ten ~]# ps -ef|grep nginx
root 11550 1 0 02:12 ? 00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nobody 11551 11550 0 02:12 ? 00:00:04 nginx: worker process
nobody 11552 11550 0 02:12 ? 00:00:08 nginx: worker process
nobody 11553 11550 0 02:12 ? 00:00:02 nginx: worker process
nobody 11554 11550 0 02:12 ? 00:00:01 nginx: worker process
nobody 11555 11550 0 02:12 ? 00:00:00 nginx: cache manager process
root 19827 9820 0 02:37 pts/0 00:00:00 grep --color=auto nginx

nginxの設定ファイルを開きます。

/etc/nginx/nginx.conf

nginx.pid のパスの場所が見つかりました:

pid /var/run/nginx.pid;

Monit監視プログラムの設定ファイルに、nginxを監視するための以下の設定を入力します▼

check process nginx with pidfile /var/run/nginx.pid
start program "/usr/bin/systemctl start nginx.service"
stop program "/usr/bin/systemctl stop nginx.service"
if failed port 8181 protocol http then restart
if 4 restarts within 8 cycles then timeoutif 4 restarts within 8 cycles then timeout

Monit監視プログラムを再起動します▼

systemctl restart monit.service

Monitモニタリングプログラムのステータスを表示する▼

systemctl status monit.service

この手順に到達しても、エラー メッセージは引き続き表示されます。nginx Connection failed in monit

モニタリング nginx 設定のポート番号を「8181」または「80」に変更してみてください。

if failed port 8181 protocol http then restart
if failed port 80 protocol http then restart

次に、Monit監視プログラムを再起動します▼

systemctl restart monit.service

Monitモニタリングプログラムのステータスを表示する▼

systemctl status monit.service

monitでnginx接続が失敗する問題がついに解決されました!

Chen Weiliang氏のブログ(https://www.chenweiliang.com/ )に掲載されている記事「monitでnginxの接続エラーを解決する」が、皆様のお役に立てば幸いです。

この記事のリンクはご自由に共有してください:https://www.chenweiliang.com/cwl-1423.html

さらに多くの隠されたトリックのロックを解除するには、Telegram チャンネルにぜひご参加ください。

気に入ったらシェアして「いいね!」してください!あなたのシェアと「いいね!」が私たちの継続的なモチベーションです。

 

发表评论

すでに* を記入しておく必要があります。

上へスクロール