the Compile installation Nginx "
In order to install Nginx successfully, install the following first:
"What to do before CentOS compiles nginx"
Yum Install gcc gcc-c++ kernel-devel
Yum-y Install Pcre-devel OpenSSL openssl-devel
"Things to do before Ubuntu compiles nginx"
Apt-get Install GCC
Apt-get Install Libpcre3 Libpcre3-dev
Apt-get Install zlib1g Zlib1g-dev
Apt-get Install OpenSSL Openssl-dev
sudo apt-get install Libcurl3-openssl-dev
Unzip the nginx-1.7.4.tar.gz, then go to the directory and start compiling.
Command:
sudo./configure--prefix=/usr/local/nginx--with-http_stub_status_module
The compiled interface:
Errors that may occur with this process:
./configure:error:the HTTP Cache module requires MD5 functions from the OpenSSL library. You can either disable the module by using--without-http-cache option, or install the OpenSSL library into the system, or Build the OpenSSL library statically from the source with Nginx by using--with-http_ssl_module--WITH-OPENSSL=<PATH&G T Options.
Solve:
sudo apt-get install OpenSSL
sudo apt-get install Libssl-dev
Then make && make install
Use command:/usr/local/server/nginx/sbin/nginx to start Nginx.
Use the command:/usr/local/server/nginx/sbin/nginx-s reload to restart Nginx.
Use the command:/usr/local/server/nginx/sbin/nginx-s stop to terminate Nginx.
To see if it has started successfully Nginx :
Ps-ef | grep nginx
or use: ps-a | Grep-i Nginx
LNMP Build 02--Build and install Nginx