Skip to content

Posts from the ‘Nginx’ Category

11
Sep

Installing Nginx 0.8 on CentOS 5.x

Introduction

Nginx (pronounced “Engine X”) is a free, open-source, high-performance HTTP server and reverse proxy alternative to the venerable Apache HTTP server. This article describes the steps for installing Nginx 0.8 on CentOS 5.x.

Enable the EPEL 5.4 Repository

Nginx is available from the Extra Packages for Enterprise Linux (EPEL) repository. Enable the repository as follows:

# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5Server/x86_64/epel-release-5-4.noarch.rpm

Update YUM

Issue the command yum update to ensure your system is up to date.

# yum update

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.ihug.co.nz
 * epel: mirror.aarnet.edu.au
 * extras: mirror.ihug.co.nz
 * updates: mirror.ihug.co.nz
epel                          | 3.7 kB     00:00
epel/primary_db               | 3.8 MB     00:16
Setting up Update Process
No Packages marked for Update

Install Nginx

Issue the command yum install nginx. You will be prompted to accept the GPG key for the Fedora EPEL.

# yum install nginx

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.ihug.co.nz
 * epel: mirror.aarnet.edu.au
 * extras: mirror.ihug.co.nz
 * updates: mirror.ihug.co.nz
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 0:0.8.54-1.el5 set to be updated
--> Processing Dependency: libgd.so.2()(64bit) for package: nginx
--> Processing Dependency: libGeoIP.so.1()(64bit) for package: nginx
--> Running transaction check
---> Package GeoIP.x86_64 0:1.4.7-0.1.20090931cvs.el5 set to be updated
---> Package gd.x86_64 0:2.0.33-9.4.el5_4.2 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 217521f6
epel/gpgkey           | 1.7 kB     00:00
Importing GPG key 0x217521F6 "Fedora EPEL " from /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : GeoIP        1/3
  Installing     : gd           2/3
  Installing     : nginx        3/3

Installed:
  nginx.x86_64 0:0.8.54-1.el5

Dependency Installed:
  GeoIP.x86_64 0:1.4.7-0.1.20090931cvs.el5  gd.x86_64 0:2.0.33-9.4.el5_4.2

Complete!

Once finished, start Nginx with the following command:

# /etc/init.d/nginx start

Browse to the server hosting Nginx on port 80. (Screenshot below is Chrome on my MacBook Pro).

Nginx Home