First, download unzip
Official: http://nginx.org/en/download.html
Download package: nginx-1.8.1.tar.gz, unzip
tar xvf nginx-1.8. 1. tar. gz
The extracted files are as follows
Second, installation dependence
Nginx requires GCC, pcre, OpenSSL, zlib dependent packages, install or update in turn
Installing the GCC compiler
Yum Install GCC
Installing the Pcre Library
Yum Install pcre*
Installing the OpenSSL tools and libraries
Yum Install openssl*
Installing the Zlib Library
Yum Install zlib*
Third, install Nginx
Enter the root directory after the Nginx decompression, configure the Nginx installation path and modules.
--prefix=/usr/java/nginx --with-http_ssl_module--with-http_spdy_module--with-http_stub_status_module-- With-pcre--with-http_gzip_static_module
Run again after success
Make Make Install
Installation complete, enter Nginx directory, start Nginx
cd/usr/java/nginx/sbin. /nginx
The browser input address (192.168.253.128 is my demo with the CentOS virtual machine address), displays the following information indicating that the installation was successful.
Nginx start, stop, and restart commands
./Nginx. /nginx-s stop. /nginx-s Reload
CentOS installation Nginx