Tutorial: How To Install NGINX On CentOS VPS

Just like our how to install NGINX on Debian VPS tutorial, installing on CentOS is just as easy.

First, we create /etc/yum.repos.d/nginx.repo and put in the following:

name=nginx repo

Next, we update our yum repos with yum update and install nginx with yum install nginx

Our nginx webserver is serving up files from /usr/share/nginx/html

A common problem is if your VPS has IPv6 that nginx will have issues. You resolve this by compiling nginx from source and enabling IPv6 support. Nginx packages, both Debian and CentOS in my experience, act funny and cause headache when IPv6 is not enabled even if you use it or not.


Tutorial: How To Install NGINX on Debian VPS

If you are looking for an nginx CentOS installation tutorial, Rob has already wrote one.

nginx (“engine x”) is a webserver and reverse proxy actively developed by Russian programmer Igor Sysoev and his development team. nginx, by comparison, has a small market share compared to Apache and Microsoft’s IIS however nginx’s popularity is increasing. Many large websites, such as Hulu, WordPress, Netflix, and others, have all moved from Apache to nginx citing nginx’s stability, speed and ability to handle the smallest website to the largest, high traffic websites without investing heavily in infrastructure like Apache who is a notorious resource hog.


First, we download and install the nginx signing key:

wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key

Installation for Debian is relatively easy. We need to add these lines to your /etc/apt/sources.list:

deb http://nginx.org/packages/debian/ squeeze nginx
deb-src http://nginx.org/packages/debian/ squeeze nginx

Now, we update our apt packages and install nginx packages:

apt-get update
apt-get install nginx

nginx is running and the default nginx directory is /usr/share/nginx/html/

This is a basic guide about how to install nginx. This is just a webserver running, with no PHP support, and can serve up a static file website of HTML files, images or other content but cannot run PHP files since PHP is not installed. I will write up a tutorial about how to install PHP support and configure nginx.