Install Nginx under Ubuntu

Source: Internet
Author: User
Tags openssl openssl library

Reprinted from: http://www.cnblogs.com/skynet/p/4146083.html

1.Nginx Installation

I use the environment is 64-bit Ubuntu 14.04, Nginx is Nginx 1.10.0

Nginx relies on the following modules:

L gzip module requires zlib library

L Rewrite module requires Pcre library

L SSL function requires OpenSSL library

1.1. Installing Pcre
    1. Get Pcre Compile the installation package and get the current latest version on http://www.pcre.org/
    2. Unzip the pcre-xx.tar.gz package.
    3. Go to unzip directory and execute./configure.
    4. Make & make Install

Note: Currently I download this nginx only support pcre, does not support Pcre2.

If a configure:error:You need a C + + compiler for C + + support appears. The system has not yet provided a compile-time environment for C + +, so it needs to be installed manually. Install using the command sudo apt-get install build-essential.

1.2. Installing OpenSSL
    1. Gets the OpenSSL compilation installation package, which is available on http://www.openssl.org/source/for the current latest version.
    2. Unzip the openssl-xx.tar.gz package.
    3. Go to unzip directory and execute./config.
    4. Make & make Install
1.3. Installing zlib
    1. Gets the zlib compiled installation package, which can get the current latest version on http://www.zlib.net/.
    2. Unzip the openssl-xx.tar.gz package.
    3. Go to unzip directory and execute./configure.
    4. Make & make Install
1.4. Installing Nginx
    1. Get Nginx, you can get the latest version on http://nginx.org/en/download.html.
    2. Unzip the nginx-xx.tar.gz package.
    3. Go to unzip directory, execute./configure
    4. Make & make Install

If the above dependent modules cannot be found during installation, use--with-openssl=<openssl_dir> 、--with-pcre=<pcre_dir> 、--with-zlib=<zlib_dir> Specifies a dependent module directory. If installed, the path here is the installation directory, if not installed, this path is the compiled installation package path, Nginx will execute the module's default compilation installation.

After you start Nginx, enter http://localhost in the browser to verify that the installation started successfully.

Install Nginx under Ubuntu

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.