LNMP:Nginx 平滑升级 tengine

安装 tengine 备份nginx配置文件:

wget -c http://tengine.taobao.org/download/tengine-2.2.0.tar.gz
tar zxvf tengine-2.2.0.tar.gz
cd tengine-2.2.0
./configure
make
mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old
cp -r objs/nginx /usr/local/nginx/sbin/nginx

vim /usr/local/nginx/conf/nginx.conf

删除如下代码:

location /status {

stub_status on;

access_log off;

}

检测是否正常:

/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”为正常

重启nginx:

kill -USR2 `cat /usr/local/nginx/logs/nginx.pid`
kill -QUIT `cat /usr/local/nginx/logs/nginx.pid.oldbin`
/etc/init.d/nginx stop
/etc/init.d/nginx start

查看nginx版本:

/usr/local/nginx/sbin/nginx -v

共有 1 条评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注