In this tutorial we will cover the steps needed to install the nginx on your CentOS 6.4, Debian or Ubuntu platform. Nginx (pronounced "engine-x") is an open source reverse proxy server. It is noted to be a good server for websites that need fast, efficient reverse proxies or serving of static content.

Requirements:

  • CentOS 6.4, Debian or Ubuntu installed on your computer/server
  • SSH access (Command line access to the server)
  • root privileges
  • Basic skills for working on a Linux environment

Install nginx

Nginx (pronounced "engine-x") is one of the most popular open source web servers for high-traffic websites. It can be used either as stand-alone HTTP server or configured as reverse proxy server and load balancer.

Due to the fact that some of the packages might not be available by default you will need first to add additional repositories to your Linux platform. This can be done with the following commands:

CentOS 6.4

Debian:

For the nginx installation we will use the default package manager included inside the corresponding Linux distribution:

CentOS 6.4

Ubuntu/Debian

You will be prompted to accept the installation and addition package dependencies will be displayed.

Test the functionality of the nginx service

Once the installation is completed you can test the nginx service using your browser:

or

where X.X.X.X is your server's IP address, i.e. http://1.2.3.4/

You should be able to see the default nginx page inside your browser.

An easy way to find your server's IP address is to execute the following command:

Start Up nginx automatically on server boot

In order for the service to start automatically upon server boot up you can execute the following command:

CentOS 6.4

Ubuntu/Debain:

At the end you should have a working nginx service on your Linux platform.