For a more detailed tutorial, see previous posts
http://blog.csdn.net/tao_627/article/details/60957521
Here are just a few simple steps, no screenshots, all the while using root
The current source address
Ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
Http://www.zlib.net/zlib-1.2.11.tar.gz
Https://www.openssl.org/source/openssl-1.1.0g.tar.gz
Http://nginx.org/download/nginx-1.12.2.tar.gz
Installation related dependencies
Yum-y install gcc gcc-c++ automake autoconf libtool make glibc glibc-devel lsof
Assuming that the following source code is stored in the/USR/LOCAL/SRC
Installing the Pcre Library
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
TAR-ZXVF pcre-8.41.tar.gz
CD pcre-8.41
./configure
Make
Make install
Installing the Zlib Library
wget http://zlib.net/zlib-1.2.11.tar.gz
TAR-ZXVF zlib-1.2.11.tar.gz
CD zlib-1.2.11
./configure
Make
Make install
Installing the OpenSSL Library
wget https://www.openssl.org/source/openssl-1.1.0g.tar.gz
Tar zxvf openssl-1.1.0g.tar.gz
Source code compilation nginx-1.12.2
wget http://nginx.org/download/nginx-1.12.2.tar.gz
Tar zxvf nginx-1.12.2.tar.gz
CD nginx-1.12.2
./configure--with-http_ssl_module \
--with-pcre=/usr/local/src/pcre-8.41 \
--with-zlib=/usr/local/src/zlib-1.2.11 \
--with-openssl=/usr/local/src/openssl-1.1.0g
Make
Make install
Before compiling, you need to carefully study the configuration options of configure, using
./configure--help
Test
/usr/local/nginx/sbin/nginx
Netstat-ntulp
Curl-vo/dev/null ' http://localhost/'
Installing third-party modules
See other blog entries, which will be based on the Ben Boven environment.