Nginx is a web server that is also used as a reverse proxy option. It also balances the load on your dedicated server and acts as a mail proxy as well as an HTTP cache. It is software used for high performance on your server.
This lesson will guide you in installing and configuring Nginx and for that, you are going to need the root privileges. You will also require to set up your CentOS server to use the EPEL Repository which stands for Extra Packages for Enterprise Linux.
To install EPEL simply run this command:
sudo yum install epel-release
You can read more about its configuration steps here. Earlier we installed yum as a package manager but it does not include any new version of Nginx in its default repository so installing EPEL will make sure that Nginx on CentOS remains up to date.
You are ready to install Nginx
Now you are ready to install Nginx on your server, simply run the following command:
sudo yum install nginx
Next, start Nginx:
Nginx doesn’t start on its own, so you will need to run a command for starting Nginx on your server:
sudo /etc/init.d/nginx start
To make sure Nginx is properly installed on your server, just direct your browser to your server’s IP address. If you see the words, “Welcome to Nginx”, it means you have Nginx installed and working.