zoukankan      html  css  js  c++  java
  • nginx之版本升级方法一

    非线上业务,纯属测试升级,线上业务不要采用此方法,可以采用官方推荐的平滑升级。

    环境

      Linux centos 7.7 nginx-1.10,2

      nginx升级到最新nginx-1.16.1

    一,官方下载最新源码

      wget http://nginx.org/download/nginx-1.16.1.tar.gz

    二,停掉旧nginx服务

      任意一种方法 kill or pkill or service stop ..... 都可以。

    三,查看旧nginx旧编译安装参数,修改旧nginx

      /usr/local/nginx/nginx -V

      ./configure --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.40 --with-zlib=/usr/local/src/zlib-1.2.11 --with-openssl=/usr/local/openssl-1.1.0f

      mv /usr/local/nginx/nginx nginx.old

    四,解压,假设在/home/xxx/目录

      cd nginx-1.16.1

      ./configure --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.40 --with-zlib=/usr/local/src/zlib-1.2.11 --with-openssl=/usr/local/openssl-1.1.0f

      make

      只编译不安装 

      cp /home/xxx/nginx-1.16.1/objs/nginx /usr/local/nginx/nginx

    五,测试加载配置文件

      /usr/local/nginx/nginx -t -c nginx.conf

      nginx -t -c nginx.conf
      nginx: the configuration file /usr/local/nginx/nginx.conf syntax is ok
      nginx: configuration file /usr/local/nginx/nginx.conf test is successful

      可以常事加载

    六,查看新安装当前版本

      nginx -V
      nginx version: nginx/1.16.1
      built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
      built with OpenSSL 1.1.0f  25 May 2017
      TLS SNI support enabled
      configure arguments: --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.40 --with-zlib=/usr/local/src/zlib-1.2.11 --with-openssl=/usr/local/openssl-1.1.0f

    七,升级成功,启动

      service nginx start

      

    PHP中常见的问题点,知识点,及盲点。
  • 相关阅读:
    入门学习
    SQL语句
    Jmeter录制badboy
    post方式提交数据
    get向服务器提交数据
    手机端解析json
    生成JSON字符串
    新闻客户端
    从网络下载的图片加缓存功能
    消息队列机制messageQuene
  • 原文地址:https://www.cnblogs.com/sblack/p/12809034.html
Copyright © 2011-2022 走看看