Nginx Installation on Centos 5 32 bit

nginx

nginx [engine x] is an HTTP and reverse proxy server, as well as a mail proxy server, written by Igor Sysoev. For a long time, it has been running on many heavily loaded Russian sites including Yandex, Mail.Ru, VKontakte, and Rambler. According to Netcraft nginx served or proxied 10.09% busiest sites in April 2012. Here are some of the success stories: FastMail.FM, WordPress.com.

  1. Basic HTTP server features
    • Serving static and index files, and autoindexing; open file descriptor cache;
    • Accelerated reverse proxying with caching; simple load balancing and fault tolerance;
    • Accelerated support with caching of FastCGI, uwsgi, SCGI, and memcached servers; simple load balancing and fault tolerance;
    • Modular architecture. Filters include gzipping, byte ranges, chunked responses, XSLT, SSI, and image transformation filter. Multiple SSI inclusions within a single page can be processed in parallel if they are handled by proxied or FastCGI servers;
    • SSL and TLS SNI support.
  2. Other HTTP server features
    • Name-based and IP-based virtual servers;
    • Keep-alive and pipelined connections support;
    • Flexible configuration;
    • Reconfiguration and upgrade of an executable without interruption of the client servicing;
    • Access log formats, buffered log writing, and fast log rotation;
    • 3xx-5xx error codes redirection;
    • The rewrite module: URI changing using regular expressions;
    • Executing different functions depending on the client address;
    • Access control based on client IP address and HTTP Basic authentication;
    • The PUT, DELETE, MKCOL, COPY, and MOVE methods;
    • FLV and MP4 streaming;
    • Response rate limiting;
    • Limiting the number of simultaneous connections or requests coming from one address;
      Embedded Perl.
  3. Mail proxy server features
    • User redirection to IMAP/POP3 backend using an external HTTP authentication server;
    • User authentication using an external HTTP authentication server and connection redirection to an internal SMTP backend;
    • Authentication methods:
      • POP3: USER/PASS, APOP, AUTH LOGIN/PLAIN/CRAM-MD5;
      • IMAP: LOGIN, AUTH LOGIN/PLAIN/CRAM-MD5;
      • SMTP: AUTH LOGIN/PLAIN/CRAM-MD5;
    • SSL support;
    • STARTTLS and STLS support.

nginx installation

To enable automatic updates of Linux packages set up the yum repository for the RHEL/CentOS distributions, Download nginx

[root@ftp ~]# wget http://nginx.org/packages/centos/5/noarch/RPMS/nginx-release-centos-5-0.el5.ngx.noarch.rpm
[root@ftp ~]# rpm -ivh nginx-release-centos-5-0.el5.ngx.noarch.rpm

or

Enable EPEL repository

[root@nginx source]# yum search nginx

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.idrepo.or.id
 * epel: sulawesi.idrepo.or.id
 * extras: centos.idrepo.or.id
 * updates: centos.idrepo.or.id
=============== Matched: nginx ======================================
collectd-nginx.i386 : Nginx plugin for collectd
nginx.i386 : Robust, small and high performance HTTP and reverse proxy server

[root@nginx source]# yum install nginx

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.idrepo.or.id
 * epel: sulawesi.idrepo.or.id
 * extras: centos.idrepo.or.id
 * updates: centos.idrepo.or.id
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package nginx.i386 0:0.8.55-1.el5 set to be updated
--> Processing Dependency: libxslt.so.1 for package: nginx
--> Processing Dependency: libGeoIP.so.1 for package: nginx
--> Processing Dependency: libgd.so.2 for package: nginx
--> Processing Dependency: libexslt.so.0 for package: nginx
--> Running transaction check
---> Package GeoIP.i386 0:1.4.8-1.el5 set to be updated
---> Package gd.i386 0:2.0.33-9.4.el5_4.2 set to be updated
--> Processing Dependency: pkgconfig for package: gd
--> Processing Dependency: libXpm.so.4 for package: gd
---> Package libxslt.i386 0:1.1.17-2.el5_2.2 set to be updated
--> Running transaction check
---> Package libXpm.i386 0:3.5.5-3 set to be updated
---> Package pkgconfig.i386 1:0.21-2.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package              Arch       Version             Repository          Size
================================================================================
Installing:
 nginx                i386       0.8.55-1.el5        epel                390 k
Installing for dependencies:
 GeoIP                i386       1.4.8-1.el5         epel                781 k
 gd                   i386       2.0.33-9.4.el5_4.2  base                154 k
 libXpm               i386       3.5.5-3             base                 45 k
 libxslt              i386       1.1.17-2.el5_2.2    base                485 k
 pkgconfig            i386       1:0.21-2.el5        base                 59 k

Transaction Summary
================================================================================
Install       6 Package(s)
Upgrade       0 Package(s)

Total download size: 1.9 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): libXpm-3.5.5-3.i386.rpm                               |  45 kB     00:00
(2/6): pkgconfig-0.21-2.el5.i386.rpm                         |  59 kB     00:00
(3/6): gd-2.0.33-9.4.el5_4.2.i386.rpm                        | 154 kB     00:00
(4/6): nginx-0.8.55-1.el5.i386.rpm                           | 390 kB     00:00
(5/6): libxslt-1.1.17-2.el5_2.2.i386.rpm                     | 485 kB     00:00
(6/6): GeoIP-1.4.8-1.el5.i386.rpm                            | 781 kB     00:00
--------------------------------------------------------------------------------
Total                                               684 kB/s | 1.9 MB     00:02
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897
base/gpgkey                                                  | 1.5 kB     00:00
Importing GPG key 0xE8562897 "CentOS-5 Key (CentOS 5 Official Signing Key) " from /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
Is this ok [y/N]: y
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     : libXpm                                                  1/6
  Installing     : GeoIP                                                   2/6
  Installing     : libxslt                                                 3/6
  Installing     : pkgconfig                                               4/6
  Installing     : gd                                                      5/6
  Installing     : nginx                                                   6/6

Installed:
  nginx.i386 0:0.8.55-1.el5

Dependency Installed:
  GeoIP.i386 0:1.4.8-1.el5       gd.i386 0:2.0.33-9.4.el5_4.2       libXpm.i386 0:3.5.5-3       
  libxslt.i386 0:1.1.17-2.el5_2.2       pkgconfig.i386 1:0.21-2.el5

Complete!

[root@ftp ~]# /etc/init.d/nginx start
Starting nginx: [ OK ]

for test, go to http://your-web-server-ip with your web browser.
nginx first time

nginx configuration file

  • Default config file: /etc/nginx/nginx.conf
  • Default SSL config file: /etc/nginx/conf.d/ssl.conf
  • Default virtual hosting config file: /etc/nginx/conf.d/virtual.conf
  • Default documentroot: /usr/share/nginx/html

Source : nginx

Leave a Reply

Your email address will not be published.