<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/ DTD/wml_1.1.xml">

<wml>
<head>
<meta http-equiv="cache-control" content="max-age=180,private" />
</head>
<card title="Nginx无缝升级0.8XX ">
<p>
作者:<a href="index.php?action=showuser&amp;userid=1&amp;hash=">admin</a><br />时间:2010-07-25 15:34<br />分类:<a href="index.php?action=list&amp;cid=3&amp;hash=">电脑技术</a><br />内容:
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: &ndash;user=www &ndash;group=www &ndash;prefix=/usr/local/nginx &ndash;with-http_stub_status_module &ndash;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 &ndash;user=www &ndash;group=www &ndash;prefix=/usr/local/nginx &ndash;with-http_stub_status_module &ndash;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: &ndash;user=www &ndash;group=www &ndash;prefix=/usr/local/nginx &ndash;with-http_stub_status_module &ndash;with-http_ssl_module
[root@gke /]# cd /
[root@gke /]# rm -rf nginx-0.8.39 nginx-0.8.39.tar.gz #清理残留的文件




升级完毕！最后重启nginx和php即完成最后的一步！
</p><p>
<a href="index.php?action=login&amp;hash=">立即登陆发表评论</a><br />
</p>
<p><a href="index.php?action=list&amp;hash=">返回日志列表</a><br /><a href="index.php?action=index&amp;hash=">返回主页</a></p>
</card>
</wml>
