Nginx 1.8 on CentOS/RHEL 7.1 and 6.7 via Yum

Nginx 1.8.0, released 21st April 2015, has been added as a package on the Webtatic EL6 yum repository for CentOS/RHEL 7.1 and 6.6.

LNMP (Linux Nginx MySQL PHP) is an alternative web-stack to LAMP (Linux Apache MySQL PHP), with Nginx being better suited to serving static files, due to being able to handle many more simultaneous connections with a lower process count and memory footprint.

To install, first you must add the Webtatic EL yum repository information corresponding to your CentOS/RHEL version to yum:

CentOS/RHEL 7.x:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

CentOS/RHEL 6.x:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

Now you can install Nginx 1.8 by doing:

yum install nginx18

The nginx18 package will follow all bugfix releases for Nginx 1.8.x.

The configuration for Nginx can be found in /etc/nginx/.

Unless you know what you are doing, it is risky upgrading an existing system. It’s much safer to do this by provisioning a separate server to perform the upgrade as a fresh install instead.

If you know what you are doing, you can upgrade Nginx by:

yum install yum-plugin-replace
 
yum replace nginx16 --replace-with=nginx18
 
service nginx restart

It will likely give you a message “WARNING: Unable to resolve all providers …”. This is normal, and you can continue by tying “y“. You will be given a chance to see what packages will be installed and removed before again being given a chance to confirm.

If this doesn’t work, then you could use yum shell instead:

yum shell
 
remove nginx16
install nginx18
run
 
service nginx restart

Nginx 1.6.x

Webtatic also has Nginx 1.6.x, which will continue with any upstream bug fixes.

Leave a Reply

Your email address will not be published. Required fields are marked *