Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


nginx failed to start after apt-get upgrade
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

nginx failed to start after apt-get upgrade

fresher_06fresher_06 Member
edited February 2013 in Tutorials

Recently if did an apt-get update and apt-get upgrade on my debian 6 VPS and after that the nginx started showing the below error

/etc/init.d/nginx restart

Restarting nginx: nginxnginx: [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)
>
it happens because if the new version of Nginx as 1.2.7

but i got the solution at http://www.ambidev.com/nginx-update-failed-on-debian/

Comments

  • @fresher_06 said: apt-get upgrade

    @fresher_06 said: debian 6

    @fresher_06 said: Nginx as 1.2.7

    I beg your pardon?

  • I have a suspicion that it's trying to bind to port 80, but something is already listening on that port. netstat -lnp should tell you what it is.

  • seriesnseriesn Member
    edited February 2013

    @fresher_06
    Openup your vhost config and replace the line that has something like,

    listen [::]:80

    with

    listen [::]:80 default ipv6only=on;

    This is required for ipv6 networking. Otherwise, simply comment out that line.
    After that restart your nginx server. :)

  • edit

    /etc/nginx/sites-enabled/default

    change

    listen [::]:80 default_server;

    to

    #listen [::]:80 default_server;
  • murkymurky Member
    edited February 2013

    Why are people providing solutions? OP already did that. This is in the tutorial section.

  • @murky What I provided is a solution, what op posted is just a temp fix :)

  • Oh... Didn't realize.

  • as mentioned in the link .. i just renamed /etc/nginx/sites-available/default to default.old and it works .. also @NickM .. neither . netstat -antp , lsof -i , fuser -n tcp 80 , ps -ef | grep nginx , ps -ef | grep httpd gave me any sign that port 80 was bound by some other instance .. anyways . thanks a lot for everybody input ..

  • @fresher_06 said: as mentioned in the link .. i just renamed /etc/nginx/sites-available/default to default.old and it works

    But the next nginx upgrade will probably drop another default file in there and the same thing will happen again.

    Why not just remove the symlink at /etc/nginx/sites-enabled/default?

  • perennateperennate Member, Host Rep

    @sleddog said: Why not just remove the symlink at /etc/nginx/sites-enabled/default?

    aka a2dissite default.

Sign In or Register to comment.