标题:
[分享]
nginx升级脚本可选版本
[打印本页]
作者:
dominic1012
时间:
2018-12-21 10:06
标题:
nginx升级脚本可选版本
#!/bin/bash
#wdcp update script
#
http://www.wdlinux.cn/wdcp
cd ~
echo "Select version
1 nginx-1.15.7
2 nginx-1.14.2
"
sleep 0.1
read -p "Please Input 1,2 " SERVER_ID
if [[ $SERVER_ID == 1 ]]; then
SERVER="1.15.7"
elif [[ $SERVER_ID == 2 ]]; then
SERVER="1.14.2"
else
exit
fi
wget -c http://www.nginx.org/download/nginx-$SERVER.tar.gz
tar zxvf nginx-$SERVER.tar.gz
cd nginx-$SERVER
./configure --user=www --group=www --prefix=/www/wdlinux/nginx-$SERVER --with-http_stub_status_module --with-http_ssl_module
if [[ $? != 0 ]];then
pcre_ins
./configure --user=www --group=www --prefix=/www/wdlinux/nginx-$SERVER --with-http_stub_status_module --with-http_ssl_module
fi
make
[ $? != 0 ] && echo "make err" && exit
make install
[ $? != 0 ] && echo "install err" && exit
cp /www/wdlinux/nginx/conf/wdcp.conf /www/wdlinux/nginx-$SERVER/conf/
cp /www/wdlinux/nginx/conf/nginx.conf /www/wdlinux/nginx-$SERVER/conf/
cp /www/wdlinux/nginx/conf/fcgi.conf /www/wdlinux/nginx-$SERVER/conf/
cp -pR /www/wdlinux/nginx/conf/rewrite /www/wdlinux/nginx-$SERVER/conf/
cp -pR /www/wdlinux/nginx/conf/vhost /www/wdlinux/nginx-$SERVER/conf/
service nginxd stop
rm -f /www/wdlinux/nginx
ln -s /www/wdlinux/nginx-$SERVER /www/wdlinux/nginx
service nginxd start
echo
rm -fr nginx*
echo "Updated successfully";
欢迎光临 WDlinux官方论坛 (http://wdlinux.cn/bbs/)
Powered by Discuz! 7.2