add wordops version into upstream.conf
This commit is contained in:
115
install
115
install
@@ -425,70 +425,73 @@ wo_upgrade_nginx() {
|
|||||||
rm -f /tmp/nginx-wo.key
|
rm -f /tmp/nginx-wo.key
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
|
|
||||||
# stop nginx
|
CHECK_NGINX_UPSTREAM_VERSION=$(grep "v3.9.5" /etc/nginx/conf.d/upstream.conf)
|
||||||
service nginx stop
|
if [ -z "$CHECK_NGINX_UPSTREAM_VERSION" ]; then
|
||||||
|
|
||||||
# prevent apt preference to block install
|
# stop nginx
|
||||||
[ -f /etc/apt/preferences.d/nginx-block ] && {
|
service nginx stop
|
||||||
mv /etc/apt/preferences.d/nginx-block "$HOME/nginx-block"
|
|
||||||
}
|
|
||||||
|
|
||||||
# install new nginx package
|
# prevent apt preference to block install
|
||||||
if [ -x /usr/local/bin/wo ]; then
|
[ -f /etc/apt/preferences.d/nginx-block ] && {
|
||||||
|
mv /etc/apt/preferences.d/nginx-block "$HOME/nginx-block"
|
||||||
|
}
|
||||||
|
|
||||||
if [ -n "$CHECK_NGINX_EE" ]; then
|
# install new nginx package
|
||||||
# remove previous package
|
if [ -x /usr/local/bin/wo ]; then
|
||||||
apt-mark unhold nginx-ee nginx-common nginx-custom
|
|
||||||
apt-get -y -qq autoremove nginx-ee nginx-common nginx-custom --purge
|
if [ -n "$CHECK_NGINX_EE" ]; then
|
||||||
rm -rf /etc/nginx
|
# remove previous package
|
||||||
elif [ -n "$CHECK_NGINX_WO" ]; then
|
apt-mark unhold nginx-ee nginx-common nginx-custom
|
||||||
apt-mark unhold nginx-wo nginx-common nginx-custom
|
apt-get -y -qq autoremove nginx-ee nginx-common nginx-custom --purge
|
||||||
apt-get -y -qq autoremove nginx-wo nginx-common nginx-custom --purge
|
rm -rf /etc/nginx
|
||||||
rm -rf /etc/nginx
|
elif [ -n "$CHECK_NGINX_WO" ]; then
|
||||||
|
apt-mark unhold nginx-wo nginx-common nginx-custom
|
||||||
|
apt-get -y -qq autoremove nginx-wo nginx-common nginx-custom --purge
|
||||||
|
rm -rf /etc/nginx
|
||||||
|
fi
|
||||||
|
|
||||||
|
# remove previous php-fpm pool configuration
|
||||||
|
if [ -n "$CHECK_PHP72" ]; then
|
||||||
|
apt-get remove php7.2-fpm -y -qq --purge
|
||||||
|
rm -f /etc/php/7.2/fpm/pool.d/*
|
||||||
|
fi
|
||||||
|
/usr/local/bin/wo stack install --nginx --php
|
||||||
|
if [ -n "$CHECK_PHP73" ]; then
|
||||||
|
apt-get remove php7.3-fpm -y -qq --purge
|
||||||
|
rm -f /etc/php/7.3/fpm/pool.d/*
|
||||||
|
/usr/local/bin/wo stack install --php73
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# remove previous php-fpm pool configuration
|
# restore sites and configuration
|
||||||
if [ -n "$CHECK_PHP72" ]; then
|
/usr/bin/rsync -auz /var/lib/wo-backup/nginx/ /etc/nginx/
|
||||||
apt-get remove php7.2-fpm -y -qq --purge
|
|
||||||
rm -f /etc/php/7.2/fpm/pool.d/*
|
# update redis.conf headers
|
||||||
|
if [ -f /etc/nginx/common/redis.conf ]; then
|
||||||
|
sed -i "s/X-Cache /X-SRCache-Fetch-Status /g" /etc/nginx/common/redis.conf
|
||||||
|
sed -i "s/X-Cache-2 /X-SRCache-Store-Status /g" /etc/nginx/common/redis.conf
|
||||||
|
|
||||||
fi
|
fi
|
||||||
/usr/local/bin/wo stack install --nginx --php
|
|
||||||
if [ -n "$CHECK_PHP73" ]; then
|
VERIFY_NGINX_CONFIG=$(nginx -t 2>&1 | grep failed)
|
||||||
apt-get remove php7.3-fpm -y -qq --purge
|
# check if nginx -t do not return errors
|
||||||
rm -f /etc/php/7.3/fpm/pool.d/*
|
if [ -z "$VERIFY_NGINX_CONFIG" ]; then
|
||||||
/usr/local/bin/wo stack install --php73
|
systemctl stop nginx
|
||||||
|
systemctl start nginx
|
||||||
|
else
|
||||||
|
VERIFY_NGINX_BUCKET=$(nginx -t 2>&1 | grep "server_names_hash_bucket_size")
|
||||||
|
if [ -n "$VERIFY_NGINX_BUCKET" ]; then
|
||||||
|
sed -i "s/# server_names_hash_bucket_size 64;/server_names_hash_bucket_size 64;/g" /etc/nginx/nginx.conf
|
||||||
|
fi
|
||||||
|
systemctl stop nginx
|
||||||
|
systemctl start nginx
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# set back apt preference
|
||||||
|
[ -f "$HOME/nginx-block" ] && {
|
||||||
|
mv "$HOME/nginx-block" /etc/apt/preferences.d/nginx-block
|
||||||
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# restore sites and configuration
|
|
||||||
/usr/bin/rsync -auz /var/lib/wo-backup/nginx/ /etc/nginx/
|
|
||||||
|
|
||||||
# update redis.conf headers
|
|
||||||
if [ -f /etc/nginx/common/redis.conf ]; then
|
|
||||||
sed -i "s/X-Cache /X-SRCache-Fetch-Status /g" /etc/nginx/common/redis.conf
|
|
||||||
sed -i "s/X-Cache-2 /X-SRCache-Store-Status /g" /etc/nginx/common/redis.conf
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
VERIFY_NGINX_CONFIG=$(nginx -t 2>&1 | grep failed)
|
|
||||||
# check if nginx -t do not return errors
|
|
||||||
if [ -z "$VERIFY_NGINX_CONFIG" ]; then
|
|
||||||
systemctl stop nginx
|
|
||||||
systemctl start nginx
|
|
||||||
else
|
|
||||||
VERIFY_NGINX_BUCKET=$(nginx -t 2>&1 | grep "server_names_hash_bucket_size")
|
|
||||||
if [ -n "$VERIFY_NGINX_BUCKET" ]; then
|
|
||||||
sed -i "s/# server_names_hash_bucket_size 64;/server_names_hash_bucket_size 64;/g" /etc/nginx/nginx.conf
|
|
||||||
fi
|
|
||||||
systemctl stop nginx
|
|
||||||
systemctl start nginx
|
|
||||||
fi
|
|
||||||
|
|
||||||
# set back apt preference
|
|
||||||
[ -f "$HOME/nginx-block" ] && {
|
|
||||||
mv "$HOME/nginx-block" /etc/apt/preferences.d/nginx-block
|
|
||||||
}
|
|
||||||
|
|
||||||
} >> "$wo_install_log" 2>&1
|
} >> "$wo_install_log" 2>&1
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Common upstream settings
|
# NGINX UPSTREAM CONFIGURATION v3.9.5
|
||||||
|
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
# PHP 5.6
|
# PHP 5.6
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user