Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

Nginx fails to start after reboot

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
6 posts • Page 1 of 1
stevetoza
Posts: 12
Joined: Sun May 11, 2014 7:45 am

Nginx fails to start after reboot
  • Quote

Post by stevetoza » Mon Jan 11, 2016 3:43 pm

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.

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)
Been no IP adress changes as its a clean server.

OS CentOS 7.2

Thanks
Top

BBuchanan1013
Posts: 139
Joined: Thu Jan 07, 2016 12:01 am

Re: Nginx fails to start after reboot
  • Quote

Post by BBuchanan1013 » Sun Jan 17, 2016 12:14 am

I would use the "fuser" command to find out what is using ports 80 and 443, then proceed from there.

Code: Select all

#  fuser 80/tcp
80/tcp:               2850 12763 15537 18030 30044 32226
The return from fuser shows that processes with pids 2850 12763 15537 18030 30044 32226 are using port 80.

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, in this case it is httpd process listening on port 80. Look for children:

Code: Select all

 #  pgrep httpd
2850
12763
15537
18030
30044
32226
So those are all instances of httpd.
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.
Top

grenadecx
Posts: 17
Joined: Sat Jan 09, 2016 6:23 pm

Re: Nginx fails to start after reboot
  • Quote

Post by grenadecx » Mon Jan 18, 2016 9:11 am

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.
Top

Elizine
Posts: 50
Joined: Wed Aug 12, 2015 12:11 pm
Contact:
Contact Elizine
Website

Re: Nginx fails to start after reboot
  • Quote

Post by Elizine » Mon Jan 18, 2016 9:13 am

Try the below code -

Code: Select all

# sudo update-rc.d nginx defaults
Or:

Code: Select all

# sudo apt-get install chkconfig

Code: Select all

# sudo chkconfig nginx on
Top

stevetoza
Posts: 12
Joined: Sun May 11, 2014 7:45 am

Re: Nginx fails to start after reboot
  • Quote

Post by stevetoza » Mon Mar 07, 2016 3:43 pm

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
Top

lakis21
Posts: 15
Joined: Sun Dec 28, 2014 11:48 am
Contact:
Contact lakis21
Website

Os: CentOS 5x
Web: apache + nginx
Re: Nginx fails to start after reboot
  • Quote

Post by lakis21 » Fri May 06, 2016 6:22 pm

Hi I found this solutions on searching:

Code: Select all

nano /usr/lib/systemd/system/nginx.service
replace the first 4 lines:

Code: Select all

[Unit]
Description=Startup script for nginx service
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target
It works on my 2 VPS. :)
Top


Post Reply
  • Print view

6 posts • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

cron

Login  •  Register

I forgot my password