Linux:centos 7 Installing Nginx

Source: Internet
Author: User
Tags openssl

Nginx is a lightweight, high-performance HTTP and reverse proxy server, also a IMAP/POP3/SMTP server. In the case of high concurrency, as a substitute for Apache, the effect is very good.

CentOS 7 Installation Nginx:

First, install the need for Nginx library

1.pcre

(1) Locate the suffix. tar.gz source installation package in http://www.pcre.org/. Download it with the wget command.

$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz

(2) Decompression

$ tar zvxf pcre-8.38.tar.gz

$ CD pcre-8.38/

(3) configuration, installation

$./configure--prefix=/usr/local/pcre

$ make

$ make Install

During the error, because I did not compile the C environment, do:

$ yum install-y gcc gcc-c++

Install the Make & make install again after execution

$ CD.

2.openssl

OpenSSL get Address: http://www.openssl.org/source/

$ wget https://www.openssl.org/source/openssl-1.1.0-pre5.tar.gz

$ tar zvxf openssl-1.1.0-pre5.tar.gz

$ CD openssl-1.1.0-pre5/

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

$ chmod a+x apps/ca.pl

$ chmod a+x Apps/tsget

$ chmod a+x Tools/c_rehash

$ make

$ make Install

$ CD.

3.zlib

Zlib Get Address: http://www.zlib.net/

$ wget http://zlib.net/zlib-1.2.8.tar.gz

$ tar zvxf zlib-1.2.8.tar.gz

$ CD zlib-1.2.8/

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

$ make

$ make Install

$ CD.

Second, install Nginx

$ wget http://nginx.org/download/nginx-1.10.0.tar.gz

$ tar zvxf nginx-1.10.0.tar.gz

$ CD nginx-1.10.0/

$./configure--prefix=/usr/local/nginx--with-pcre=/root/nginx_root/pcre_root/pcre-8.38--with-zlib=/root/nginx_ root/zlib_root/zlib-1.2.8

(Change to the path when extracting, not the path of the installation.) The hint can not find which is--with-its decompression path)

$ make

$ make Install

$ CD.

Three, start Nginx

$ cd/usr/local/nginx/sbin/

$./nginx

Open the browser to access 127.0.0.1, the following interface is successful.

May execute $./nginx failed, prompting 0.0.0.0:80 to be occupied.

Open 127.0.0.1 to see what the current interface, if Apache HTTP, executes:

$ Service httpd Stop

Linux:centos 7 Installing Nginx

Related Article

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.