All of a sudden I am getting the below nginx error
* Restarting nginx
* Stopping nginx nginx
...done.
* Starting nginx nginx
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
...done.
...done.
If I run
lsof -i :80 or sudo fuser -k 80/tcp
I get nothing. Nothing on port 80
Then I run the below:
sudo netstat -pan | grep ":80"
tcp 0 0 127.0.0.1:8070 0.0.0.0:* LISTEN 15056/uwsgi
tcp 0 0 10.170.35.97:39567 10.158.58.13:8080 TIME_WAIT -
tcp 0 0 10.170.35.97:39564 10.158.58.13:8080 TIME_WAIT -
tcp 0 0 10.170.35.97:39584 10.158.58.13:8080 TIME_WAIT -
tcp 0 0 10.170.35.97:39566 10.158.58.13:8080 TIME_WAIT -
tcp 0 0 10.170.35.97:39571 10.158.58.13:8080 TIME_WAIT -
tcp 0 0 10.170.35.97:39580 10.158.58.13:8080 TIME_WAIT -
tcp 0 0 10.170.35.97:39562 10.158.58.13:8080 TIME_WAIT -
tcp 0 0 10.170.35.97:39582 10.158.58.13:8080 TIME_WAIT -
tcp 0 0 10.170.35.97:39586 10.158.58.13:8080 TIME_WAIT -
tcp 0 0 10.170.35.97:39575 10.158.58.13:8080 TIME_WAIT -
tcp 0 0 10.170.35.97:39579 10.158.58.13:8080 TIME_WAIT -
tcp 0 0 10.170.35.97:39560 10.158.58.13:8080 TIME_WAIT -
tcp 0 0 10.170.35.97:39587 10.158.58.13:8080 TIME_WAIT -
tcp 0 0 10.170.35.97:39591 10.158.58.13:8080 TIME_WAIT -
tcp 0 0 10.170.35.97:39589 10.158.58.13:8080 TIME_WAIT -
I am stumped.
How to a debug?
I am using uwsgi with a
proxy pass on port 8070. uwsgi is running. Nginx is not. I am using ubuntu 12.4
Below are the relevant portions of my nginx conf file
upstream uwsgi_frontend {
server 127.0.0.1:8070;
}
server {
listen 80;
server_name 127.0.0.1;
location = /favicon.ico {
log_not_found off;
}
location / {
include uwsgi_params;
uwsgi_buffering off;
uwsgi_pass 127.0.0.1:8070;
}
}
Here is how I install nginx on ubuntu 12.04
nginx=stable;add-apt-repository ppa:nginx/$nginx;
apt-get update
apt get install nginx-full
I had the same problem in letsencrypt (certbot) and nginx,
ref: https://github.com/certbot/certbot/issues/5486
this error does not have a solution yet
so, a changed a cron for renew
(putting a reload after renew)(using suggest from certbot)logs (short):
In my case the one of the services either Apache or Apache2 or Nginx was already running and due to that I was not able to start the other service.
I was also getting the same error. nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) and when i typed the localhost in the browser, then i was getting
It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet. instead of nginx welcome page, apache2 is running on the same port,
find the apache2 ports.conf file
sudo /etc/apache2/ports.conf
change the port other then 80 , i make it as 70
save the file
restart your system
it will works for you also, if you type the localhost in the browser , you will get nginx welcome page
[::]:80
is a ipv6 address.This error can be caused if you have a nginx configuration that is listening on port 80 and also on port
[::]:80
.I had the following in my default sites-available file:
You can fix this by adding
ipv6only=on
to the[::]:80
like this:For more information, see:
http://forum.linode.com/viewtopic.php?t=8580
http://wiki.nginx.org/HttpCoreModule#listen
try to do this command
To follow on to @lfender6445 and @SAURABH answers --
My problem was also the fact that after upgrading to Vagrant 2.2.2 Apache2 was running as a web server when the guest booted. In the past I only had nginx as a web server.
vagrant ssh into the box and run the following command to disable Apache2 from starting up whenever the guest box boots:
Exit ssh, vagrant halt, vagrant up. Problem solved.