LNMP Build 02--Build and install Nginx

Source: Internet
Author: User
Tags install openssl openssl library

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.