Home >Backend Development >PHP Tutorial >nginx installation notes

nginx installation notes

WBOY
WBOYOriginal
2016-08-08 09:20:59837browse

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.21.tar.gz
  3. ssl function requires openssl library (Download: http://www.openssl.org/ ) openssl-1.0.1.tar.gz
    Note: If you use source code to install, you need to specify the compressed package path corresponding to –with-pcre when installing nginx later. If you use binary package to install, you do not need to specify

Dependent package one-click installation:

<code>yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel
yum -y groupinstall <span>"Development Tools"</span><span>"Development Libraries"</span> 此命令可以一键安装开发工具包</code>

Source code installation:

<code>openssl:
    tar -xzvf openssl-<span>1.0</span><span>.1</span><span>.tar</span><span>.gz</span>
    cd openssl-<span>1.0</span><span>.1</span>
    ./config(注意) && make && make install

<span>pcre:</span>
    tar -xzvf pcre-<span>8.21</span><span>.tar</span><span>.gz</span>
    cd pcre-<span>8.21</span>
    ./configure  && make && make install

<span>zlib:</span>
    tar -xzvf zlib-<span>1.2</span><span>.8</span><span>.tar</span><span>.gz</span>
    cd zlib-<span>1.2</span><span>.8</span>
    ./configure  && make && make install</code>

nginx installation command: Download address of each version of nginx: http://nginx.org/download/

<code>#注意 \ 前面至少一个有空格
./configure --prefix=/home/renwh/nginx
-<span>-with-http_ssl_module \
</span>-<span>-with-pcre=../pcre-<span>8.21</span> \  <span>#指向解压的源码目录</span></span>-<span>-with-zlib=../zlib-<span>1.2</span>.<span>8</span> \    <span>#指向解压的源码目录</span></span>-<span>-with-openssl=../openssl-<span>1.0</span>.<span>1</span> \ <span>#指向解压的源码目录</span></span></code>

Note: Compiled nginx can be passed /home/renwh/nginx -V (the specific path is mainly based on the installation) Check the parameters during compilation
Then just make, make install.

Reference link: http://www.cnblogs.com/siqi/p/3572695.html

Copyright statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.

The above has introduced the nginx installation notes, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn