update stack for php7.2/7.3
This commit is contained in:
104
install
104
install
@@ -7,7 +7,7 @@
|
|||||||
# Copyright (c) 2019 - WordOps
|
# Copyright (c) 2019 - WordOps
|
||||||
# This script is licensed under M.I.T
|
# This script is licensed under M.I.T
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
# Version 3.9.3 - 2019-03-04
|
# Version 3.9.3 - 2019-03-05
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
readonly wo_version_old="2.2.3"
|
readonly wo_version_old="2.2.3"
|
||||||
readonly wo_version_new="3.9.3"
|
readonly wo_version_new="3.9.3"
|
||||||
@@ -82,7 +82,7 @@ fi
|
|||||||
###
|
###
|
||||||
# 1 - Define variables for later use
|
# 1 - Define variables for later use
|
||||||
###
|
###
|
||||||
wo_branch=$1
|
wo_branch="$1"
|
||||||
migration=0
|
migration=0
|
||||||
readonly wo_log_dir=/var/log/wo/
|
readonly wo_log_dir=/var/log/wo/
|
||||||
readonly wo_install_log=/var/log/wo/install.log
|
readonly wo_install_log=/var/log/wo/install.log
|
||||||
@@ -96,17 +96,13 @@ if [ "$wo_linux_distro" != "Ubuntu" ] && [ "$wo_linux_distro" != "Debian" ]; the
|
|||||||
wo_lib_echo_fail "WordOps (wo) only supports Ubuntu and Debian at the moment."
|
wo_lib_echo_fail "WordOps (wo) only supports Ubuntu and Debian at the moment."
|
||||||
wo_lib_echo_fail "If you are feeling adventurous, you are free to fork WordOps to support"
|
wo_lib_echo_fail "If you are feeling adventurous, you are free to fork WordOps to support"
|
||||||
wo_lib_echo_fail "other Linux distributions and perhaps even Unix deratives."
|
wo_lib_echo_fail "other Linux distributions and perhaps even Unix deratives."
|
||||||
wo_lib_echo_fail "WordOps (wo) only supports Ubuntu 14.04/16.04/18.04, Debian 8.x and Debian 9.x"
|
|
||||||
exit 100
|
|
||||||
fi
|
|
||||||
|
|
||||||
###
|
|
||||||
# 1 - WordOps (wo) only supports Ubuntu/Debian versions that are eligible for support
|
|
||||||
###
|
|
||||||
lsb_release -d | grep -E "14.04|16.04|18.04|jessie|stretch" &>> /dev/null
|
|
||||||
if [ "$?" -ne "0" ]; then
|
|
||||||
wo_lib_echo_fail "WordOps (wo) only supports Ubuntu 14.04/16.04/18.04, Debian 8.x and Debian 9.x"
|
|
||||||
exit 100
|
exit 100
|
||||||
|
else
|
||||||
|
check_wo_linux_distro=$(lsb_release -sc | grep -E "trusty|xenial|bionic|jessie|stretch")
|
||||||
|
if [ -z "$check_wo_linux_distro" ]; then
|
||||||
|
wo_lib_echo_fail "WordOps (wo) only supports Ubuntu 14.04/16.04/18.04, Debian 8.x and Debian 9.x"
|
||||||
|
exit 100
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
###
|
###
|
||||||
@@ -149,7 +145,7 @@ wo_install_dep()
|
|||||||
# Change the TLS protocols
|
# Change the TLS protocols
|
||||||
sed -i 's/TLSv1 TLSv1.1 TLSv1.2;/TLSv1.2;/g' /etc/nginx/nginx.conf
|
sed -i 's/TLSv1 TLSv1.1 TLSv1.2;/TLSv1.2;/g' /etc/nginx/nginx.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
###
|
###
|
||||||
# Webp mapping
|
# Webp mapping
|
||||||
###
|
###
|
||||||
@@ -407,10 +403,10 @@ wo_update_latest()
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Move ~/.my.cnf to /etc/mysql/conf.d/my.cnf
|
# Move ~/.my.cnf to /etc/mysql/conf.d/my.cnf
|
||||||
if [ ! -f /etc/mysql/conf.d/my.cnf ]
|
if [ ! -f /etc/mysql/conf.d/my.cnf ]
|
||||||
then
|
then
|
||||||
#create conf.d folder if not exist
|
# create conf.d folder if not exist
|
||||||
if [ ! -d /etc/mysql/conf.d ]; then
|
if [ ! -d /etc/mysql/conf.d ]; then
|
||||||
mkdir -p /etc/mysql/conf.d
|
mkdir -p /etc/mysql/conf.d
|
||||||
chmod 755 /etc/mysql/conf.d
|
chmod 755 /etc/mysql/conf.d
|
||||||
@@ -559,8 +555,8 @@ wo_update_latest()
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Fix Redis-server security issue
|
# Fix Redis-server security issue
|
||||||
#http://redis.io/topics/security
|
# http://redis.io/topics/security
|
||||||
if [ -f /etc/redis/redis.conf ]; then
|
if [ -f /etc/redis/redis.conf ]; then
|
||||||
grep -0 -v "#" /etc/redis/redis.confse | grep 'bind' &>> /dev/null
|
grep -0 -v "#" /etc/redis/redis.confse | grep 'bind' &>> /dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
@@ -614,27 +610,7 @@ wo_update_latest()
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$wo_linux_distro" == "Ubuntu" ]; then
|
# Fix for SSL cert --all
|
||||||
add-apt-repository -y 'ppa:ondrej/php'
|
|
||||||
wo_lib_echo "Updating the PHP repository for some neat PHP 7.2 support"
|
|
||||||
apt-get update &>> /dev/null
|
|
||||||
apt-get -y install php7.2-fpm php7.2-curl php7.2-gd php7.2-imap php-memcached php7.2-common php7.2-readline php-redis php7.2-mysql php7.2-cli php-imagick php7.2-mbstring php7.2-recode php7.2-bcmath php7.2-opcache php7.2-zip php7.2-xml php7.2-soap php-msgpack graphviz php-pear php-xdebug || wo_lib_error "Not all PHP packages could be installed. " 1
|
|
||||||
mkdir -p /var/log/php/7.2/
|
|
||||||
touch /var/log/php/7.2/slow.log /var/log/php/7.2/fpm.log
|
|
||||||
systemctl php7.2-fpm restart &>> /dev/null
|
|
||||||
|
|
||||||
elif [ "$wo_linux_distro" == "Debian" ]; then
|
|
||||||
apt-get install apt-transport-https lsb-release ca-certificates locales locales-all -y
|
|
||||||
export LC_ALL=en_US.UTF-8
|
|
||||||
export LANG=en_US.UTF-8
|
|
||||||
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
|
|
||||||
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list
|
|
||||||
apt-get update &>> /dev/null
|
|
||||||
apt-get -y install php7.2-fpm php7.2-curl php7.2-gd php7.2-imap php-memcached php7.2-common php7.2-readline php-redis php7.2-mysql php7.2-cli php-imagick php7.2-mbstring php7.2-recode php7.2-bcmath php7.2-opcache php7.2-zip php7.2-xml php7.2-soap php-msgpack graphviz php-pear php-xdebug || wo_lib_error "Not all PHP packages could be installed." 1
|
|
||||||
systemctl php7.2-fpm restart &>> /dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Fix for SSL cert --all
|
|
||||||
crontab -l | grep -q '\-\-min_expiry_limit'
|
crontab -l | grep -q '\-\-min_expiry_limit'
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
crontab -l > /var/spool/cron/cron-backup.txt #backup cron before editing
|
crontab -l > /var/spool/cron/cron-backup.txt #backup cron before editing
|
||||||
@@ -662,7 +638,7 @@ wo_git_init()
|
|||||||
}
|
}
|
||||||
git add -A .
|
git add -A .
|
||||||
git commit -am "Installed/Updated to WordOps" &>> /dev/null
|
git commit -am "Installed/Updated to WordOps" &>> /dev/null
|
||||||
|
|
||||||
# PHP under git version control
|
# PHP under git version control
|
||||||
[ -d /etc/php ] && {
|
[ -d /etc/php ] && {
|
||||||
cd /etc/php || exit 1
|
cd /etc/php || exit 1
|
||||||
@@ -674,16 +650,12 @@ wo_git_init()
|
|||||||
}> /dev/null
|
}> /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ ! -f /usr/local/bin/wo ]; then
|
###
|
||||||
wo_lib_echo "Installing depedencies" | tee -ai $wo_install_log
|
# 4 - WO MAIN SETUP
|
||||||
wo_install_dep | tee -ai $wo_install_log
|
###
|
||||||
wo_lib_echo "Installing WordOps $wo_branch" | tee -ai $wo_install_log
|
|
||||||
wo_install | tee -ai $wo_install_log
|
# 1 - WO already installed
|
||||||
wo_lib_echo "Running post-install steps" | tee -ai $wo_install_log
|
if [ -x /usr/local/bin/wo ]; then
|
||||||
secure_wo_db | tee -ai $EE_INSTALL_LOG
|
|
||||||
wo_git_init | tee -ai $wo_install_log
|
|
||||||
wo_update_wp_cli | tee -ai $wo_install_log
|
|
||||||
else
|
|
||||||
wo -v 2>&1 | grep $wo_version_new &>> /dev/null
|
wo -v 2>&1 | grep $wo_version_new &>> /dev/null
|
||||||
if [[ $? -ne 0 ]];then
|
if [[ $? -ne 0 ]];then
|
||||||
read -p "Update WordOps to $wo_version_new (y/n): " wo_ans
|
read -p "Update WordOps to $wo_version_new (y/n): " wo_ans
|
||||||
@@ -704,6 +676,40 @@ else
|
|||||||
else
|
else
|
||||||
wo_lib_error "You already have WordOps $wo_version_new, exit status = " 1
|
wo_lib_error "You already have WordOps $wo_version_new, exit status = " 1
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
# 2 - Migration from EEv3
|
||||||
|
if [ -x /usr/local/bin/ee ]; then
|
||||||
|
ee -v 2>&1 | grep $wo_version_new &>> /dev/null
|
||||||
|
if [[ $? -ne 0 ]];then
|
||||||
|
read -p "Update WordOps to $wo_version_new (y/n): " wo_ans
|
||||||
|
if [ "$wo_ans" = "y" ] || [ "$wo_ans" = "Y" ]; then
|
||||||
|
wo_install_dep | tee -ai $wo_install_log
|
||||||
|
wo_sync_db >> $EE_INSTALL_LOG 2>&1
|
||||||
|
secure_wo_db | tee -ai $EE_INSTALL_LOG
|
||||||
|
wo_upgrade_php | tee -ai $wo_install_log
|
||||||
|
wo_install | tee -ai $wo_install_log
|
||||||
|
wo_update_latest | tee -ai $wo_install_log
|
||||||
|
wo_git_init | tee -ai $wo_install_log
|
||||||
|
service nginx reload &>> /dev/null
|
||||||
|
service php7.2-fpm restart &>> /dev/null
|
||||||
|
wo_update_wp_cli | tee -ai $wo_install_log
|
||||||
|
else
|
||||||
|
wo_lib_error "Not updating WordOps to $wo_version_new, exit status = " 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
wo_lib_error "You already have WordOps $wo_version_new, exit status = " 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# 3 - Fresh WO setup
|
||||||
|
wo_lib_echo "Installing depedencies" | tee -ai $wo_install_log
|
||||||
|
wo_install_dep | tee -ai $wo_install_log
|
||||||
|
wo_lib_echo "Installing WordOps $wo_branch" | tee -ai $wo_install_log
|
||||||
|
wo_install | tee -ai $wo_install_log
|
||||||
|
wo_lib_echo "Running post-install steps" | tee -ai $wo_install_log
|
||||||
|
secure_wo_db | tee -ai $EE_INSTALL_LOG
|
||||||
|
wo_git_init | tee -ai $wo_install_log
|
||||||
|
wo_update_wp_cli | tee -ai $wo_install_log
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
wo sync | tee -ai $WO_INSTALL_LOG
|
wo sync | tee -ai $WO_INSTALL_LOG
|
||||||
|
|||||||
@@ -277,48 +277,48 @@ class WOStackController(CementBaseController):
|
|||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/locations.conf')
|
'file /etc/nginx/common/locations-php72.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/locations.conf',
|
wo_nginx = open('/etc/nginx/common/locations-php72.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'locations.mustache',
|
self.app.render((data), 'locations.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/php.conf')
|
'file /etc/nginx/common/php72.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/php.conf',
|
wo_nginx = open('/etc/nginx/common/php72.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'php.mustache',
|
self.app.render((data), 'php.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/wpcommon.conf')
|
'file /etc/nginx/common/wpcommon-php72.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/wpcommon.conf',
|
wo_nginx = open('/etc/nginx/common/wpcommon-php72.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'wpcommon.mustache',
|
self.app.render((data), 'wpcommon.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/wpfc.conf')
|
'file /etc/nginx/common/wpfc-php72.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/wpfc.conf',
|
wo_nginx = open('/etc/nginx/common/wpfc-php72.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'wpfc.mustache',
|
self.app.render((data), 'wpfc.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/wpsc.conf')
|
'file /etc/nginx/common/wpsc-php72.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/wpsc.conf',
|
wo_nginx = open('/etc/nginx/common/wpsc-php72.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'wpsc.mustache',
|
self.app.render((data), 'wpsc.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/wpsubdir.conf')
|
'file /etc/nginx/common/wpsubdir-php72.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/wpsubdir.conf',
|
wo_nginx = open('/etc/nginx/common/wpsubdir-php72.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'wpsubdir.mustache',
|
self.app.render((data), 'wpsubdir.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
@@ -329,48 +329,48 @@ class WOStackController(CementBaseController):
|
|||||||
os.path.isfile("/etc/nginx/common/php7.conf")):
|
os.path.isfile("/etc/nginx/common/php7.conf")):
|
||||||
# data = dict()
|
# data = dict()
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/locations-php7.conf')
|
'file /etc/nginx/common/locations-php73.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/locations-php7.conf',
|
wo_nginx = open('/etc/nginx/common/locations-php73.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'locations-php7.mustache',
|
self.app.render((data), 'locations-php7.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/php7.conf')
|
'file /etc/nginx/common/php73.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/php7.conf',
|
wo_nginx = open('/etc/nginx/common/php73.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'php7.mustache',
|
self.app.render((data), 'php7.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/wpcommon-php7.conf')
|
'file /etc/nginx/common/wpcommon-php73.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/wpcommon-php7.conf',
|
wo_nginx = open('/etc/nginx/common/wpcommon-php73.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'wpcommon-php7.mustache',
|
self.app.render((data), 'wpcommon-php7.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/wpfc-php7.conf')
|
'file /etc/nginx/common/wpfc-php73.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/wpfc-php7.conf',
|
wo_nginx = open('/etc/nginx/common/wpfc-php73.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'wpfc-php7.mustache',
|
self.app.render((data), 'wpfc-php7.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/wpsc-php7.conf')
|
'file /etc/nginx/common/wpsc-php73.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/wpsc-php7.conf',
|
wo_nginx = open('/etc/nginx/common/wpsc-php73.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'wpsc-php7.mustache',
|
self.app.render((data), 'wpsc-php7.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/redis-php7.conf')
|
'file /etc/nginx/common/redis-php73.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/redis-php7.conf',
|
wo_nginx = open('/etc/nginx/common/redis-php73.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'redis-php7.mustache',
|
self.app.render((data), 'redis-php7.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
@@ -457,7 +457,7 @@ class WOStackController(CementBaseController):
|
|||||||
"{0}22222/cert/22222.key 2048"
|
"{0}22222/cert/22222.key 2048"
|
||||||
.format(WOVariables.wo_webroot))
|
.format(WOVariables.wo_webroot))
|
||||||
WOShellExec.cmd_exec(self, "openssl req -new -batch "
|
WOShellExec.cmd_exec(self, "openssl req -new -batch "
|
||||||
"-subj /commonName=127.0.0.1/ "
|
"-subj /commonName=localhost.localdomain/ "
|
||||||
"-key {0}22222/cert/22222.key "
|
"-key {0}22222/cert/22222.key "
|
||||||
"-out {0}22222/cert/"
|
"-out {0}22222/cert/"
|
||||||
"22222.csr"
|
"22222.csr"
|
||||||
@@ -529,8 +529,8 @@ class WOStackController(CementBaseController):
|
|||||||
|
|
||||||
data = dict()
|
data = dict()
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/redis.conf')
|
'file /etc/nginx/common/redis-php72.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/redis.conf',
|
wo_nginx = open('/etc/nginx/common/redis-php72.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'redis.mustache',
|
self.app.render((data), 'redis.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
@@ -550,11 +550,11 @@ class WOStackController(CementBaseController):
|
|||||||
|
|
||||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
||||||
if os.path.isfile("/etc/nginx/nginx.conf") and (not
|
if os.path.isfile("/etc/nginx/nginx.conf") and (not
|
||||||
os.path.isfile("/etc/nginx/common/redis-php7.conf")):
|
os.path.isfile("/etc/nginx/common/redis-php73.conf")):
|
||||||
data = dict()
|
data = dict()
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/redis-php7.conf')
|
'file /etc/nginx/common/redis-php73.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/redis-php7.conf',
|
wo_nginx = open('/etc/nginx/common/redis-php73.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'redis-php7.mustache',
|
self.app.render((data), 'redis-php7.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
@@ -580,53 +580,53 @@ class WOStackController(CementBaseController):
|
|||||||
# setup nginx common folder for php7
|
# setup nginx common folder for php7
|
||||||
if self.app.pargs.php73:
|
if self.app.pargs.php73:
|
||||||
if os.path.isdir("/etc/nginx/common") and (not
|
if os.path.isdir("/etc/nginx/common") and (not
|
||||||
os.path.isfile("/etc/nginx/common/php7.conf")):
|
os.path.isfile("/etc/nginx/common/php73.conf")):
|
||||||
data = dict()
|
data = dict()
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/locations-php7.conf')
|
'file /etc/nginx/common/locations-php73.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/locations-php7.conf',
|
wo_nginx = open('/etc/nginx/common/locations-php73.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'locations-php7.mustache',
|
self.app.render((data), 'locations-php7.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/php7.conf')
|
'file /etc/nginx/common/php73.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/php7.conf',
|
wo_nginx = open('/etc/nginx/common/php73.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'php7.mustache',
|
self.app.render((data), 'php7.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/wpcommon-php7.conf')
|
'file /etc/nginx/common/wpcommon-php73.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/wpcommon-php7.conf',
|
wo_nginx = open('/etc/nginx/common/wpcommon-php73.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'wpcommon-php7.mustache',
|
self.app.render((data), 'wpcommon-php7.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/wpfc-php7.conf')
|
'file /etc/nginx/common/wpfc-php73.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/wpfc-php7.conf',
|
wo_nginx = open('/etc/nginx/common/wpfc-php73.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'wpfc-php7.mustache',
|
self.app.render((data), 'wpfc-php7.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/wpsc-php7.conf')
|
'file /etc/nginx/common/wpsc-php73.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/wpsc-php7.conf',
|
wo_nginx = open('/etc/nginx/common/wpsc-php73.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'wpsc-php7.mustache',
|
self.app.render((data), 'wpsc-php7.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
if os.path.isdir("/etc/nginx/common") and (not os.path.isfile("/etc/nginx/common/redis-php7.conf")):
|
if os.path.isdir("/etc/nginx/common") and (not os.path.isfile("/etc/nginx/common/redis-php73.conf")):
|
||||||
data = dict()
|
data = dict()
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/redis-php7.conf')
|
'file /etc/nginx/common/redis-php73.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/redis-php7.conf',
|
wo_nginx = open('/etc/nginx/common/redis-php73.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'redis-php7.mustache',
|
self.app.render((data), 'redis-php7.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
@@ -718,19 +718,19 @@ class WOStackController(CementBaseController):
|
|||||||
|
|
||||||
if set(WOVariables.wo_redis).issubset(set(apt_packages)):
|
if set(WOVariables.wo_redis).issubset(set(apt_packages)):
|
||||||
if os.path.isfile("/etc/nginx/nginx.conf") and (not
|
if os.path.isfile("/etc/nginx/nginx.conf") and (not
|
||||||
os.path.isfile("/etc/nginx/common/redis.conf")):
|
os.path.isfile("/etc/nginx/common/redis-php72.conf")):
|
||||||
|
|
||||||
data = dict()
|
data = dict()
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/common/redis.conf')
|
'file /etc/nginx/common/redis-php72.conf')
|
||||||
wo_nginx = open('/etc/nginx/common/redis.conf',
|
wo_nginx = open('/etc/nginx/common/redis-php72.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'redis.mustache',
|
self.app.render((data), 'redis.mustache',
|
||||||
out=wo_nginx)
|
out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
if os.path.isfile("/etc/nginx/nginx.conf") and (not
|
if os.path.isfile("/etc/nginx/nginx.conf") and (not
|
||||||
os.path.isfile("/etc/nginx/common/redis-hhvm.conf")):
|
os.path.isfile("/etc/nginx/common/redis-hhvm.conf")):
|
||||||
|
|
||||||
data = dict()
|
data = dict()
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
@@ -752,8 +752,8 @@ class WOStackController(CementBaseController):
|
|||||||
" keepalive 10;\n}\n")
|
" keepalive 10;\n}\n")
|
||||||
|
|
||||||
if os.path.isfile("/etc/nginx/nginx.conf") and (not
|
if os.path.isfile("/etc/nginx/nginx.conf") and (not
|
||||||
os.path.isfile("/etc/nginx/conf.d/redis.conf")):
|
os.path.isfile("/etc/nginx/conf.d/redis-php72.conf")):
|
||||||
with open("/etc/nginx/conf.d/redis.conf", "a") as redis_file:
|
with open("/etc/nginx/conf.d/redis-php72.conf", "a") as redis_file:
|
||||||
redis_file.write("# Log format Settings\n"
|
redis_file.write("# Log format Settings\n"
|
||||||
"log_format rt_cache_redis '$remote_addr $upstream_response_time $srcache_fetch_status [$time_local] '\n"
|
"log_format rt_cache_redis '$remote_addr $upstream_response_time $srcache_fetch_status [$time_local] '\n"
|
||||||
"'$http_host \"$request\" $status $body_bytes_sent '\n"
|
"'$http_host \"$request\" $status $body_bytes_sent '\n"
|
||||||
@@ -1436,7 +1436,7 @@ class WOStackController(CementBaseController):
|
|||||||
Log.info(self, "PHP 7.3 Not Available for your Distribution")
|
Log.info(self, "PHP 7.3 Not Available for your Distribution")
|
||||||
|
|
||||||
# PHP 7.3 for Ubuntu
|
# PHP 7.3 for Ubuntu
|
||||||
if self.app.pargs.php73 and not WOVariables.wo_platform_distro == 'debian':
|
if self.app.pargs.php73 and WOVariables.wo_platform_distro == 'ubuntu':
|
||||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
||||||
Log.debug(self, "Setting apt_packages variable for PHP 7.3")
|
Log.debug(self, "Setting apt_packages variable for PHP 7.3")
|
||||||
if not WOAptGet.is_installed(self, 'php7.3-fpm'):
|
if not WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
@@ -1673,7 +1673,7 @@ class WOStackController(CementBaseController):
|
|||||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
||||||
Log.debug(self, "Removing apt_packages variable of PHP 7.3")
|
Log.debug(self, "Removing apt_packages variable of PHP 7.3")
|
||||||
apt_packages = apt_packages + WOVariables.wo_php73
|
apt_packages = apt_packages + WOVariables.wo_php73
|
||||||
if not WOAptGet.is_installed(self, 'php7.2-fpm'):
|
if not WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
apt_packages = apt_packages + WOVariables.wo_php_extra
|
apt_packages = apt_packages + WOVariables.wo_php_extra
|
||||||
else:
|
else:
|
||||||
Log.info(self, "PHP 7.3 not supported.")
|
Log.info(self, "PHP 7.3 not supported.")
|
||||||
@@ -1802,7 +1802,7 @@ class WOStackController(CementBaseController):
|
|||||||
if self.app.pargs.php:
|
if self.app.pargs.php:
|
||||||
Log.debug(self, "Purge apt_packages variable PHP")
|
Log.debug(self, "Purge apt_packages variable PHP")
|
||||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
||||||
apt_packages = apt_packages + WOVariables.wo_php
|
apt_packages = apt_packages + WOVariables.wo_php + WOVariables.wo_php_extra
|
||||||
if not WOAptGet.is_installed(self, 'php7.3-fpm'):
|
if not WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
apt_packages = apt_packages + WOVariables.wo_php_extra
|
apt_packages = apt_packages + WOVariables.wo_php_extra
|
||||||
else:
|
else:
|
||||||
@@ -1887,16 +1887,6 @@ class WOStackController(CementBaseController):
|
|||||||
|
|
||||||
Log.info(self, "Successfully purged packages")
|
Log.info(self, "Successfully purged packages")
|
||||||
|
|
||||||
# Added for php Ondrej repo missing package fix
|
|
||||||
if self.app.pargs.php73:
|
|
||||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
|
||||||
Log.info(self, "PHP7.2-fpm found on system.")
|
|
||||||
Log.info(
|
|
||||||
self, "Verifying and installing missing packages,")
|
|
||||||
WOShellExec.cmd_exec(
|
|
||||||
self, "apt-get install -y php-memcached php-igbinary")
|
|
||||||
|
|
||||||
|
|
||||||
def load(app):
|
def load(app):
|
||||||
# register the plugin class.. this only happens if the plugin is enabled
|
# register the plugin class.. this only happens if the plugin is enabled
|
||||||
handler.register(WOStackController)
|
handler.register(WOStackController)
|
||||||
|
|||||||
@@ -38,10 +38,10 @@ server {
|
|||||||
}
|
}
|
||||||
{{/static}}
|
{{/static}}
|
||||||
|
|
||||||
{{^static}}include {{^hhvm}}{{#basic}}common/php7.conf;{{/basic}}{{#wpfc}}common/wpfc-php7.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php7.conf;{{/wpsc}}{{#wpredis}}common/redis-php7.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}}
|
{{^static}}include {{^hhvm}}{{#basic}}common/php73.conf;{{/basic}}{{#wpfc}}common/wpfc-php73.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php73.conf;{{/wpsc}}{{#wpredis}}common/redis-php73.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}}
|
||||||
{{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}}
|
{{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}}
|
||||||
{{#wp}}include common/wpcommon-php7.conf;{{/wp}}
|
{{#wp}}include common/wpcommon-php73.conf;{{/wp}}
|
||||||
{{^proxy}}include common/locations-php7.conf;{{/proxy}}
|
{{^proxy}}include common/locations-php73.conf;{{/proxy}}
|
||||||
{{^vma}}{{^rc}}include {{webroot}}/conf/nginx/*.conf;{{/rc}}{{/vma}}
|
{{^vma}}{{^rc}}include {{webroot}}/conf/nginx/*.conf;{{/rc}}{{/vma}}
|
||||||
{{/proxy}}
|
{{/proxy}}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,9 +38,9 @@ server {
|
|||||||
}
|
}
|
||||||
{{/static}}
|
{{/static}}
|
||||||
|
|
||||||
{{^static}}include {{^hhvm}}{{#basic}}common/php.conf;{{/basic}}{{#wpfc}}common/wpfc.conf;{{/wpfc}} {{#wpsc}}common/wpsc.conf;{{/wpsc}}{{#wpredis}}common/redis.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}} {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}}
|
{{^static}}include {{^hhvm}}{{#basic}}common/php72.conf;{{/basic}}{{#wpfc}}common/wpfc-php72.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php72.conf;{{/wpsc}}{{#wpredis}}common/redis-php72.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}} {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}}
|
||||||
{{#wp}}include common/wpcommon.conf;{{/wp}}
|
{{#wp}}include common/wpcommon-php72.conf;{{/wp}}
|
||||||
{{^proxy}}include common/locations.conf;{{/proxy}}
|
{{^proxy}}include common/locations-php72.conf;{{/proxy}}
|
||||||
{{^vma}}{{^rc}}include {{webroot}}/conf/nginx/*.conf;{{/rc}}{{/vma}}
|
{{^vma}}{{^rc}}include {{webroot}}/conf/nginx/*.conf;{{/rc}}{{/vma}}
|
||||||
{{/proxy}}
|
{{/proxy}}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user