Download the latest Nginx URL http://nginx.org/en/download.html
Wget http://nginx.org/download/nginx-0.8.53.tar.gz
Decompress and download the source code package.
Tar-zxvf nginx-0.8.53.tar.gz
Go to the decompressed source code folder
Cd nginx-0.8.53
Configure nginx
./Configure -- prefix =/opt/nginx -- with-http_stub_status_module
Explanation: -- prefix indicates the installation path and -- with-indicates the module to be installed. You can run./configure -- help to view the valid module.
Compile and install nginx
Make & make install
-------------------------------------
Installation prompt:
./Configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using -- without-http_rewrite_module
Option, or install the PCRE library into the system, or build the PCRE library
Statically from the source with nginx by using -- with-pcre = <path> option.
Solution:
The above prompt shows that the PCRE Library needs to be installed.
You can download one from below. I downloaded one from the beginning, but it still won't work. Later, the next version is high!
Ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
Decompress and download the source code package.
Tar-zxvf pcre-8.34.tar.gz
Go to the decompressed source code folder
Cd pcre-8.34
Run:
./Configure
Make
Make install
-------------------------------------
Start nginx
/Opt/nginx/sbin/nginx
-------------------------------------
Tip:
/Opt/nginx/sbin/nginx: error while loading shared libraries: libpcre. so.1: cannot open shared object file: No such file or directory
Solution:
Ldd/opt/nginx/sbin/nginx ====> check whether the Linked Library is normal
Linux-vdso.so.1 => (0x00007fff25dff000)
Libcrypt. so.1 =>/lib64/libcrypt. so.1 (0x00007f549c495000)
Libpcre. so.1 => not found ====> the corresponding library is not found.
Libcrypto. so.10 =>/usr/lib64/libcrypto. so.10 (0x00007f549c0b4000)
Libz. so.1 =>/lib64/libz. so.1 (0x00007f549be9e000)
Libc. so.6 =>/lib64/libc. so.6 (0x00007f549bb0a000)
Libfreebl3.so =>/lib64/libfreebl3.so (0x00007f549b892000)
Libdl. so.2 =>/lib64/libdl. so.2 (0x00007f549b68e000)
/Lib64/ld-linux-x86-64.so.2 (0x00007f549c6d2000)
Ln-s libpcre. so.0.0.1 libpcre. so.1
-------------------------------------
Start nginx again
/Opt/nginx/sbin/nginx
Check whether nginx is started properly
Ps-ef | grep nginx
Nginx details: click here
Nginx: click here
Deployment of Nginx + MySQL + PHP in CentOS 6.2
Build a WEB server using Nginx
Build a Web server based on Linux6.3 + Nginx1.2 + PHP5 + MySQL5.5
Performance Tuning for Nginx in CentOS 6.3
Configure Nginx to load the ngx_pagespeed module in CentOS 6.3
Install and configure Nginx + Pcre + php-fpm in CentOS 6.4