We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
Nginx fails to start after reboot
Nginx fails to start after reboot
Clean install of Vesta, nginx + php-fpm version. When I reboot the server nginx doesn't start getting the below in the nginx log. If I press the start button in the vesta control panel nginx then starts.
Been no IP adress changes as its a clean server.
OS CentOS 7.2
Thanks
Code: Select all
2016/01/11 10:16:14 [emerg] 109#0: bind() to 111.111.111.111:80 failed (99: Cannot assign requested address)
2016/01/11 10:20:45 [emerg] 130#0: bind() to 111.111.111.111:80 failed (99: Cannot assign requested address)
2016/01/11 10:25:08 [emerg] 130#0: bind() to 111.111.111.111:80 failed (99: Cannot assign requested address)
2016/01/11 15:30:48 [emerg] 118#0: bind() to 111.111.111.111:80 failed (99: Cannot assign requested address)
OS CentOS 7.2
Thanks
-
- Posts: 139
- Joined: Thu Jan 07, 2016 12:01 am
Re: Nginx fails to start after reboot
Mind you, this was written for httpd and not nginx, however, the principle is still the same. Nginx can't start on port 80 because something is using it.I would use the "fuser" command to find out what is using ports 80 and 443, then proceed from there.
The return from fuser shows that processes with pids 2850 12763 15537 18030 30044 32226 are using port 80.Code: Select all
# fuser 80/tcp 80/tcp: 2850 12763 15537 18030 30044 32226
So, in this case it is httpd process listening on port 80. Look for children:Code: Select all
# ps aux | grep 2850 | grep -v grep root 2850 0.0 0.4 318772 30428 ? Ssl Oct22 0:03 /usr/sbin/httpd
So those are all instances of httpd.Code: Select all
# pgrep httpd 2850 12763 15537 18030 30044 32226
Re: Nginx fails to start after reboot
As @BBuchanan1013 said, something is using port 80.
If you used Ubuntu (14.04 up to date), there's some bug with the install because it will installa apache server as well, even if you did pick nginx+fpm. At least that's what happened with me. Might be because of some other package that vesta uses that have apache as dependency.
If you used Ubuntu (14.04 up to date), there's some bug with the install because it will installa apache server as well, even if you did pick nginx+fpm. At least that's what happened with me. Might be because of some other package that vesta uses that have apache as dependency.
Re: Nginx fails to start after reboot
Try the below code -
Or:
Code: Select all
# sudo update-rc.d nginx defaults
Code: Select all
# sudo apt-get install chkconfig
Code: Select all
# sudo chkconfig nginx on
Re: Nginx fails to start after reboot
chkconfig nginx on - This is already set as nginx is trying to start but not able to.
pgrep - Nothing else is running on the port 80 or 443. Seems to be an issue only on OpenVZ vps's any dedicated servers I have vesta on nginx starts ok.
Thanks
pgrep - Nothing else is running on the port 80 or 443. Seems to be an issue only on OpenVZ vps's any dedicated servers I have vesta on nginx starts ok.
Thanks
Re: Nginx fails to start after reboot
Hi I found this solutions on searching:
replace the first 4 lines:
It works on my 2 VPS. :)
Code: Select all
nano /usr/lib/systemd/system/nginx.service
Code: Select all
[Unit]
Description=Startup script for nginx service
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target