This a quick note on how to install the latest NGINX server on my CentOS 7, using the pakages provided by the NGINX team. I share this post as it may help any visitor.
The official info about the official NGINX packages is in NGINX’s site
As root you can add the repository file for mainline version:
cat << EOT > /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/centos/7/\$basearch/
gpgcheck=0
enabled=1
EOT
If you want to use the stable version you’d execute:
cat << EOT > /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/\$basearch/
gpgcheck=0
enabled=1
EOT
Then just use yum:
yum install -y nginx
And manage the service as usual (start the service, enable it at boot time and check the status):
service start nginx
service enable nginx
service status nginx
If you want to check the version you’ve just installed (e.g I’m using the latest mainline version July/2016):
# nginx -v
nginx version: nginx/1.11.2
And that’s all, just a note for my reference for the future, hope it helps you too 🙂