升级nginx记录

 #查看当前版本及原配置,注意记录下此配置
[dongzw@localhost ~]$ /data/fdfs/nginx/sbin/nginx -V
nginx version: nginx/1.4.7
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC)
configure arguments: --prefix=/data/fdfs/nginx --add-module=/data/fdfs/soft/fastdfs-nginx-module/src --with-pcre=/data/fdfs/soft/pcre-8.35 --with-zlib=/data/fdfs/soft/zlib-1.2.8 --with-openssl=/data/fdfs/soft/openssl-1.0.1c
# 备份
[dongzw@localhost fdfs]$ mv nginx nginx_1.4.7_bak
# 下载:http://nginx.org/download/ 解压新版
[dongzw@localhost fdfs]$ tar -zxf nginx-1.18.0.tar.gz
[dongzw@localhost fdfs]$ ls
fastdfs  nginx-1.18.0  nginx-1.18.0.tar.gz  nginx_1.4.7_bak  soft
# 进入解压目录
[dongzw@localhost fdfs]$ cd nginx-1.18.0
# 根据原版本信息配置安装信息
[dongzw@localhost nginx-1.18.0]$ ./configure --prefix=/data/fdfs/nginx --add-module=/data/fdfs/soft/fastdfs-nginx-module/src --with-pcre=/data/fdfs/soft/pcre-8.35 --with-zlib=/data/fdfs/soft/zlib-1.2.8 --with-openssl=/data/fdfs/soft/openssl-1.0.1c
checking for OS
 + Linux 3.10.0-862.el7.x86_64 x86_64
...........
[dongzw@localhost nginx-1.18.0]$ echo $?
0
# 编译
[dongzw@localhost nginx-1.18.0]$ make
............
sed -e "s|%%PREFIX%%|/data/fdfs/nginx|" \
        -e "s|%%PID_PATH%%|/data/fdfs/nginx/logs/nginx.pid|" \
        -e "s|%%CONF_PATH%%|/data/fdfs/nginx/conf/nginx.conf|" \
        -e "s|%%ERROR_LOG_PATH%%|/data/fdfs/nginx/logs/error.log|" \
        < man/nginx.8 > objs/nginx.8
make[1]: Leaving directory `/data/fdfs/nginx-1.18.0'
[dongzw@localhost nginx-1.18.0]$ echo $?
0
# 安装
[dongzw@localhost nginx-1.18.0]$ make install
...........
[dongzw@localhost nginx-1.18.0]$ echo $?
0
# 查看新版本号
[dongzw@localhost nginx]$ sbin/nginx -V
nginx version: nginx/1.18.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC)
configure arguments: --prefix=/data/fdfs/nginx --add-module=/data/fdfs/soft/fastdfs-nginx-module/src --with-pcre=/data/fdfs/soft/pcre-8.35 --with-zlib=/data/fdfs/soft/zlib-1.2.8 --with-openssl=/data/fdfs/soft/openssl-1.0.1c
# 备份新配置文件
[dongzw@localhost conf]$ cp nginx.conf nginx.conf_bak
# copy原配置文件到新目录
[dongzw@localhost conf]$ cp /data/fdfs/nginx_1.4.7_bak/conf/nginx.conf ./
# 启动
[dongzw@localhost nginx]$ sbin/nginx -c conf/nginx.conf
ngx_http_fastdfs_set pid=13130
# 停止
[dongzw@localhost nginx]$ sbin/nginx -s stop
ngx_http_fastdfs_set pid=13139
 

安装可查看其它文章:https://mp.csdn.net/console/editor/html/103955900

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值