Nginx无缝升级0.8XX
首先登录nginx官方下载页选择最新的版本
http://nginx.org/en/download.html
我选择的是nginx/0.8.39 for linux
我升级基础为imcat的lnmp一键安装包
[root@gke /]# cd /usr/local/nginx/
[root@gke nginx]# sbin/nginx -V #查看版本
nginx version: nginx/0.7.61
built by gcc 4.1.2 20080704 (Red Hat 4.1.2-48)
TLS SNI support disabled
configure arguments: –user=www –group=www –prefix=/usr/local/nginx –with-http_stub_status_module –with-http_ssl_module#注意这里的编译项
[root@gke nginx]# cd /
[root@gke /]# wget http://nginx.org/download/nginx-0.8.39.tar.gz
[root@gke /]# tar zxvf nginx-0.8.39.tar.gz
[root@gke /]# cd nginx-0.8.39
[root@gke nginx-0.8.39]# ./configure –user=www –group=www –prefix=/usr/local/nginx –with-http_stub_status_module –with-http_ssl_module #按原来的选项configure
[root@gke nginx-0.8.39]# make #编译
[root@gke nginx-0.8.39]# mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old #移动旧版本
[root@gke nginx-0.8.39]# cp objs/nginx /usr/local/nginx/sbin/nginx #复制新版本nginx过去
[root@gke nginx-0.8.39]# make upgrade #无缝升级,当前连接不会断
[root@gke nginx-0.8.39]# cd /usr/local/nginx/
[root@gke nginx]# sbin/nginx -V
nginx version: nginx/0.8.39
built by gcc 4.1.2 20080704 (Red Hat 4.1.2-48)
TLS SNI support disabled
configure arguments: –user=www –group=www –prefix=/usr/local/nginx –with-http_stub_status_module –with-http_ssl_module
[root@gke /]# cd /
[root@gke /]# rm -rf nginx-0.8.39 nginx-0.8.39.tar.gz #清理残留的文件
升级完毕!最后重启nginx和php即完成最后的一步!