CentOS平滑更新nginx版本

目前使用的nginx版本是1.4.4,平滑升级到nginx1.10.1,具体升级操作流程如下:

1.备份当前使用的nginx程序目录

tar -zcvf ./nginx1.4.4bak.tar.gz ./nginx-1.4.4/

2.下载最新稳定版
wget http://nginx.org/download/nginx-1.10.1.tar.gz

3.解压缩
tar -zxvf nginx-1.10.1.tar.gz

4.编译

先提前看一下目前使用的nginx版本编译参数有哪些,然后照搬过来
cd nginx-1.10.1
./configure --user=www \
--group=www \
--prefix=./nginx \
--with-http_stub_status_module \
--without-http-cache \
--with-http_ssl_module \
--with-http_gzip_static_module

5.停止现在使用的进程
./nginx-1.4.4/sbin/nginx -s stop

6.make,没make install
make

7.重命名原有的主进程程序
mv ./nginx-1.4.4/sbin/nginx ./nginx-1.4.4/sbin/nginx.old

8.把新编译好的主进程程序复制到原先主进程所在目录
cp nginx-1.10.1/objs/nginx ./nginx-1.4.4/sbin/nginx

9.启用程序
/etc/init.d/nginx start

10.查看版本

nginx -v

posted @ 2016-10-11 16:09  哈喽哈喽111111  阅读(628)  评论(0编辑  收藏  举报