1. Before installing, do the preparation work, configure the Nginx environment and some class library.
$ Yum Install gcc-c++
$ yum install pcre pcre-devel
$ yum install zlib zlib-devel
$ Yum Install OpenSSL Openssl--devel
2. Select a directory to install
Before installing, it is advisable to check if Nginx is installed
$ find-name Nginx
If the system has Nginx installed, first uninstall the
$ yum Remove Nginx
Download the latest version of Nginx from official website
$ wget http://nginx.org/download/nginx-1.7.4.tar.gz
Unzip the Nginx compression pack
$ TAR-ZXVF nginx-1.7.4.tar.gz
will produce a nginx-1.7.4 directory, then enter the nginx-1.7.4 directory
$ CD nginx-1.7.4
Next install, use the –prefix parameter to specify the Nginx installation directory, make, make install installation
$ ./configure $ default installation in/usr/local/nginx
$ make
$ make Install
If there is no error, after the successful completion, it is best to look at the Nginx installation directory
$ Whereis Nginx
Enter path to start or close nginx after installation is complete