I have 5 servers total running through laravel forge, they all have the exact same setup.
All running Ubuntu 16.04.4 LTS.
After doing updates on Ubuntu running the exact same commands and applying the exact same updates (via sudo apt-get upgrade) with now all five servers being identical apart from two of them I get the following issues, basically after initiating reboot command on ubuntu, nginx does not start again as per the below info, however it starts again fine on my other three servers, furthermore I find it a bit strange the servers are all setup pretty much the same, the only difference is two of the servers were setup very recently whilst the others were setup a few months ago.
? nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:nginx(8)
How can I fix this so nginx starts properly? If you require any more information from me feel free to ask.
I use laravel forge because I am not great with this sort of stuff, although I kind of know what you mean by what you have said, can you elaborate more please on this fix, as so:
1.) How do I start it using Sudo? for security and other reasons I set it up so its a normal log in only. This all works fine on my other servers, unless somewhere along the lines with it being a new server and me setting that up as somehow conflicted such setting this time?
2.) Why and how do I bind a port to port 1024 and is that something specific I set up on nginx or on the server as a whole? Either way how do I achieve this?
You probably don't want to bind it to another port, otherwise your urls would have to be like yoursite.com:1024 since port 80 is regular web traffic and 443 is ssl traffic. If it's port 80/443 you don't have to specify it in the url, but if it's anything other than those then you do.
I usually just use sudo service nginx restart and then it will prompt you for your sudo password (that forge gave to you when creating the server). So ssh in and use that command from the cli.
You might also want to notify forge support and see what they have to say. It should cause a problem upgrating the os.
Looks like however or whatever started the nginx process, wasn't root.
sudo systemctl enable nginx.service
// try a reboot
sudo reboot
// check status of nginx
sudo systemctl status nginx.service
// can start it with this to see if it's running properly
sudo systemctl start nginx.service
I emailed forge this question as well, will be interesting to hear what they say, I am still baffled why I have three servers that work fine after upgrades as well and such and they are literally exactly setup the same on all levels.
Thanks for all the responses.
Overall I have one remaining question additional to those three servers working fine question, what does systemctl do in this instance of a problem like this, its just that seemed to be the key thing that got it all working again.
We believe that it's an issue with the latest nginx release, we've included "systemctl enable nginx.service" in your nginx installation scripts so we instruct nginx to autorestart after server reboot.
For servers created without this, you'll have to ssh to your server and run it.
@themsaid I am still trying to work out why I don’t need to run it on three of my servers, does this just mean because these three servers were created a while ago it’s most likely that before a Ubunutu upgrade they had the symlink in place already? How can I check if this symlink exists @bashy ?
@someTsystemctl is-enabled nginx.service. There's probably some info on the status command for systemctl as well but is-enabled will say if it is or not.