Question

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

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!


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.