# /usr/local/nginx/sbin/nginx -V nginx: nginx version: nginx/1.0.5 nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-50) nginx: TLS SNI support disabled nginx: configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_flv_module --with-cc-opt=-O3 --with-cpu-opt=opteron --with-http_gzip_static_module※ 注意红色区域,这是以前编译的参数。马上编辑新版本需要用到。 2.下载新版本:http://nginx.org/en/download.html 然后:解压 > 便以前的准备 > 编译 # tar zxvf nginx-1.0.5.tar.gz # cd nginx-1.0.5 # ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_flv_module --with-cc-opt='-O3' --with-cpu-opt=opteron --with-http_gzip_static_module # make3. 执行完后,这里不用在 make install 了,接下来重名/sbin/nginx为nginx.old # mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old4. 复制编译后objs目录下的nginx文件到nginx的安装目录sbin/下 # cp objs/nginx /usr/local/nginx/sbin/5. 测试一下新复制过来文件生效情况: # /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 successful6. 让nginx把nginx.pid文件修改成nginx.pid.oldbin,随即启动nginx,实现不间断服务运行 # kill -USR2 `cat /usr/local/nginx/nginx.pid`(发送平滑升级信号将旧的nginx.pid文件添加后缀nginx.pid.oldbin)#kill -WINCH(平缓停止worker process) `cat /usr/local/nginx/nginx.pid.oldbin # kill -QUIT `cat /usr/local/nginx/nginx.pid.oldbin`7. 升级完成了,最后在看一下升级后的版本 # /usr/local/nginx/sbin/nginx -v nginx: nginx version: nginx/1.0.5以上就介绍了nginx之平滑升级详解,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!
nginx之平滑升级详解
相关教程推荐
其他课程推荐
- PR值查询代码制作
- ASP用JMail、CDO发送邮件
- asp存储过程使用大全
- 打包上传asp网站
- AspJpeg V1.5.0 破解版
- VB、VBS 、ASP、VBA 的 UTF-8 MD5 实现
- ASP Response 对象
- Android学习笔记5:Android与ASP通过http协议交换数据
- PHP ASP共享会话
- 旅行社微信电子会员卡系统asp源码
- 分页类,异常类
- asp缓存类
- JavaScript面向对象的两种书写方法以及差别
- ASP使用三层架构asp中使用类
- 文件、目录,文本文件等多种操作类
- 遭遇ASP类的事件设计
- 统计有多少行JS代码和ASP代码
- 管理员登录
- ASP里面令人震撼地Debug类(VBScript)
- ASP中类Class相关内容的整理资料