How to Install Nginx Web Server on CentOS 6.3

Nginx or “engine x” is a free, open-source HTTP server and one of the alternative to Apache http server. It’s a high performance edge web server with the lowest memory footprint and the key features to build modern and efficient web infrastructure. This post will show the quick step to install nginx on linux CentOS 6.3 server.

1. Prepared yum repository for nginx :

[root@centos63 ~]# vi /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

2. Perform yum install for nginx :

[root@centos63 ~]# yum install nginx -y

Examples :

[root@centos63 ~]# yum install nginx -y
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
 * base: mirrors.hostemo.com
 * extras: mirrors.hostemo.com
 * updates: mirrors.hostemo.com
nginx                                                                        | 1.3 kB     00:00
nginx/primary                                                                | 3.9 kB     00:00
nginx                                                                                         25/25
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package nginx.i386 0:1.2.2-1.el6.ngx will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package              Arch                Version                        Repository            Size
====================================================================================================
Installing:
 nginx                i386                1.2.2-1.el6.ngx                nginx                308 k

Transaction Summary
====================================================================================================
Install       1 Package(s)

Total download size: 308 k
Installed size: 623 k
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 308 k
nginx-1.2.2-1.el6.ngx.i386.rpm                                               | 308 kB     00:02
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : nginx-1.2.2-1.el6.ngx.i386                                                       1/1
----------------------------------------------------------------------

Thanks for using NGINX!

Check out our community web site:
* http://nginx.org/en/support.html

If you have questions about commercial support for NGINX please visit:
* http://www.nginx.com/support.html

----------------------------------------------------------------------
  Verifying  : nginx-1.2.2-1.el6.ngx.i386                                                       1/1

Installed:
  nginx.i386 0:1.2.2-1.el6.ngx

Complete!

3. Start nginx :

[root@centos63 ~]# service nginx start
Starting nginx:                                            [  OK  ]

4. Make nginx auto start at boot :

[root@centos63 ~]# chkconfig nginx on
Leave a Reply

Your email address will not be published. Required fields are marked *

SiteGround.com

A world leading hosting company that provides fully-managed innovative and secure solutions, suitable for hosting small to medium-sized websites

Built on the best available technologies combined with Google Cloud for strong redundancy and application availability. Backed by skilled experts to address web security threats, a devops team to create advanced custom security solutions, and 24/7 sysadmins to watch over the platform. This powerful, hands-on approach makes your sites faster, safer, and easier to manage. Starting from only $3.95/mo.

TRY FREE

* up to 30 days money back guarantee