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

centos 7编译安装nginx

时间:2017-04-04 01:16:37      阅读:110      评论:0      收藏:0      [点我收藏+]

标签:nginx

  1. 禁用防火墙

    systemctl disable firewalld

    systemctl stop firewalld

    setenforce 0

  2. 安装pcre库 

    yum install pcre*

  3. 安装zlib库

    yum install zlib*

  4. 增加nginx用户:useradd nginx -G nginx

  5. 编译安装nginx:

    ./configure --prefix=/usr/local/nginx --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --user=nginx --group=nginx 

    make && make install

  6. 启动nginx:

    cd /usr/local/nginx/sbin

    nohup ./nginx &

centos 7编译安装nginx

标签:nginx

原文地址:http://zhengqizhq.blog.51cto.com/690602/1912729

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