Nginx is a lightweight, high-performance HTTP and reverse proxy server, also a IMAP/POP3/SMTP server. In the case of high concurrency, as a substitute for Apache, the effect is very good.
CentOS 7 Installation Nginx:
First, install the need for Nginx library
1.pcre
(1) Locate the suffix. tar.gz source installation package in http://www.pcre.org/. Download it with the wget command.
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz
(2) Decompression
$ tar zvxf pcre-8.38.tar.gz
$ CD pcre-8.38/
(3) configuration, installation
$./configure--prefix=/usr/local/pcre
$ make
$ make Install
During the error, because I did not compile the C environment, do:
$ yum install-y gcc gcc-c++
Install the Make & make install again after execution
$ CD.
2.openssl
OpenSSL get Address: http://www.openssl.org/source/
$ wget https://www.openssl.org/source/openssl-1.1.0-pre5.tar.gz
$ tar zvxf openssl-1.1.0-pre5.tar.gz
$ CD openssl-1.1.0-pre5/
$./config--prefix=/usr/local/openssl
$ chmod a+x apps/ca.pl
$ chmod a+x Apps/tsget
$ chmod a+x Tools/c_rehash
$ make
$ make Install
$ CD.
3.zlib
Zlib Get Address: http://www.zlib.net/
$ wget http://zlib.net/zlib-1.2.8.tar.gz
$ tar zvxf zlib-1.2.8.tar.gz
$ CD zlib-1.2.8/
$./configure--prefix=/usr/local/zlib
$ make
$ make Install
$ CD.
Second, install Nginx
$ wget http://nginx.org/download/nginx-1.10.0.tar.gz
$ tar zvxf nginx-1.10.0.tar.gz
$ CD nginx-1.10.0/
$./configure--prefix=/usr/local/nginx--with-pcre=/root/nginx_root/pcre_root/pcre-8.38--with-zlib=/root/nginx_ root/zlib_root/zlib-1.2.8
(Change to the path when extracting, not the path of the installation.) The hint can not find which is--with-its decompression path)
$ make
$ make Install
$ CD.
Three, start Nginx
$ cd/usr/local/nginx/sbin/
$./nginx
Open the browser to access 127.0.0.1, the following interface is successful.
May execute $./nginx failed, prompting 0.0.0.0:80 to be occupied.
Open 127.0.0.1 to see what the current interface, if Apache HTTP, executes:
$ Service httpd Stop
Linux:centos 7 Installing Nginx