Fix Nginx Failed But Site Still Working and Fails to Stop Nginx

Fix Nginx Failed But Site Still Working and Fails to Stop Nginx -  🏴󠁧󠁢󠁥󠁮󠁧󠁿For some reason maybe you see your nginx failed but this site is still working, why? and when you try to stop or restart it you can't do this. For fix your problem I will recommend stopping nginx by killing its master process first. The nginx is not shutdown properly may be because of that it can't be stopped using init script.

🇮🇩 Untuk beberapa alasan mungkin kita akan menemui error seperti nginx failed tetapi situs website kita tetap bisa diakses/berjalan normal. Mungkin kita bertanya ini kenapa terjadi? dan juga ketika kita akan stop nginx atau restart kita juga mengalami error tidak bisa stop muncul error : Job for nginx.service failed. See "systemctl status nginx.service" and "journalctl -xe" for details. Hal ini terjadi karena proses nginx masih berjalan di sistem dan kita perlu memaksanya untuk berhenti terlebih dahulu dengan cara meng kill prosesnya) Berikut ini adalah caranya:

Fix Nginx Failed But Site Still Working and Fails to Stop Nginx


Type this script in terminal (maybe you need sudo)

ps -ef |grep nginx

 

This will show you the PID of nginx master process. Like you mentioned above:

root 19506 1 0 2013 ? 00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf


Kill it using (make sure you kill all nginx process)


kill -9 19506


Verify once again whether there is any nginx process running or port 80 is occupied. If you see any process is bound to port 80, Identify the PID and check if it can be killed.


make sure the filesystem is fine and you can read/write to /var file system. Then Start nginx


service nginx start


Now nginx start normally. 


Nah begitulah cara fix nginx failed yg tidak bisa di restart/stop semoga bermanfaat!


Posting Komentar

0 Komentar