I have an Ubuntu 22.04 server which Nginx is installed on that. At the first time I configured Nginx and everything was OK and it started successfully without any errors. After sometime, I wanted to test my web application but the server didn't respond. I checked the server and saw that Nginx has been deactivated, so I checked the logs and realized that cPanel web server (httpd) has taken port 80, so Nginx was not able to run correctly and its process was killed. A this moment I thought cPanel and (httpd) are causing the Nginx to fail, so I killed their processes and removed them from server. After sometime the problem happened again for Nginx. (So I ensured there was nothing wrong with cPanel and httpd). I searched a lot and checked Nginx logs (/var/log/error.log and /var/log/access.log) but there was nothing helpful in there. Finally I checked journalctl logs using sudo journalctl -u nginx -e
command and I found something wired:journalctl-logs
If you look at the screenshot taken from sudo journalctl -u nginx -e
logs, you'll see that Nginx service is being stopped and started over and over and between these multiple stops and starts, sometime Nginx can't be restarted so it shuts down. If you have any experience or ideas please help :)
↧
Nginx is deactivated and started automatically on Ubuntu server
↧