Question

Job for nginx.service failed because the control process exited with error code.

Posted April 13, 2020 187 views
Nginx

After I installed SSL follow link:
https://www.vultr.com/docs/install-lets-encrypt-ssl-on-one-click-wordpress-app

root@havi_host:~# service nginx restart
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
root@havi_host:~#
root@havi_host:~# journalctl -xe
Apr 13 14:02:39 havi_host nginx[31567]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address alr
Apr 13 14:02:39 havi_host nginx[31567]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address alre
Apr 13 14:02:39 havi_host nginx[31567]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address alr
Apr 13 14:02:40 havi_host nginx[31567]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address alre
Apr 13 14:02:40 havi_host nginx[31567]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address alr
Apr 13 14:02:40 havi_host nginx[31567]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address alre
Apr 13 14:02:40 havi_host nginx[31567]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address alr
Apr 13 14:02:41 havi_host nginx[31567]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address alre
Apr 13 14:02:41 havi_host nginx[31567]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address alr
Apr 13 14:02:41 havi_host nginx[31567]: nginx: [emerg] still could not bind()
Apr 13 14:02:41 havi_host systemd[1]: nginx.service: Control process exited, code=exited status=1
Apr 13 14:02:41 havi_host systemd[1]: nginx.service: Failed with result 'exit-code'.
Apr 13 14:02:41 havi_host systemd[1]: Failed to start nginx - high performance web server.
root@havi_host:~# systemctl status nginx.service
● nginx.service - nginx - high performance web server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2020-04-13 14:02:41 UTC; 59s ago
     Docs: http://nginx.org/en/docs/
  Process: 31013 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS)
  Process: 31567 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)
 Main PID: 30921 (code=exited, status=0/SUCCESS)

Apr 13 14:02:40 havi_host nginx[31567]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address alre
Apr 13 14:02:40 havi_host nginx[31567]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address alr
Apr 13 14:02:40 havi_host nginx[31567]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address alre
Apr 13 14:02:40 havi_host nginx[31567]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address alr
Apr 13 14:02:41 havi_host nginx[31567]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address alre
Apr 13 14:02:41 havi_host nginx[31567]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address alr
Apr 13 14:02:41 havi_host nginx[31567]: nginx: [emerg] still could not bind()
Apr 13 14:02:41 havi_host systemd[1]: nginx.service: Control process exited, code=exited status=1
Apr 13 14:02:41 havi_host systemd[1]: nginx.service: Failed with result 'exit-code'.
Apr 13 14:02:41 havi_host systemd[1]: Failed to start nginx - high performance web server.
...skipping...
● nginx.service - nginx - high performance web server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2020-04-13 14:02:41 UTC; 59s ago
     Docs: http://nginx.org/en/docs/
  Process: 31013 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS)
  Process: 31567 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)
 Main PID: 30921 (code=exited, status=0/SUCCESS)
edited by MattIPv4

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hi @nguyenminhhanh101092,

Looking at the Error, it seems something else is already taking up the ports 80 and 443. You can check what that is by running the following command

netstat -tulpen | grep '80\|443'

Most probably you have something else installed that has default ports of 80 and 443. My guess would be apache however you’ll see as soon as you run the command.

Regards,
KDSys

Submit an Answer