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 failed to restart
-
- Posts: 11
- Joined: Wed May 25, 2016 4:29 pm
nginx failed to restart
Hi,
Im getting a bunch of emails every day at the same time with the following:
Could someone please let me know how I could fix this?
Im getting a bunch of emails every day at the same time with the following:
Code: Select all
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Stopping nginx: [FAILED]
Starting nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 127.0.0.1:8084 failed (98: Address already in use)
nginx: [emerg] bind() to (*myip*):443 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 127.0.0.1:8084 failed (98: Address already in use)
nginx: [emerg] bind() to (*myip*):443 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 127.0.0.1:8084 failed (98: Address already in use)
nginx: [emerg] bind() to (*myip*):443 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 127.0.0.1:8084 failed (98: Address already in use)
nginx: [emerg] bind() to (*myip*):443 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 127.0.0.1:8084 failed (98: Address already in use)
nginx: [emerg] bind() to (*myip*):443 failed (98: Address already in use)
nginx: [emerg] still could not bind()
[FAILED]
Could someone please let me know how I could fix this?
Re: nginx failed to restart
Begin with something like this:
PS: OS? VestaCP version?
Code: Select all
service apache2 stop
service nginx stop
killall apache2
killall nginx
service nginx start
service apache2 start
-
- Posts: 11
- Joined: Wed May 25, 2016 4:29 pm
Re: nginx failed to restart
Hi,
Thanks for the fast reply.
All commands involving apache2 aren't working (apache2: unrecognised service)
OS: CentOS 6.6
Vesta Ver: 0.9.8-16
Thanks for the fast reply.
All commands involving apache2 aren't working (apache2: unrecognised service)
OS: CentOS 6.6
Vesta Ver: 0.9.8-16
-
- Posts: 11
- Joined: Wed May 25, 2016 4:29 pm
Re: nginx failed to restart
When I do: service httpd restart
I see:
I see:
Code: Select all
Starting httpd: [Wed Jun 29 14:35:21 2016] [warn] The Alias directive in /etc/ht
tpd/conf/httpd.conf at line 257 will probably never match because it overlaps an
earlier Alias.
Re: nginx failed to restart
apache2 in CentOS has different name - httpdrohanmcdermott wrote:All commands involving apache2 aren't working (apache2: unrecognised service)
Re: nginx failed to restart
Try to Rebuild Web first.rohanmcdermott wrote:When I do: service httpd restartCode: Select all
Starting httpd: [Wed Jun 29 14:35:21 2016] [warn] The Alias directive in /etc/ht tpd/conf/httpd.conf at line 257 will probably never match because it overlaps an earlier Alias.
Re: nginx failed to restart
I'm having a very similar problem. When I stop nginx with "service nginx stop" there aren't any error messages, but nginx continues to run. When I try to restart nginx with "service nginx restart" I get the following:
The output for "systemctl status nginx.service" is:
Here are the nginx processes that are running:
If I kill the nginx processes with the following code and then restart nginx it works without any problems.
However, the next time my server is rebooted I have the same exact issue with nginx failing to restart. Any ideas what could be going on? I've searched all over the web and I'm completely stumped.
Code: Select all
root@host:~#
Job for nginx.service failed. See "systemctl status nginx.service" and "journalctl -xe" for details.
Code: Select all
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2016-07-08 14:26:57 CDT; 34s ago
Process: 3002 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Process: 2999 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Jul 08 14:26:56 host nginx[3002]: nginx: [emerg] bind() to {MYIP}:80 failed (98: Address already in use)
Jul 08 14:26:56 host nginx[3002]: nginx: [emerg] bind() to 127.0.0.1:8084 failed (98: Address already in use)
Jul 08 14:26:56 host nginx[3002]: nginx: [emerg] bind() to {MYIP}:80 failed (98: Address already in use)
Jul 08 14:26:57 host nginx[3002]: nginx: [emerg] bind() to 127.0.0.1:8084 failed (98: Address already in use)
Jul 08 14:26:57 host nginx[3002]: nginx: [emerg] bind() to {MYIP}:80 failed (98: Address already in use)
Jul 08 14:26:57 host nginx[3002]: nginx: [emerg] still could not bind()
Jul 08 14:26:57 host systemd[1]: nginx.service: control process exited, code=exited status=1
Jul 08 14:26:57 host systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Jul 08 14:26:57 host systemd[1]: Unit nginx.service entered failed state.
Jul 08 14:26:57 host systemd[1]: nginx.service failed.
Code: Select all
ps -ef | grep nginx
root 405 1 0 14:16 ? 00:00:00 nginx: master process /usr/sbin/nginx
www-data 408 405 0 14:16 ? 00:00:00 nginx: worker process
www-data 409 405 0 14:16 ? 00:00:00 nginx: worker process
www-data 410 405 0 14:16 ? 00:00:00 nginx: cache manager process
root 785 1 0 14:16 ? 00:00:00 nginx: master process /usr/local/vesta/nginx/sbin/vesta-nginx
admin 791 785 0 14:16 ? 00:00:00 nginx: worker process
root 3231 2120 0 14:30 pts/0 00:00:00 grep nginx
Code: Select all
pkill nginx && service nginx restart && service vesta restart
Re: nginx failed to restart
I should've mentioned that I'm running the Nginx + PHP-FPM configuration. Apache is not installed and I double-checked that there's no apache2.service or httpd.service. When the system starts up it's Nginx that's bound to port 80, I'm just unable to control the instance with the service or systemctl commands.
-
- Posts: 1
- Joined: Mon Jul 18, 2016 9:01 am
Re: nginx failed to restart
Is there any solution?rohanmcdermott wrote:Hi,
Im getting a bunch of emails every day at the same time with the following:
Code: Select all
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful Stopping nginx: [FAILED] Starting nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to 127.0.0.1:8084 failed (98: Address already in use) nginx: [emerg] bind() to (*myip*):443 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 127.0.0.1:8084 failed (98: Address already in use) nginx: [emerg] bind() to (*myip*):443 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 127.0.0.1:8084 failed (98: Address already in use) nginx: [emerg] bind() to (*myip*):443 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 127.0.0.1:8084 failed (98: Address already in use) nginx: [emerg] bind() to (*myip*):443 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 127.0.0.1:8084 failed (98: Address already in use) nginx: [emerg] bind() to (*myip*):443 failed (98: Address already in use) nginx: [emerg] still could not bind() [FAILED]
Could someone please let me know how I could fix this?
Last edited by radardotnet424 on Thu Apr 20, 2017 3:48 pm, edited 4 times in total.
Re: nginx failed to restart
I still haven't been able to figure it out. I'm starting to think my only recourse is to start over from scratch.