Search code examples
nginxubuntu-10.04railscastslinode

Setting up Linode (Ubuntu 10.04 32bit) nginx not starting. 98: address already in use


Hello having a little issue with setting up linode via Railscast instructions of Ep. #335

My Configuration for this server is: Ubuntu 10.04 LTS Disk Image 32bit

I can get this far:

Running both of these work as expected.

apt-get -y update

apt-get -y install curl git-core python-software-properties

When I get to the nginx steps:

add-apt-repository ppa:nginx/stable

apt-get -y update

apt-get -y install nginx

Up to this point all seems to be working properly.

It is here:service nginx start

that I get the following in response:

 * 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()

I have tried stopping, restarting and reloading nginx but I cannot get anything to change. Any suggestions would be greatly appreciated. Thanks in advance.


Solution

  • It seems like you have something else running or blocking that port. try running: sudo netstat -pan | grep ":80"

    which should give you a hint on what is running on there. Maybe its a uwsgi/apache2/tomcat etc. Could be a lot running there.

    EDIT:

    i now know whats the problem as i had it myself now on a debian server.

    listen   80; ## listen for ipv4
    listen   [::]:80 default ipv6only=on; ## listen for ipv6
    

    You should comment the first or the second line (depends on if you want to listen of ipv6 or ipv4. That was the problem i had.