Download Nginx Compressed package, I am under the nginx-1.10.1.tar.gz
Send the compressed package to the server.
# TAR-XVF Nginx-1.10.1.tar.gz (unzip the Tarball)
# CD nginx-1.10.1 (go to the folder you just unzipped)
#./configure (check installation environment)
If the following error is reported, the necessary libraries are missing:
1, checking for C compiler ... not found
Workaround:
Installing the GCC package, #yum-y install gcc
2. Checking for PCRE library ... not found
Workaround:
Go to https://sourceforge.net/projects/pcre/files/pcre/to download the latest Pcre library
Unzip and install.
If the installation process is reported to you need a C + + compiler for C + + support error
Install the C + + environment before installing Pcre #yum install-y gcc gcc-c++
3. Zlib Library ... not found
Workaround: Install the zlib package #yum installed Zlib-devel
After the/configure passed
#make
#make Install
So it's ready for installation.
Nginx is installed in/usr/local/nginx by default.
The following methods can be used to check if the installation is successful
# Cd/usr/local/nginx/sbin
#./nginx-t
If it appears:
Nginx:the configuration file/usr/local/nginx/conf/nginx.conf syntax is OK
Nginx:configuration file/usr/local/nginx/conf/nginx.conf Test is successful
Indicates that the installation was successful
Use this command to start Nginx:
#/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf
Linux installation Nginx