Centos7 nginx安装过程

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Centos7 nginx安装过程相关的知识,希望对你有一定的参考价值。

一、Centos版本:

  cat /etc/centos-release

  CentOS Linux release 7.1.1503 (Core)    

二、nginx下载

  官网:http://nginx.org/

  版本:nginx-1.8.1.tar.gz

三、安装

  解压:tar -xvf nginx-1.8.1.tar.gz

  移动到解压目录下

  ./configure

  报错:

  ./configure: error: the HTTP rewrite module requires the PCRE library.
  You can either disable the module by using --without-http_rewrite_module
  option, or install the PCRE library into the system, or build the PCRE library
  statically from the source with nginx by using --with-pcre=<path> option.

  执行安装:

  yum -y install pcre-devel

  再次执行./configure

  报错:

  ./configure: error: the HTTP gzip module requires the zlib library.
  You can either disable the module by using --without-http_gzip_module
  option, or install the zlib library into the system, or build the zlib library
  statically from the source with nginx by using --with-zlib=<path> option.

  安装:

  yum install -y zlib-devel

  再次./configure

  技术分享

  成功。

  make

  make install

  cd /usr/local/nginx/sbin

  ./nginx

  技术分享

  成功!!!

 

以上是关于Centos7 nginx安装过程的主要内容,如果未能解决你的问题,请参考以下文章

centos7搭建nginx日志

centos 7.0 nginx 1.7.9成功安装过程

CentOS7 安装配置 Nginx

CentOS7 安装配置 Nginx

(转) centos 7.0 nginx 1.7.9成功安装过程

(转)Centos7 Nginx安装