Install nginx on CentOS 6


Nginx is a high-performance web server specifically designed for delivering large amounts of static content. You can install nginx in CentOS 6 with the help of yum command.

Basic requirements

Get a server from Bytehouse Cloud Products and configure the server.

SSH to the server.

ssh username@your-server-ip

Install EPEL repo

$  sudo yum install epel-release

Install nginx

$ sudo yum install nginx

Start nginx service by executing the below command.

sudo service nginx start

Get your server IP address by executing the below command.

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

In your browser enter the following URL

http://your-server-ip

Nginx default page will be displayed

The default document root of nginx is /usr/share/nginx/html. If you wish to change the default document root of nginx, edit the configuration file in /etc/nginx/conf.d/default.conf.

Change root parameter under location section in configuration file.

location / {
    root   /usr/share/nginx/html;
    index  index.html index.htm;
}

You can check the status of nginx process by executing the below command.

-$  sudo service nginx status
    nginx (pid  11022) is running...
Last update:
2016-06-29 23:40
Author:
Bytehouse Technical Support
Revision:
1.3
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.

Most popular FAQs RSS

  1. I require an additional IPv4 address. What is Bytehouse's ... (88072 views)
  2. The Most Common Problems When Migrating Websites (66644 views)
  3. How do I create a 301 redirect? (55086 views)
  4. Can I Backup Exchange 2010 with My Online Backup ... (53278 views)
  5. Steps to Add Administrator User for Windows Server (48827 views)

Latest FAQs RSS

  1. Steps to set/customize log rotation from plesk (2016-07-25 07:15)
  2. Generate a self-signed SSL certificate - Nginx,CentOS (2016-07-07 02:31)
  3. Procedure re-register Volume Shadow Copy Service(VSS) in a Windows ... (2016-07-05 04:18)
  4. Steps to Install Mcrypt in Plesk (2016-07-01 17:11)
  5. How to Retrieve a Plesk Password in Linux and ... (2016-07-01 17:09)

Regular new KB articles

Check back from time to time for new articles, or if you have any suggestions please feel free to recommend

top