Bc31585964b194d87240decf088c2b6ca5cd46e5
By:
menjilx

Active: failed (Result: exit-code) since Tue 2018-03-20 12:25:17 UTC; 11s ago

March 20, 2018 161 views
Nginx Ubuntu 16.04
sudo systemctl status nginx.service
● 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 Tue 2018-03-20 12:36:44 UTC; 3min 24s ago
  Process: 27569 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
  Process: 27565 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)

Mar 20 12:36:43 toyina nginx[27569]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
Mar 20 12:36:43 toyina nginx[27569]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
Mar 20 12:36:43 toyina nginx[27569]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
Mar 20 12:36:43 toyina nginx[27569]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
Mar 20 12:36:44 toyina nginx[27569]: nginx: [emerg] still could not bind()
Mar 20 12:36:44 toyina systemd[1]: nginx.service: Control process exited, code=exited status=1
Mar 20 12:36:44 toyina systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Mar 20 12:36:44 toyina systemd[1]: nginx.service: Unit entered failed state.
Mar 20 12:36:44 toyina systemd[1]: nginx.service: Failed with result 'exit-code'.
Mar 20 12:39:11 toyina systemd[1]: nginx.service: Unit cannot be reloaded because it is inactive.

Hi anyone would like to help me with this error?

I tried to install an SSL (Lets Encrypt) from this tutorial but after several steps I received this error. I hope someone can point me out on how to solve this.

Thanks!

1 Answer

Hi,

 listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)

Nginx is unable to bind to port 80 because another process is already using it. Find out what it is using this command:

sudo netstat -plutn | grep :80

It could be an nginx process that didn't exit gracefully and is still holding the port.

Have another answer? Share your knowledge.