Nginx config error after upgrade 16.04 LTS > 18.04 LTS, resize, and restart


#1

Hi, sorry if this is a basic question, and thanks for reading. And if this is not the right platform, please do not hesitate to let me know.

I currently have 2 instances (two subdomains) of Ghost 2.x running on Nginx on Ubuntu 16.04 LTS on a Linode VPS.

I am working on upgrading to Ubuntu 18.04 LTS but ran into some upgrade difficulties. Steps:

  1. Everything working fine on Ubuntu 16.04 LTS.
  2. Ran the following to upgrade:
    do-release-upgrade
  3. System upgraded & rebooted successfully to Ubuntu 18.03 LTS. Websites accessible, everything works.
  4. Shut down & resize my VPS to add 3 GB storage. After reboot, Nginx server refuses to restart using command:
    sudo service nginx restart
    Based on the error received, it seemed like the issue was with my Nginx config files.

Has any one had this sort of an error? I.e., 2 Ghost sites on 1 VPS running fine on Ubuntu 16.04 LTS but then Nginx config problems in 18.04 LTS?

Also, in general, would the community suggest that it is smarter to upgrade, like I have been trying, or to reinstall on a fresh 18.04 LTS image?

Also, one last question, I know based on Ghost’s documentation that DigitalOcean is the preferred provider, while Linode is one of the latter bullet points on the list. Is DigitalOcean that much better that you would recommend a non-DigitalOcean customer to consider switching? If so, why? I would love to hear your thoughts.

I know I can post on StackOverflow etc., but I thought I would start here. First time posting to the Ghost community.

Thanks everyone, and hello!


#2

@Hal please provide more “debug” information from Nginx output so we can help you to figure out what’s going on here. I’ve my Ghost installs running on the latest Ubuntu without any issue.


#3

DO is recommended more because of the 1-click image which was developed by the ghost team and the fact that Ghost Pro runs on DO. If you don’t want to go through the hassle of setting up a brand new system, DO is way easier. Otherwise, any VPS which runs the recommended stack is 100% suitable. I personally run 3 instances (and a bunch of other stuff) on a $10 Linode VPS with no issues and plenty of resources to spare.

With regards the the upgrade, the nginx config should be valid, you might have run into an issue when nginx updated. As @Tony said, it’s not really possible to debug without the nginx error log :slight_smile:


#4

@Tony, thank you - sorry for forgetting to add my error.

Here’s the error message. I received several of these each time I tried to boot up my web server sudo service nginx start:
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)

The best fix I could find was as follows:

After adding ipv6only=on to various config blocks, these errors started to go away, but I gave up before completely resolving the issue because I didn’t feel comfortable continuing. I needed my site back up, so I reverted to an earlier backup. This is my first web server, so I don’t have a lot of experience to fall back on even though I’m trying to learn & get better. And, I was also confused/concerned that the config files that I have been using for 3+ months successfully in 16.04 LTS all of a sudden were failing in 18.04 LTS; it suggested to be something else might be happening, and I better start again and rethink my steps here.

Any thoughts would be much appreciated. More than willing to share more details as helpful; thank you @Tony for your response so far!


#5

Thank you, @vikaspotluri123! I appreciate hearing your views and experiences on this. :slight_smile:


#6

Adding that is totally fine and is a required “syntax” on newer versions of Nginx so far, my blocks actually look like that (just ignore the default_server portion as there must be only ONE block with default_server flag on your list).

Here is more “technical” information about it: https://chrisjean.com/fix-nginx-emerg-bind-to-80-failed-98-address-already-in-use/


#7

Thank you, @Tony


#8

Something’s already bound to port 80 so nginx can’t bind to it

sudo netstat -tulnp | grep 80 will give you the binary that’s bound to port 80


#9

Thank you! Makes sense.

What is still confusing - why am I not getting this error right now? I am running the exact same Nginx config files in 16.04 LTS that errored out in 18.04 LTS.


#10

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.