Results 1 to 6 of 6

Thread: [emerg] bind() to [::]:80 failed

  1. #1
    Join Date
    Feb 2009
    Location
    Canada
    Beans
    38
    Distro
    Ubuntu 12.10 Quantal Quetzal

    [emerg] bind() to [::]:80 failed

    I think this might likely have been answered before, but I just made a fresh install of Ubuntu and attempted to install nginx. When I attempt to run sudo service nginx default, I get this.

    Code:
    username@ilose-ubuntu:/etc/nginx$ sudo service nginx start
     * 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()
    Was wondering if you guys might know why it's doing it and how I can get nginx (more specifically, LEMP) up and running on my local machine.
    MyBB for Ubuntu Forums, LGPL + GPL would never go better.

  2. #2
    Join Date
    Jan 2012
    Beans
    6

    Re: [emerg] bind() to [::]:80 failed

    If this is a fresh install, you probably have Apache installed by default.

    Code:
    sudo netstat -nltup | grep :80
    Please post the output of the command above, it will let you know which service is listening to this port. Feel free to kill or uninstall it if it's not necessary, or bind Nginx to a different port.

  3. #3
    Join Date
    Feb 2009
    Location
    Canada
    Beans
    38
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: [emerg] bind() to [::]:80 failed

    Quote Originally Posted by Pimentel View Post
    If this is a fresh install, you probably have Apache installed by default.

    Code:
    sudo netstat -nltup | grep :80
    Please post the output of the command above, it will let you know which service is listening to this port. Feel free to kill or uninstall it if it's not necessary, or bind Nginx to a different port.
    Code:
    username@ilose-ubuntu:~$ sudo netstat -nltup | grep :80
    username@ilose-ubuntu:~$
    There is no output. I was pretty sure I uninstalled apache2 if it was there. When I try to start apache or apache2, it's an "unrecognized service."

    Code:
    username@ilose-ubuntu:~$ sudo service apache2 start
    apache2: unrecognized service
    username@ilose-ubuntu:~$ sudo service apache start
    apache: unrecognized service
    username@ilose-ubuntu:~$
    MyBB for Ubuntu Forums, LGPL + GPL would never go better.

  4. #4
    Join Date
    Jan 2012
    Beans
    6

    Re: [emerg] bind() to [::]:80 failed

    Any chance you have an IPv6 address associated to this setup? Try setting nginx to listen to the loopback interface only. In the vhost config file (presumably "/etc/nginx/sites-available/default"), replace the parameter inside the server block "listen 80;" or "listen [::]:80;" (whichever is uncommented) with "listen 127.0.0.1:80;".

    If this works and you still want to make it listen to external addresses as well, change it to "0.0.0.0:80".

    Otherwise, please post this file here.

  5. #5
    Join Date
    Feb 2009
    Location
    Canada
    Beans
    38
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: [emerg] bind() to [::]:80 failed

    I'll take a look into that when I get home tonight. I don't believe I have any ipv6 setups, and I'm only using nginx as a local test server.
    MyBB for Ubuntu Forums, LGPL + GPL would never go better.

  6. #6
    Join Date
    Feb 2009
    Location
    Canada
    Beans
    38
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: [emerg] bind() to [::]:80 failed

    So at the very top, I saw this.

    Code:
    	listen 80;
    	listen [::]:80 default_server;
    It was commenting the second line and replacing it with "listen 127.0.0.1:80". I can also view localhost without issue. Cheers!
    MyBB for Ubuntu Forums, LGPL + GPL would never go better.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •