System:Centos6.6
Nginx: http://nginx.org/en/download.html Currently the latest version 1.9.4 i download 1.8.0
Download module Dependency Nginx needs to rely on the following 3 packages
1.gzip module requires zlib library (download: http://www.zlib.net/)
2.rewrite module requires pcre library (download: http://www.pcre.org/)
3.ssl function requires OpenSSL library (download: http://www.openssl.org/)
The dependent package installation order is: OpenSSL, zlib, Pcre, and then install the Nginx package
If you do not have a C + + compilation environment installed, install it via yum install gcc-c++
When the download is complete:
Next, compile the installation
OpenSSL :
[[email protected]] Tar zxvf openssl-fips-2.0.9.tar.gz
[[email protected]] CD openssl-fips-2.0.9
[email protected]lhost]./config && make && make install
Pcre
[[email protected]] Tar zxvf pcre-8.36.tar.gz
[[email protected]] CD pcre-8.36
[[email protected]]./configure && make && make install
Zlib
[Email Protected]]tar zxvf zlib-1.2.8.tar.gz
[[email protected]] CD zlib-1.2.8
[[email protected]]./configure && make && make install
Final installation of Nginx
[Email Protected]]tar zxvf nginx-1.8.0.tar.gz
[[email protected]] CD nginx-1.8.0
[[email protected]]./configure && make && make install
After the installation is complete, you can start nginx:
Start command:/usr/local/nginx/sbin/nginx
Found an error:
Error while loading shared Libraries:libpcre.so.1:cannot open Shared object file:no such file or directory
Online query, this is a common problem of Linux
[Email protected] nginx]# Sbin/nginx
Sbin/nginx:error while loading shared libraries:libpcre.so.1:cannot open Shared object file:no such file or directory
[[Email protected] nginx]# error while loading shared Libraries:libpcre.so.1:cannot open shared object File:no such fil E or directory
[Email protected] nginx]# Whereis libpcre.so.1
Libpcre.so:/lib64/libpcre.so.0/usr/local/lib/libpcre.so/usr/local/lib/libpcre.so.1
[Email protected] nginx]# ln-s/usr/local/lib/libpcre.so.1/lib64
[Email protected] nginx]# Sbin/nginx
First find the location of libpcre.so.1, and then make a soft link on it.
To see if it is started:
Access via browser:
See this to indicate nginx installation and start success.
Ps:
Start:/usr/local/nginx/sbin/nginx
Stop/Reload:/usr/local/nginx/sbin/nginx-s Stop (quit, reload)
Verify that the configuration file is legitimate:/usr/local/nginx/sbin/nginx-t
Command Help:/usr/local/nginx/sbin/nginx-h
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Linux installation Nginx Detailed illustration tutorial