กล่าวถึง CWP7 ติดตามตรวจสอบปัญหาข้อผิดพลาด: การเชื่อมต่อ nginx faiนำในมอนิเตอร์
上เฉิน เว่ยเหลียง在แผงควบคุม CWP (CWP7) เพื่อติดตั้งการตรวจสอบ Monit软件时,แก้ไขกระบวนการตรวจสอบการเริ่มต้น Monit ที่หายไป monit.service ล้มเหลว
ตอนนี้ฉันมีปัญหาใหม่ - Monit การตรวจสอบการเชื่อมต่อ Nginx ล้มเหลว...
วิธีแก้ปัญหา nginx Connection ล้มเหลวใน monit?
วิธีการแก้ปัญหาการเชื่อมต่อ nginx ล้มเหลวในปัญหาข้อผิดพลาด 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
ปัญหาของ nginx Connection ล้มเหลวใน monit ได้รับการแก้ไขแล้ว!
หวัง Chen Weiliang บล็อก ( https://www.chenweiliang.com/ ) แชร์ "CWP7 แก้ปัญหาการเชื่อมต่อ nginx ล้มเหลวในข้อผิดพลาด monit" ซึ่งเป็นประโยชน์กับคุณ
ยินดีต้อนรับสู่การแบ่งปันลิงค์ของบทความนี้:https://www.chenweiliang.com/cwl-1423.html
ยินดีต้อนรับสู่ช่อง Telegram ของบล็อกของ Chen Weiliang เพื่อรับข่าวสารล่าสุด!
📚 คู่มือนี้มีคุณค่ามหาศาล 🌟 นี่เป็นโอกาสที่หายาก อย่าพลาด! ⏰⌛💨
แชร์และชอบถ้าคุณชอบ!
การแบ่งปันและไลค์ของคุณเป็นแรงจูงใจอย่างต่อเนื่องของเรา!