3

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.

samuelkobe
  • 546
  • 4
  • 16

2 Answers2

1

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.

Julian Hille
  • 669
  • 5
  • 11
0

I don't know if this is the proper solution, but it worked for me after I commented the line:

listen 80;

in /etc/nginx/sites-enabled/default

Ghar
  • 625
  • 1
  • 7
  • 19