码迷,mamicode.com
首页 > 其他好文 > 详细

centos7下安装nginx

时间:2017-07-06 12:12:09      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:local   依赖   prefix   问题   isa   nginx   make   ror   conf   

1.从官网(http://nginx.org/)下载安装包

  笔者下载版本为nginx-1.10.2.tar.gz

2.使用tar命令解压

  tar xvf nginx-1.10.2.tar.gz

  cd nginx-1.10.2/

  ./configure  --prefix=/usr/local/nginx   (prefix指定安装目录)

  注意:在此步骤中因为缺少相关依赖库会出现以下问题:

    ./configure: error: the HTTP rewrite module requires the PCRE library.

    直接安装pcre-devel解决问题
    yum -y install pcre-devel

    ./configure: error: the HTTP cache module requires md5 functions
    from OpenSSL library.   You can either disable the module by using
    --without-http-cache option, or install the OpenSSL library into the system,
    or build the OpenSSL library statically from the source with nginx by using
    --with-http_ssl_module --with-openssl=<path> options.

    直接安装openssl解决问题

    yum -y install openssl openssl-devel

  解决上述问题后重新执行

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

  make

  make install

  

3.安装完毕后去安装目录启动Nginx

  sh /usr/local/nginx/sbin/nginx

centos7下安装nginx

标签:local   依赖   prefix   问题   isa   nginx   make   ror   conf   

原文地址:http://www.cnblogs.com/qingshuhu/p/7125513.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!