nginx server: best OS?
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 6 months after creation.
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 6 months after creation.
nginx server: best OS?
Hello, I'm installing nginx but I've never used it before. I'll be running Wordpress on it. Have you guys ever used nginx? I'm wondering what's the best operating system for nginx? I'm looking at CentOS 6 or 7, but I don't know what the differences are in terms of using nginx. There's actually not that much information out there.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
They say your favorite Mint edition was the one you installed when you still went to school with your friends.
I am out there
I am out there
Re: nginx server: best OS?
I guess CentOs 7 should give you a more recent version of nginx.
Other than this, both should be ok for what you want to do.
Other than this, both should be ok for what you want to do.
Re: nginx server: best OS?
You can run sudo nginx -v to check what version you’re on. As of this article, the current stable branch is 1.12.x. Luckily, upgrading is fairly easy and usually doesn’t break anything. You need to add a new repo, then NGINX can be upgraded every time you run your sudo apt upgrade command.
Running nginx -v, you’ll probably see something similar to this:
The first steps you’ll want to do is backing up your current NGINX configs. You can run these two commands to create a backup directory and copy your config files over to it:
Next we need to add the repository. For this, you’ll need to install software-properties-common if it’s not already installed. Run this command to make sure it is installed:
sudo apt-get install software-properties-common
Now we’ll add the NGINX repo by running these commands:
nginx=stable
sudo add-apt-repository ppa:nginx/$nginx
You should get an output similar to this and you’ll need to press Enter to approve adding it:
This PPA contains the latest Stable Release version of the nginx web server software.
Now we’ll want to update the available packages by running:
Finally, we’ll want to run a full upgrade which will include NGINX and all of its add-ons:
You’ll be prompted to use a new config files twice, you’ll want to answer N to those for now to keep your current versions.
Now when you run sudo nginx -v you should see a new version.
Finally, you’ll want to edit your /etc/nginx/nginx.conf file and add this line just below the pid line near the top:
Next, run sudo nginx -t to test the new config and make any changes you need in order for it to pass the test.
Then restart your nginx service.
Running nginx -v, you’ll probably see something similar to this:
Code: Select all
sudo nginx -V
nginx version: nginx/1.10.3 (Ubuntu)
Code: Select all
sudo mkdir /etc/nginx-backup/
sudo cp -r /etc/nginx/* /etc/nginx-backup/
Next we need to add the repository. For this, you’ll need to install software-properties-common if it’s not already installed. Run this command to make sure it is installed:
sudo apt-get install software-properties-common
Now we’ll add the NGINX repo by running these commands:
nginx=stable
sudo add-apt-repository ppa:nginx/$nginx
You should get an output similar to this and you’ll need to press Enter to approve adding it:
This PPA contains the latest Stable Release version of the nginx web server software.
Code: Select all
The following architectures are supported; if your arch doesn't match this list then the PPA is not supporting that architecture:
* i386
* amd64
* armhf
* arm64
* ppc64el
The following releases of Ubuntu (including in-development releases) are supported in this PPA:
* Trusty (14.04)
* Xenial (16.04)
* Yakkety (16.10)
* Zesty (17.04)
* Artful (17.10 - in development!)
The following releases of Ubuntu are no longer supported, and have had their packages removed from the PPA:
* Lucid (10.04)
* Maverick (10.10)
* Natty (11.04)
* Oneiric (11.10)
* Quantal (11.10)
* Raring (13.04)
* Saucy (13.10)
* Utopic (14.10)
* Vivid (15.04)
* Wily (15.10)
More info: https://launchpad.net/~nginx/+archive/ubuntu/stable
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keyring `/tmp/tmphecc_aoy/secring.gpg' created
gpg: keyring `/tmp/tmphecc_aoy/pubring.gpg' created
gpg: requesting key C300EE8C from hkp server keyserver.ubuntu.com
gpg: /tmp/tmphecc_aoy/trustdb.gpg: trustdb created
gpg: key C300EE8C: public key "Launchpad Stable" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
Code: Select all
sudo apt-get update
Code: Select all
sudo apt-get full-upgrade
Now when you run sudo nginx -v you should see a new version.
Finally, you’ll want to edit your /etc/nginx/nginx.conf file and add this line just below the pid line near the top:
Code: Select all
include /etc/nginx/modules-enabled/*.conf;
Then restart your nginx service.