Fix Nginx Error: [emerg] still could not bind()

nginx

Solve Nginx Problem: [emerg] bind() to 0.0.0.0:80 failed (Address already in use) – Just tried another budget VPS server to play around with and as a place for me to learn. Then trying to reinstall Tuxlite LNMP Stack but then getting following error log:

[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()
nginx.

That also happens when I try to restart nginx. Done some browsing here and there then I figured it out that this such of problem occurs because there is already a service taking place of given ports which is obviously Apache. So the fix is easy. Simply stop Apache then restart Nginx.

Step 1. Type following command to stop Apache service (don’t forget to add sude if you are not in root)

/etc/init.d/apache2 stop

Step 2. Now restart Nginx using this comand:

/etc/init.d/nginx restart

In case on using Tuxlite LNMP stack, you should do this step before adding new domain name (or if you read this guide, do that before step 9).

Subscribe

Thanks for reading articles on PressByte.com. You can get updates quicker via email. Subscribe freely below.

No Responses

Leave a Reply

FaST Cloud SSD Hosting