Page 1 of 1

nginx: [emerg] bind() to 0.0.0.0:80 failed

Posted: Fri Jan 17, 2014 7:19 pm
by heihachi88
When i am trying to do:

Code: Select all

service vesta restart
I am getting this error:

Stopping vesta-nginx: [FAILED]
Stopping vesta-php: [FAILED]
Starting vesta-nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
[FAILED]

What's wrong is there?

Re: nginx: [emerg] bind() to 0.0.0.0:80 failed

Posted: Fri Jan 17, 2014 7:30 pm
by jarland
Sounds like nginx is stuck. Try "service nginx stop" first, or "ps faux | grep nginx" to see if an instance is still running that won't die. Maybe throw a kill -9 at the PID as a worst case scenario...I only say that because I like to live life on the edge ;)

Re: nginx: [emerg] bind() to 0.0.0.0:80 failed

Posted: Fri Jan 17, 2014 7:35 pm
by heihachi88
jarland wrote:Sounds like nginx is stuck. Try "service nginx stop" first, or "ps faux | grep nginx" to see if an instance is still running that won't die. Maybe throw a kill -9 at the PID as a worst case scenario...I only say that because I like to live life on the edge ;)

Code: Select all

[root@server conf.d]# ps faux | grep nginx
root      1852  0.0  0.0 103244   828 pts/0    S+   14:34   0:00          \_ grep nginx
root      1625  0.0  0.0  66224  1304 ?        Ss   14:29   0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx     1626  0.0  0.0  66368  2572 ?        S    14:29   0:00  \_ nginx: worker process
nginx     1627  0.0  0.0  66228  1844 ?        S    14:29   0:00  \_ nginx: worker process
nginx     1628  0.0  0.0  66228  1656 ?        S    14:29   0:00  \_ nginx: cache manager process
So what to kill here?

service nginx stop worked well and start either.

when i access https://IP:8083/ it says page not found lol. But when i open any domain name on port 80 it works. What's going on here :D

Re: nginx: [emerg] bind() to 0.0.0.0:80 failed

Posted: Fri Jan 17, 2014 7:37 pm
by jarland
kill 1625

If you're adventurous like me, kill -9 1625

Re: nginx: [emerg] bind() to 0.0.0.0:80 failed

Posted: Fri Jan 17, 2014 7:42 pm
by heihachi88
jarland wrote:kill 1625

If you're adventurous like me, kill -9 1625
Killed, now i cannot see it in ps faux | grep nginx

But i still can't open my vesta panel page not found geez. What might be causing this?

Re: nginx: [emerg] bind() to 0.0.0.0:80 failed

Posted: Fri Jan 17, 2014 7:44 pm
by jarland
Hmm. Did you try a "service vesta restart" again? My first thought is the failed restart attempt killed apache but failed to start things back up again because it couldn't kill nginx. With nginx dead now everything should start up again at command.

Maybe add in "service apache2 restart" or "service httpd restart"

Re: nginx: [emerg] bind() to 0.0.0.0:80 failed

Posted: Fri Jan 17, 2014 7:46 pm
by heihachi88
jarland wrote:Hmm. Did you try a "service vesta restart" again? My first thought is the failed restart attempt killed apache but failed to start things back up again because it couldn't kill nginx. With nginx dead now everything should start up again at command.

Maybe add in "service apache2 restart" or "service httpd restart"
Oh, thanks i rebooted my vps, and now service vesta restart works without errros!