首页 技术 正文
技术 2022年11月20日
0 收藏 677 点赞 3,411 浏览 3480 个字

wget  http://tengine.taobao.org/download/tengine-1.5.1.tar.gz //下载Tengine1.5.1版本

tar zxvf tengine-1.5.1.tar.gz //解压到当前目录

cd tengine-1.5.1 //进入到目录

./configure //执行安装脚本

make //编译安装

mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old //备份nginx的配置文件,路径参考你自己的

cp -r objs/nginx /usr/local/nginx/sbin/nginx //复制Tengine文件到nginx下

#vi /usr/local/nginx/conf/nginx.conf //编辑nginx.conf,删除如下代码
#location /status {
#stub_status on;
#access_log off;
#}

kill -USR2 `cat /usr/local/nginx/logs/nginx.pid`
kill -QUIT `cat /usr/local/nginx/logs/nginx.pid.oldbin`
//结束nginx进程

/usr/local/nginx/sbin/nginx -v //查看nginx版本号
返回带有Tengine版本号等信息则升级成功!

/*
************************************
**卸载Tengine,换回Nginx
************************************
*/
rm -rf /usr/local/nginx/sbin/nginx //删除Tengine配置文件

mv /usr/local/nginx/sbin/nginx.lod /usr/local/nginx/sbin/nginx  //恢复备份的nginx配置文件,路径参考你自己的

/etc/init.d/nginx restart //重启nginx

/usr/local/nginx/sbin/nginx -v //查看nginx版本号
返回带有Nginx版本号则卸载成功

实验如下:

[root@qike tengine-2.1.0]# kill -USR2 `cat /usr/local/nginx/logs/nginx.pid`  //  平滑升级  会在/usr/local/nginx/logs/ 下生成了nginx.pid.oldbin (以前的nginx进程号)  nginx.pid现在变为tengine的进程号.
[root@qike tengine-2.1.0]# cd  /usr/local/nginx/logs/
[root@qike logs]# ls -lh
total 48K
-rw-r–r– 1 root root   46 Jul  4 00:19 aa
-rw-r–r– 1 root root 5.2K Jun 20 23:29 access.log
-rw-r–r– 1 root root  17K Aug  2 20:49 error.log
-rw-r–r– 1 root root    6 Aug  2 20:49 nginx.pid
-rw-r–r– 1 root root    6 Jul 27 23:36 nginx.pid.oldbin
drwxr-xr-x 2 root root 4.0K Jul  6 14:53 old
-rw-r–r– 1 root root  209 Jul  4 00:01 test
[root@qike logs]# cat /usr/local/nginx/logs/nginx.pid
31941
[root@qike logs]# cat /usr/local/nginx/logs/nginx.pid.oldbin
24372
[root@qike logs]# ps -ef |grep  nginx    
root     24372     1  0 Jul27 ?        00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
nobody   24373 24372  0 Jul27 ?        00:00:14 nginx: worker process                                          
nobody   24374 24372  0 Jul27 ?        00:00:13 nginx: worker process                                          
nobody   24375 24372  0 Jul27 ?        00:00:15 nginx: worker process                                          
nobody   24376 24372  0 Jul27 ?        00:00:12 nginx: worker process                                          
root     31941 24372  0 20:49 ?        00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
nobody   31942 31941  0 20:49 ?        00:00:00 nginx: worker process                                          
nobody   31943 31941  0 20:49 ?        00:00:00 nginx: worker process                                          
nobody   31944 31941  0 20:49 ?        00:00:00 nginx: worker process                                          
nobody   31945 31941  0 20:49 ?        00:00:00 nginx: worker process                                          
root     32023 25663  0 20:50 pts/2    00:00:00 grep nginx
[root@qike logs]# kill -QUIT `cat /usr/local/nginx/logs/nginx.pid.oldbin`  //kill -QUIT  旧进程号(老进程)    会把旧的进程和nginx.pid.oldbin 这个文件干掉

[root@qike logs]# ps -ef |grep  nginx
root     31941     1  0 20:49 ?        00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
nobody   31942 31941  0 20:49 ?        00:00:00 nginx: worker process                                          
nobody   31943 31941  0 20:49 ?        00:00:00 nginx: worker process                                          
nobody   31944 31941  0 20:49 ?        00:00:00 nginx: worker process                                          
nobody   31945 31941  0 20:49 ?        00:00:00 nginx: worker process                                          
root     32073 25663  0 20:51 pts/2    00:00:00 grep nginx
[root@qike logs]# nginx -v
Tengine version: Tengine/2.1.0 (nginx/1.6.2)

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,082
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,557
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,406
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,179
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,815
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,898