How to install Nginx in CentOS-7?

Nginx (pronounced “engine x”) is a free, open-source, high-performance HTTP server. Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption. This tutorial shows how you can install Nginx on a CentOS 7 box.

Since Nginx is not available from the official CentOS repositories, the first and foremost thing we need to do is to enable additional repository for Nginx. We can create a new file to include the repository of the Nginx project as this,

sudo vi /etc/yum.repos.d/nginx.repo
     name=nginx repo

Nginx can now be installed as,

sudo yum install nginx

Then we create the system startup links for nginx and start it:

systemctl enable nginx.service
systemctl start nginx.service

Leave a comment

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