Installing Nginx under Linux

Source: Internet
Author: User
Tags openssl library

Operating system: CentOS 7

Nginx Version: nginx-1.11.1

Installation preparation, Nginx needs to rely on the following 3 packages

1. Gzip module requires zlib library (download: http://www.zlib.net/) zlib-1.2.8.tar.gz

2. Rewrite module requires pcre library (download: http://www.pcre.org/) pcre-8.38.tar.gz

3. The SSL function requires the OpenSSL library (download: http://www.openssl.org/) openssl-1.0.1.tar.gz

Nginx http://nginx.org/en/download.html

First, install the OpenSSL command

TAR-XZVF openssl-1.0.1.tar.gz--decompression

CD openssl-1.0.1

./config--prefix=/usr/local/openssl

./config-t

Make---compile OpenSSL

Description if edit error Gcc:command not found, Internet Explorer found I installed without GCC compiler, execute command yum-y install GCC (note, be sure to forget the smooth, otherwise not installed)

Then in execution: make install

If the following error occurs during installation: POD document had syntax errors At/usr/bin/pod2man line 69. make. So, fix the following: Rm/usr/bin/pod2man

Second, install the zlib command

I downloaded the zlib-1.2.8.tar.xz.

Xz-d Zlib-1.2.8.tar.xz extract into Zlib-1.2.8.tar

Tar xvf Zlib-1.2.8.tar

CD zlib-1.2.8

./configure--prefix=/usr/local/zlib

Make &make Install

Installation of zlib more smoothly

Third, install Nginx

Tar zxvf nginx-1.11.1.tar.gz

CD nginx-1.11.1

./configure--prefix=/usr/local/nginx--with-pcre=.. /pcre-8.38--with-zlib=/usr/local/zlib--with-openssl=/usr/local/openssl

Note--with-pcre must point to the pcre-8.38.tar.gz directory, the other points to the installation directory can be

Make&make Install

Note If a fatal error occurs: Zlib.h: There is no file or directory--with-zlib the extracted directory that points to Zlib-1.2.8.tar

Four Nginx Boot

CD Usr/local/nginx/sbin./nginx
Start successfully, you can see the effect by entering localhost in the browser

Installing Nginx under Linux

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.