zoukankan      html  css  js  c++  java
  • centos 7编译安装nginx

    一、安装nginx时必须先安装相应的编译工具
    yum -y install gcc gcc-c++ autoconf automake
    yum -y install zlib zlib-devel openssl openssl-devel pcre-devel

    建立nginx 组
    groupadd -r nginx
    useradd -s /sbin/nologin -g nginx -r nginx
    id nginx

    创建目录

    mkdir -p /var/tmp/nginx/client

    zlib:nginx提供gzip模块,需要zlib库支持
    openssl:nginx提供ssl功能
    pcre:支持地址重写rewrite功能

    二、tar -zxvf nginx-1.2.8.tar.gz

    三、cd nginx-1.2.8

    四、./configure
    --prefix=/usr
    --sbin-path=/usr/sbin/nginx
    --conf-path=/etc/nginx/nginx.conf
    --error-log-path=/var/log/nginx/error.log
    --pid-path=/var/run/nginx/nginx.pid
    --user=nginx
    --group=nginx
    --with-http_ssl_module
    --with-http_flv_module
    --with-http_gzip_static_module
    --http-log-path=/var/log/nginx/access.log
    --http-client-body-temp-path=/var/tmp/nginx/client
    --http-proxy-temp-path=/var/tmp/nginx/proxy
    --http-fastcgi-temp-path=/var/tmp/nginx/fcgi
    --with-http_stub_status_module

    在同一个目录的配置

    ./configure
    --prefix=/usr/local/nginx
    --sbin-path=/usr/local/nginx/nginx 
    --conf-path=/usr/local/nginx/conf/nginx.conf
    --error-log-path=/var/log/nginx/error.log
    --pid-path=/usr/local/nginx/nginx.pid
    --user=nginx
    --group=nginx
    --with-http_ssl_module
    --with-http_flv_module
    --with-http_gzip_static_module
    --http-log-path=/var/log/nginx/access.log
    --http-client-body-temp-path=/var/tmp/nginx/client
    --http-proxy-temp-path=/var/tmp/nginx/proxy
    --http-fastcgi-temp-path=/var/tmp/nginx/fcgi
    --with-http_stub_status_module

    五、make && make install


    小结:centos没有安装make编译器
    解决:yum -y install gcc automake autoconf libtool make

  • 相关阅读:
    JavaScript二(第一个js程序)
    JavaScript简述一
    选择合适的Linux版本
    jQuery(一)引入
    Java从零开始学零(Java简介)
    正则表达式
    通过Servlet生成验证码图片(转)
    监听器(web基础学习笔记二十二)
    利用Session完成用户的登录和注销
    Spring Security OAuth 2.0
  • 原文地址:https://www.cnblogs.com/wangshuyi/p/6339476.html
Copyright © 2011-2022 走看看