Nginx的平滑升级小记
星期日, 2010-07-25 | Author: Lee | php | 5,363 views
升级nginx的基本过程,以下是在CentOS环境下升级过程中小结得来的。
1、查看当然版本
#cd /usr/local/nginx/ #进入Nginx安装目录
# sbin/nginx -V #查看版本
nginx version: nginx/0.7.36
configure arguments: –user=www –group=www –prefix=/usr/local/nginx –with-http_stub_status_module –with-http_ssl_module #编译项
得到原来./configure 的编译项
2.下载最新版
前往查看最新版,http://nginx.org/en/download.html
#cd /data/soft/
#wget http://nginx.org/download/nginx-0.8.46.tar.gz #下载
#tar xzvf nginx-0.8.46.tar.gz #解压缩
#cd nginx-0.8.46
3.编译
#./configure –user=www –group=www –prefix=/usr/local/nginx –with-http_stub_status_module –with-http_ssl_module #按原来的选项configure
#make #编译
#mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old #移动旧版本
#cp objs/nginx /usr/local/nginx/sbin/ #复制新版本nginx过去
#cd /usr/local/nginx
#sbin/nginx -t #测试下,显示如下就是通过
the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
configuration file /usr/local/nginx/conf/nginx.conf test is successful
4.启动新的,关掉旧的
让nginx把nginx.pid改成nginx.pid.oldbin 跟着启动新的nginx
# kill -USR2 `cat /usr/local/nginx/nginx.pid`
退出旧的nignx
# kill -QUIT `cat /usr/local/nginx/nginx.pid.oldbin`
5.升级完成。
# sbin/nginx -V
nginx version: nginx/0.8.46
TLS SNI support disabled
configure arguments: –user=www –group=www –prefix=/usr/local/nginx –with-http_stub_status_module –with-http_ssl_modulecal
文章作者: Lee
本文地址: https://www.pomelolee.com/646.html
除非注明,Pomelo Lee文章均为原创,转载请以链接形式标明本文地址
No comments yet.
Leave a comment
Search
相关文章
热门文章
最新文章
文章分类
- ajax (10)
- algorithm-learn (3)
- Android (6)
- as (3)
- computer (85)
- Database (30)
- disucz (4)
- enterprise (1)
- erlang (2)
- flash (5)
- golang (3)
- html5 (18)
- ios (4)
- JAVA-and-J2EE (186)
- linux (143)
- mac (10)
- movie-music (11)
- pagemaker (36)
- php (50)
- spring-boot (2)
- Synology群晖 (2)
- Uncategorized (6)
- unity (1)
- webgame (15)
- wordpress (33)
- work-other (2)
- 低代码 (1)
- 体味生活 (40)
- 前端 (21)
- 大数据 (8)
- 游戏开发 (9)
- 爱上海 (19)
- 读书 (4)
- 软件 (3)