How To Install nginx on CentOS

What is NGINX?


Nginx (pronounced "engine-x") is an open source reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as well as a load balancer, HTTP cache, and a web server (origin server). The nginx project started with a strong focus on high concurrency, high performance and low memory usage.

Set Up

The steps in this tutorial require the user to have root privileges. You can see how to set that up in the CentOS Initial Server Setup Tutorial in steps 3 and 4.

 

Step One—Install EPEL

EPEL stands for Extra Packages for Enterprise Linux. Because yum as a package manager does not include the latest version of nginx in its default repository, installing EPEL will make sure that nginx on CentOS stays up to date.

To install EPEL, open terminal and type in:

sudo su -c 'rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm'
 

Step Two—Install nginx

To install nginx, open terminal and type in:

sudo yum install nginx

After you answer yes to the prompt twice (the first time relates to importing the EPEL gpg-key), nginx will finish installing on your virtual private server.

 

Step Three—Start nginx

nginx does not start on its own. To get nginx running, type:

sudo /etc/init.d/nginx start

You can confirm that nginx has installed on your VPS by directing your browser to your IP address.

You can run the following command to reveal your server’s IP address.

ifconfig eth0 | grep inet | awk '{ print $2 }'

On the page, you will see the words, “Welcome to nginx”



  • 1 användare blev hjälpta av detta svar
Hjälpte svaret dig?

Relaterade artiklar

ownCloud Auto Install Script on Debian 7

Here is an easy way to install ownCloud on Debian 7 with a script, but first, for those who...

NGINX – Allow access only to certain IPs

Nginx has a nice module that not many people know about, it basically enables us...

How to configure NTP client in CentOS

What's NTP? NTP stands for Network Time Protocol, and it is an Internet protocol used to...

Initial Server Setup on CentOS 6

Here are some recommendations to setup your VPS or server when you first get it, some of these...

How to connect to Linux via SSH using PuTTY

Download PuTTY Download PuTTY from the website.  Be sure to comply with the license...