How-to Set Up the Nginx Mainline Yum Repo for Red-Hat / Oracle / CentOS Linux

Adding Nginx Repository for RHEL Based




The Linux Tip Shows You How-to Properly Set-Up the YUM Repo for the Red Hat Enterprise Linux Based and CentOS 5.x/6.x/7.x Systems.

NGINX is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server.
NGINX is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.

Installing Latest Nginx for Red-Hat / Oracle / CentOS Linux - Featured
  1. Open a Shell session
    (Press “Enter” to Execute Commands)

    Installing Latest Nginx for Red-Hat / Oracle / CentOS Linux - Open Terminal
  2. Adding the Nginx Repository

    sudo nano /etc/yum.repos.d/nginx.repo

    Append:

    [nginx]
    name=nginx repo
    baseurl=http://nginx.org/packages/mainline/[OS]/OSRELEASE/$basearch/
    gpgcheck=0
    enabled=1
    

    Change [OS] in:

    • For CentOS -> centos
    • For RHEL/OEL -> rhel

    Ctrl+x to Save & Exit from nano.