手动升级AMH-nginx脚本

作者:zqcheng    发布于3年前 (2015-05-31)    阅读:  452  次
cd /usr/local/;
Cpunum=`cat /proc/cpuinfo |grep 'processor'|wc -l`;
nginx_configure=`/usr/local/nginx/sbin/nginx -V 2> /tmp/nginx_configure && cat /tmp/nginx_configure | grep 'configure arguments' | cut -d: -f2 && rm -f /tmp/nginx_configure`;
wget http://nginx.org/download/nginx-1.8.0.tar.gz;
tar -zxf nginx-1.8.0.tar.gz;
cd nginx-1.8.0;
./configure $nginx_configure;
make -j $Cpunum;
mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx-old;
\cp -a ./objs/nginx /usr/local/nginx/sbin/;
kill -USR2 `cat /usr/local/nginx/logs/nginx.pid`;
cd /usr/local/;
rm -rf nginx-1.8.0 nginx-1.8.0.tar.gz /usr/local/nginx/sbin/nginx-old;
kill -QUIT `cat /usr/local/nginx/logs/nginx.pid.oldbin`;
sed -i "s|Nginx.*|Nginx 1.8.0" /home/wwwroot/index/web/View/index.php;

—————————————–

至此已升级完成,您也可以

/usr/local/nginx/sbin/nginx -V

查看当前Nginx版本信息。

添加新评论