zoukankan      html  css  js  c++  java
  • nginx安装

    1:安装插件:
       yum install -y  gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
    
    2:下载nginx-1.15.5.tar.gz到指定目录/usr/local/mydown
    
    3:解压到当前目录下 tar zxf nginx-1.15.5.tar.gz .
    
    4、进入解压目录
       cd nginx-1.15.5
    
    5、编译nginx
        1)默认编译方式
        . /configure
    
        2)自定义编译选项
        . /configure  
        --user=nginx 
        --group=nginx 
        --prefix=/usr/local/nginx  
        --conf-path=/usr/local/nginx/conf/nginx.conf  
        --pid-path=/usr/local/nginx/conf/nginx.pid  
        --lock-path=/var/lock/nginx.lock  
        --error-log-path=/var/log/nginx/error.log  
        --http-log-path=/var/log/nginx/access.log  
        --with-http_gzip_static_module  
        --http-client-body-temp-path=/var/temp/nginx/client  
        --http-proxy-temp-path=/var/temp/nginx/proxy  
        --http-fastcgi-temp-path=/var/temp/nginx/fastcgi  
        --http-uwsgi-temp-path=/var/temp/nginx/uwsgi  
        --http-scgi-temp-path=/var/temp/nginx/scgi
        --with-http_ssl_module
       注:以上为默认编译方式和具体指定的编译方式,任选以上这两种之一即可。--with-http_ssl_module这个选项是https的重要模块必须安装。
    
        3)本文中使用的编译安装方式
        ./configure 
        --prefix=/usr/local/nginx 
        --conf-path=/usr/local/nginx/conf/nginx.conf  
        --pid-path=/usr/local/nginx/conf/nginx.pid  
        --with-http_gzip_static_module 
        --with-http_stub_status_module  #监控其运行状态
        --with-http_ssl_module          #https
    
    6、安装nginx
        make && make install
    
    7、启动nginx
        1)启动nginx
        /usr/local/nginx/sbin/nginx
        Centos7 配置Nginx实现HTTPS
    
        2)关闭nginx
        /usr/local/nginx/sbin/nginx -s stop
    
        3)重启nginx
        /usr/local/nginx/sbin/nginx -s reload
    
        4)检查nginx
        /usr/local/nginx/sbin/nginx -t
    
    8、配制环境变量
       vim /etc/profile
       export NGINX_HOME=/usr/local/nginx
       export PATH=$JAVA_HOME/bin:$NGINX_HOME/sbin:$PATH
       使环境变量生效
       source /etc/profile
  • 相关阅读:
    转载:MyBatis获取插入记录的自增长字段值
    006---抽象类
    005---组合
    004---继承与派生
    003---属性查找和绑定方法
    002---类与对象
    001---面向对象和面向过程的区别
    017---Django的中间件解决跨域
    10---git安装
    007---归并排序
  • 原文地址:https://www.cnblogs.com/feiyun126/p/11382076.html
Copyright © 2011-2022 走看看