Operating system: CentOS 7
Nginx Version: nginx-1.11.1
Installation preparation, Nginx needs to rely on the following 3 packages
1. Gzip module requires zlib library (download: http://www.zlib.net/) zlib-1.2.8.tar.gz
2. Rewrite module requires pcre library (download: http://www.pcre.org/) pcre-8.38.tar.gz
3. The SSL function requires the OpenSSL library (download: http://www.openssl.org/) openssl-1.0.1.tar.gz
Nginx http://nginx.org/en/download.html
First, install the OpenSSL command
TAR-XZVF openssl-1.0.1.tar.gz--decompression
CD openssl-1.0.1
./config--prefix=/usr/local/openssl
./config-t
Make---compile OpenSSL
Description if edit error Gcc:command not found, Internet Explorer found I installed without GCC compiler, execute command yum-y install GCC (note, be sure to forget the smooth, otherwise not installed)
Then in execution: make install
If the following error occurs during installation: POD document had syntax errors At/usr/bin/pod2man line 69. make. So, fix the following: Rm/usr/bin/pod2man
Second, install the zlib command
I downloaded the zlib-1.2.8.tar.xz.
Xz-d Zlib-1.2.8.tar.xz extract into Zlib-1.2.8.tar
Tar xvf Zlib-1.2.8.tar
CD zlib-1.2.8
./configure--prefix=/usr/local/zlib
Make &make Install
Installation of zlib more smoothly
Third, install Nginx
Tar zxvf nginx-1.11.1.tar.gz
CD nginx-1.11.1
./configure--prefix=/usr/local/nginx--with-pcre=.. /pcre-8.38--with-zlib=/usr/local/zlib--with-openssl=/usr/local/openssl
Note--with-pcre must point to the pcre-8.38.tar.gz directory, the other points to the installation directory can be
Make&make Install
Note If a fatal error occurs: Zlib.h: There is no file or directory--with-zlib the extracted directory that points to Zlib-1.2.8.tar
Four Nginx Boot
CD Usr/local/nginx/sbin./nginx
Start successfully, you can see the effect by entering localhost in the browser
Installing Nginx under Linux