zoukankan      html  css  js  c++  java
  • 升级nginx版本

    线上环境中一台服务器的nginx版本是1.4.2

    查看当前版本,这是一些当前安装的一些模块和包,显然这些已经不能满足现在的需求了

    [root@iZwz9ctckj6hl6tm4lgevyZ ~]# /usr/local/nginx/sbin/nginx -V
    nginx version: nginx/1.4.2
    built by gcc 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC)
    TLS SNI support enabled
    configure arguments: --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --add-module=../ngx_pagespeed-release-1.6.29.5-beta/

    编译安装的环境和依赖的库

    yum install gcc gcc-c++ pcre* zlib-devel openssl-devel gd-devel  php php-mysql php-fpm -y

    上传nginx包

    解压 tar zxf  nginx-1.13.9.tar.gz

    进入目录

    nginx-1.13.9

    ./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-http_image_filter_module --with-http_slice_module --with-mail --with-threads --with-file-aio --with-stream --with-mail_ssl_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-pcre --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module && make

    进入原先的nginx的sbin目录里 备份一下nignx

    cd /usr/local/nginx/sbin/

    cp nginx nginx.old2

    进入到刚编译的nginx1.13.9

    cd /root/nginx-1.13.9/objs/

    cp nginx /usr/local/nginx/sbin/

    覆盖掉原来的nginx

    摁 y

    检查一下配置有没有问题

    /usr/local/nginx/sbin/nginx -t

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

    没有问题

    查看一下当前版本

    [root@iZwz9ctckj6hl6tm4lgevyZ conf]# /usr/local/nginx/sbin/nginx -V
    nginx version: nginx/1.13.9
    built by gcc 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC)
    built with OpenSSL 1.0.1e-fips 11 Feb 2013
    TLS SNI support enabled
    configure arguments: --prefix=/usr/local/nginx --user=www --group=www --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-http_image_filter_module --with-http_slice_module --with-mail --with-threads --with-file-aio --with-stream --with-mail_ssl_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-pcre --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module

    启动nginx

    /usr/local/nginx/sbin/nginx

    查看是否起来

    [root@iZwz9ctckj6hl6tm4lgevyZ conf]# ps aux | grep nginx
    root 18215 0.0 0.0 73448 1384 ? Ss 10:24 0:00 nginx: master process /usr/local/nginx/sbin/nginx
    www 18216 0.0 0.3 101100 29588 ? S 10:24 0:00 nginx: worker process
    www 18217 0.0 0.3 101100 29324 ? S 10:24 0:00 nginx: worker process
    www 18218 0.0 0.3 101100 29324 ? S 10:24 0:00 nginx: worker process
    www 18219 0.0 0.3 101100 29308 ? S 10:24 0:00 nginx: worker process
    root 18233 0.0 0.0 105368 888 pts/1 S+ 10:33 0:00 grep nginx

    nginx版本升级成功

    点一杯最爱的奶茶

  • 相关阅读:
    08-STM32+W5500+AIR202基本控制篇-实现功能1,功能2和功能4服务器搭建完成-测试通信
    07-STM32+W5500+AIR202基本控制篇-实现功能1,功能2和功能4服务器搭建-安装MQTT软件(Linux系统)
    07-STM32+W5500+AIR202基本控制篇-实现功能1,功能2和功能4服务器搭建-安装MQTT软件(.Windows系统)
    Ceph剖析:Paxos算法实现
    Linux命令小结:crontab/netstat/iostat/sar
    Ceph剖析:数据分布之CRUSH算法与一致性Hash
    Prometheus监控+Grafana+Alertmanager告警安装使用 (图文详解)
    Go语言mgo使用情况
    gob,protobuf,json在golang中的序列化效率对比
    golang json性能分析详解
  • 原文地址:https://www.cnblogs.com/qingyuanyuanxi/p/8491938.html
Copyright © 2011-2022 走看看