首页 > 其他 > 详细

centos7下安装nginx

时间:2017-07-06 11:53:03      阅读:259      评论:0      收藏:0      [点我收藏+]

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!