reworked php7.3 stack
* replace previous stack php7 variables * properly set stack php = php7.2 and php73 = php7.3 * rename upstream php72 and php73 to avoid issues when migrating from EEv3 * use unix socket in nginx upstream instead of TCP/IP
This commit is contained in:
10
install
10
install
@@ -73,7 +73,7 @@ fi
|
||||
wo_branch=$1
|
||||
migration=0
|
||||
readonly wo_version_old="2.2.3"
|
||||
readonly wo_version_new="3.9.2.3"
|
||||
readonly wo_version_new="3.9.5"
|
||||
readonly wo_log_dir=/var/log/wo/
|
||||
readonly wo_install_log=/var/log/wo/install.log
|
||||
readonly wo_linux_distro=$(lsb_release -i | awk '{print $3}')
|
||||
@@ -145,7 +145,7 @@ function wo_install_dep()
|
||||
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 php-memcached php7.2-imap 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 php7.2-msgpack graphviz php-pear php7.2-xdebug || wo_lib_error "Not all PHP packages could be installed. " 1
|
||||
apt-get -y install php7.2-fpm php7.2-curl php7.2-gd php-memcached php7.2-imap 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-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
|
||||
@@ -157,7 +157,7 @@ function wo_install_dep()
|
||||
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 php-memcached php7.2-imap php7.2-common php7.2-readlne 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 php7.2-msgpack graphviz php-pear php7.2-xdebug || wo_lib_error "Not all PHP packages could be installed." 1
|
||||
apt-get -y install php7.2-fpm php7.2-curl php7.2-gd php-memcached php7.2-imap php7.2-common php7.2-readlne 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-xdebug || wo_lib_error "Not all PHP packages could be installed." 1
|
||||
systemctl php7.2-fpm restart &>> /dev/null
|
||||
fi
|
||||
|
||||
@@ -629,7 +629,7 @@ function wo_update_latest()
|
||||
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 php7.2-msgpack graphviz php-pear php7.2-xdebug || wo_lib_error "Not all PHP packages could be installed. " 1
|
||||
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-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
|
||||
@@ -641,7 +641,7 @@ function wo_update_latest()
|
||||
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 php7.2-msgpack graphviz php-pear php7.2-xdebug || wo_lib_error "Not all PHP packages could be installed." 1
|
||||
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-xdebug || wo_lib_error "Not all PHP packages could be installed." 1
|
||||
systemctl php7.2-fpm restart &>> /dev/null
|
||||
fi
|
||||
|
||||
|
||||
2
setup.py
2
setup.py
@@ -58,7 +58,7 @@ if not os.path.isfile('/root/.gitconfig'):
|
||||
shutil.copy2(os.path.expanduser("~")+'/.gitconfig', '/root/.gitconfig')
|
||||
|
||||
setup(name='wo',
|
||||
version='3.9.1',
|
||||
version='3.9.5',
|
||||
description=long_description,
|
||||
long_description=long_description,
|
||||
classifiers=[],
|
||||
|
||||
@@ -42,7 +42,7 @@ class WODebugController(CementBaseController):
|
||||
action='store' or 'store_const',
|
||||
choices=('on', 'off'), const='on', nargs='?')),
|
||||
(['--php'],
|
||||
dict(help='start/stop debugging server PHP configuration',
|
||||
dict(help='start/stop debugging server PHP 7.2 configuration',
|
||||
action='store' or 'store_const',
|
||||
choices=('on', 'off'), const='on', nargs='?')),
|
||||
(['--fpm'],
|
||||
@@ -50,11 +50,11 @@ class WODebugController(CementBaseController):
|
||||
action='store' or 'store_const',
|
||||
choices=('on', 'off'), const='on', nargs='?')),
|
||||
(['--php73'],
|
||||
dict(help='start/stop debugging server PHP 7.2 configuration',
|
||||
dict(help='start/stop debugging server PHP 7.3 configuration',
|
||||
action='store' or 'store_const',
|
||||
choices=('on', 'off'), const='on', nargs='?')),
|
||||
(['--fpm7'],
|
||||
dict(help='start/stop debugging fastcgi 7.2 configuration',
|
||||
(['--fpm73'],
|
||||
dict(help='start/stop debugging fastcgi 7.3 configuration',
|
||||
action='store' or 'store_const',
|
||||
choices=('on', 'off'), const='on', nargs='?')),
|
||||
(['--mysql'],
|
||||
@@ -301,37 +301,37 @@ class WODebugController(CementBaseController):
|
||||
|
||||
if (self.app.pargs.php73 == 'on' and not self.app.pargs.site_name):
|
||||
if (WOVariables.wo_platform_codename == 'wheezy' or WOVariables.wo_platform_codename == 'precise'):
|
||||
Log.error(self, "PHP 7.2 not supported.")
|
||||
if not (WOShellExec.cmd_exec(self, "sed -n \"/upstream php7"
|
||||
Log.error(self, "PHP 7.3 not supported.")
|
||||
if not (WOShellExec.cmd_exec(self, "sed -n \"/upstream php73"
|
||||
"{/,/}/p \" /etc/nginx/"
|
||||
"conf.d/upstream.conf "
|
||||
"| grep 9172")):
|
||||
"| grep 9173")):
|
||||
|
||||
Log.info(self, "Enabling PHP 7.2 debug")
|
||||
Log.info(self, "Enabling PHP 7.3 debug")
|
||||
|
||||
# Change upstream.conf
|
||||
nc = NginxConfig()
|
||||
nc.loadf('/etc/nginx/conf.d/upstream.conf')
|
||||
nc.set([('upstream', 'php73',), 'server'], '127.0.0.1:9172')
|
||||
nc.set([('upstream', 'php73',), 'server'], '127.0.0.1:9173')
|
||||
if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"):
|
||||
nc.set([('upstream', 'hhvm',), 'server'], '127.0.0.1:9172')
|
||||
nc.set([('upstream', 'hhvm',), 'server'], '127.0.0.1:9173')
|
||||
nc.savef('/etc/nginx/conf.d/upstream.conf')
|
||||
|
||||
# Enable xdebug
|
||||
WOFileUtils.searchreplace(self, "/etc/php/7.2/mods-available/"
|
||||
WOFileUtils.searchreplace(self, "/etc/php/7.3/mods-available/"
|
||||
"xdebug.ini",
|
||||
";zend_extension",
|
||||
"zend_extension")
|
||||
|
||||
# Fix slow log is not enabled default in PHP5.6
|
||||
config = configparser.ConfigParser()
|
||||
config.read('/etc/php/7.2/fpm/pool.d/debug.conf')
|
||||
config['debug']['slowlog'] = '/var/log/php/7.2/slow.log'
|
||||
config.read('/etc/php/7.3/fpm/pool.d/debug.conf')
|
||||
config['debug']['slowlog'] = '/var/log/php/7.3/slow.log'
|
||||
config['debug']['request_slowlog_timeout'] = '10s'
|
||||
with open('/etc/php/7.2/fpm/pool.d/debug.conf',
|
||||
with open('/etc/php/7.3/fpm/pool.d/debug.conf',
|
||||
encoding='utf-8', mode='w') as confifile:
|
||||
Log.debug(self, "Writting debug.conf configuration into "
|
||||
"/etc/php/7.2/fpm/pool.d/debug.conf")
|
||||
"/etc/php/7.3/fpm/pool.d/debug.conf")
|
||||
config.write(confifile)
|
||||
|
||||
self.trigger_php = True
|
||||
@@ -339,11 +339,11 @@ class WODebugController(CementBaseController):
|
||||
else:
|
||||
Log.info(self, "PHP debug is already enabled")
|
||||
|
||||
self.msg = self.msg + ['/var/log/php/7.2/slow.log']
|
||||
self.msg = self.msg + ['/var/log/php/7.3/slow.log']
|
||||
|
||||
# PHP global debug stop
|
||||
elif (self.app.pargs.php73 == 'off' and not self.app.pargs.site_name):
|
||||
if WOShellExec.cmd_exec(self, " sed -n \"/upstream php73 {/,/}/p\" "
|
||||
if WOShellExec.cmd_exec(self, " sed -n \"/upstream php72 {/,/}/p\" "
|
||||
"/etc/nginx/conf.d/upstream.conf "
|
||||
"| grep 9172"):
|
||||
Log.info(self, "Disabling PHP 7.2 debug")
|
||||
@@ -351,7 +351,7 @@ class WODebugController(CementBaseController):
|
||||
# Change upstream.conf
|
||||
nc = NginxConfig()
|
||||
nc.loadf('/etc/nginx/conf.d/upstream.conf')
|
||||
nc.set([('upstream', 'php73',), 'server'], '127.0.0.1:9072')
|
||||
nc.set([('upstream', 'php72',), 'server'], 'unix:/var/run/php/php72-fpm.sock')
|
||||
if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"):
|
||||
nc.set([('upstream', 'hhvm',), 'server'], '127.0.0.1:8000')
|
||||
nc.savef('/etc/nginx/conf.d/upstream.conf')
|
||||
@@ -368,47 +368,47 @@ class WODebugController(CementBaseController):
|
||||
Log.info(self, "PHP 7.2 debug is already disabled")
|
||||
|
||||
@expose(hide=True)
|
||||
def debug_fpm7(self):
|
||||
def debug_fpm73(self):
|
||||
"""Start/Stop PHP5-FPM debug"""
|
||||
# PHP5-FPM start global debug
|
||||
if (self.app.pargs.fpm7 == 'on' and not self.app.pargs.site_name):
|
||||
if (self.app.pargs.fpm73 == 'on' and not self.app.pargs.site_name):
|
||||
if not WOShellExec.cmd_exec(self, "grep \"log_level = debug\" "
|
||||
"/etc/php/7.2/fpm/php-fpm.conf"):
|
||||
Log.info(self, "Setting up PHP7.2-FPM log_level = debug")
|
||||
"/etc/php/7.3/fpm/php-fpm.conf"):
|
||||
Log.info(self, "Setting up PHP7.3-FPM log_level = debug")
|
||||
config = configparser.ConfigParser()
|
||||
config.read('/etc/php/7.2/fpm/php-fpm.conf')
|
||||
config.read('/etc/php/7.3/fpm/php-fpm.conf')
|
||||
config.remove_option('global', 'include')
|
||||
config['global']['log_level'] = 'debug'
|
||||
config['global']['include'] = '/etc/php/7.2/fpm/pool.d/*.conf'
|
||||
with open('/etc/php/7.2/fpm/php-fpm.conf',
|
||||
config['global']['include'] = '/etc/php/7.3/fpm/pool.d/*.conf'
|
||||
with open('/etc/php/7.3/fpm/php-fpm.conf',
|
||||
encoding='utf-8', mode='w') as configfile:
|
||||
Log.debug(self, "Writing the PHP configuration into "
|
||||
"/etc/php/7.2/fpm/php-fpm.conf")
|
||||
"/etc/php/7.3/fpm/php-fpm.conf")
|
||||
config.write(configfile)
|
||||
self.trigger_php = True
|
||||
else:
|
||||
Log.info(self, "PHP7.2-FPM log_level = debug already setup")
|
||||
Log.info(self, "PHP7.3-FPM log_level = debug already setup")
|
||||
|
||||
self.msg = self.msg + ['/var/log/php/7.2/fpm.log']
|
||||
self.msg = self.msg + ['/var/log/php/7.3/fpm.log']
|
||||
|
||||
# PHP5-FPM stop global debug
|
||||
elif (self.app.pargs.fpm7 == 'off' and not self.app.pargs.site_name):
|
||||
elif (self.app.pargs.fpm73 == 'off' and not self.app.pargs.site_name):
|
||||
if WOShellExec.cmd_exec(self, "grep \"log_level = debug\" "
|
||||
"/etc/php/7.2/fpm/php-fpm.conf"):
|
||||
Log.info(self, "Disabling PHP7.2-FPM log_level = debug")
|
||||
"/etc/php/7.3/fpm/php-fpm.conf"):
|
||||
Log.info(self, "Disabling PHP7.3-FPM log_level = debug")
|
||||
config = configparser.ConfigParser()
|
||||
config.read('/etc/php/7.2/fpm/php-fpm.conf')
|
||||
config.read('/etc/php/7.3/fpm/php-fpm.conf')
|
||||
config.remove_option('global', 'include')
|
||||
config['global']['log_level'] = 'notice'
|
||||
config['global']['include'] = '/etc/php/7.2/fpm/pool.d/*.conf'
|
||||
with open('/etc/php/7.2/fpm/php-fpm.conf',
|
||||
config['global']['include'] = '/etc/php/7.3/fpm/pool.d/*.conf'
|
||||
with open('/etc/php/7.3/fpm/php-fpm.conf',
|
||||
encoding='utf-8', mode='w') as configfile:
|
||||
Log.debug(self, "Writing the php7.2 configuration into "
|
||||
"/etc/php/7.2/fpm/php-fpm.conf")
|
||||
Log.debug(self, "Writing the php7.3 configuration into "
|
||||
"/etc/php/7.3/fpm/php-fpm.conf")
|
||||
config.write(configfile)
|
||||
self.trigger_php = True
|
||||
else:
|
||||
Log.info(self, "PHP7.2-FPM log_level = debug already disabled")
|
||||
Log.info(self, "PHP7.3-FPM log_level = debug already disabled")
|
||||
|
||||
@expose(hide=True)
|
||||
def debug_mysql(self):
|
||||
@@ -609,9 +609,9 @@ class WODebugController(CementBaseController):
|
||||
if self.app.pargs.fpm:
|
||||
self.app.pargs.fpm = 'off'
|
||||
self.debug_fpm()
|
||||
if self.app.pargs.fpm7:
|
||||
self.app.pargs.fpm7 = 'off'
|
||||
self.debug_fpm7()
|
||||
if self.app.pargs.fpm73:
|
||||
self.app.pargs.fpm73 = 'off'
|
||||
self.debug_fpm73()
|
||||
if self.app.pargs.mysql:
|
||||
# MySQL debug will not work for remote MySQL
|
||||
if WOVariables.wo_mysql_host is "localhost":
|
||||
@@ -636,8 +636,8 @@ class WODebugController(CementBaseController):
|
||||
if WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic':
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
WOService.reload_service(self, 'php7.2-fpm')
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
WOService.reload_service(self, 'php7.2-fpm')
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
WOService.reload_service(self, 'php7.3-fpm')
|
||||
else:
|
||||
WOService.reload_service(self, 'php7.2-fpm')
|
||||
self.app.close(0)
|
||||
@@ -651,8 +651,8 @@ class WODebugController(CementBaseController):
|
||||
self.trigger_nginx = False
|
||||
self.trigger_php = False
|
||||
|
||||
if ((not self.app.pargs.nginx) and (not self.app.pargs.php) and (not self.app.pargs.php7)
|
||||
and (not self.app.pargs.fpm) and (not self.app.pargs.fpm7) and (not self.app.pargs.mysql)
|
||||
if ((not self.app.pargs.nginx) and (not self.app.pargs.php) and (not self.app.pargs.php73)
|
||||
and (not self.app.pargs.fpm) and (not self.app.pargs.fpm73) and (not self.app.pargs.mysql)
|
||||
and (not self.app.pargs.wp) and (not self.app.pargs.rewrite)
|
||||
and (not self.app.pargs.all)
|
||||
and (not self.app.pargs.site_name)
|
||||
@@ -726,7 +726,7 @@ class WODebugController(CementBaseController):
|
||||
self.app.pargs.fpm = 'on'
|
||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') and WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
self.app.pargs.php73 = 'on'
|
||||
self.app.pargs.fpm7 = 'on'
|
||||
self.app.pargs.fpm73 = 'on'
|
||||
self.app.pargs.mysql = 'on'
|
||||
self.app.pargs.rewrite = 'on'
|
||||
|
||||
@@ -738,12 +738,12 @@ class WODebugController(CementBaseController):
|
||||
self.app.pargs.fpm = 'off'
|
||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') and WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
self.app.pargs.php73 = 'off'
|
||||
self.app.pargs.fpm7 = 'off'
|
||||
self.app.pargs.fpm73 = 'off'
|
||||
self.app.pargs.mysql = 'off'
|
||||
self.app.pargs.rewrite = 'off'
|
||||
|
||||
if ((not self.app.pargs.nginx) and (not self.app.pargs.php) and (not self.app.pargs.php73)
|
||||
and (not self.app.pargs.fpm) and (not self.app.pargs.fpm7) and (not self.app.pargs.mysql)
|
||||
and (not self.app.pargs.fpm) and (not self.app.pargs.fpm73) and (not self.app.pargs.mysql)
|
||||
and (not self.app.pargs.wp) and (not self.app.pargs.rewrite)
|
||||
and self.app.pargs.site_name):
|
||||
self.app.args.print_help()
|
||||
@@ -782,12 +782,12 @@ class WODebugController(CementBaseController):
|
||||
# Reload PHP
|
||||
if self.trigger_php:
|
||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
||||
if WOAptGet.is_installed(self, 'php5.6-fpm'):
|
||||
WOService.restart_service(self, 'php5.6-fpm')
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
WOService.restart_service(self, 'php7.2-fpm')
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
WOService.restart_service(self, 'php7.3-fpm')
|
||||
else:
|
||||
WOService.restart_service(self, 'php5-fpm')
|
||||
WOService.restart_service(self, 'php7.2-fpm')
|
||||
if WOVariables.wo_platform_codename == 'jessie':
|
||||
WOService.restart_service(self, 'php7.2-fpm')
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ class WOInfoController(CementBaseController):
|
||||
self.app.pargs.nginx = True
|
||||
self.app.pargs.php = True
|
||||
self.app.pargs.mysql = True
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
self.app.pargs.php = True
|
||||
|
||||
if self.app.pargs.nginx:
|
||||
|
||||
@@ -308,9 +308,9 @@ class WOSiteCreateController(CementBaseController):
|
||||
(['--html'],
|
||||
dict(help="create html site", action='store_true')),
|
||||
(['--php'],
|
||||
dict(help="create php site", action='store_true')),
|
||||
(['--php73'],
|
||||
dict(help="create php 7.2 site", action='store_true')),
|
||||
(['--php73'],
|
||||
dict(help="create php 7.3 site", action='store_true')),
|
||||
(['--mysql'],
|
||||
dict(help="create mysql site", action='store_true')),
|
||||
(['--wp'],
|
||||
@@ -461,10 +461,10 @@ class WOSiteCreateController(CementBaseController):
|
||||
check_prompt = input("Type \"y\" to continue [n]:")
|
||||
if check_prompt != "Y" and check_prompt != "y":
|
||||
Log.info(self, "Not using PHP 7.2 for site.")
|
||||
data['php73'] = False
|
||||
data['php73'] = True
|
||||
data['basic'] = True
|
||||
php73 = 0
|
||||
self.app.pargs.php73 = False
|
||||
php73 = 1
|
||||
self.app.pargs.php73 = True
|
||||
else:
|
||||
data['php73'] = True
|
||||
php73 = 1
|
||||
@@ -564,7 +564,7 @@ class WOSiteCreateController(CementBaseController):
|
||||
return
|
||||
|
||||
if data['php73']:
|
||||
php_version = "7.2"
|
||||
php_version = "7.3"
|
||||
else:
|
||||
php_version = "7.2"
|
||||
|
||||
@@ -1225,7 +1225,7 @@ class WOSiteUpdateController(CementBaseController):
|
||||
|
||||
|
||||
if pargs.wpredis and data['currcachetype'] != 'wpredis':
|
||||
if (pargs.experimental):
|
||||
if (not pargs.experimental):
|
||||
Log.info(self, "Redis is experimental feature and it may not"
|
||||
" work with all plugins of your site.\nYou can "
|
||||
"disable it by changing cache type later.\nDo you wish"
|
||||
|
||||
@@ -711,18 +711,18 @@ def site_package_check(self, stype):
|
||||
if self.app.pargs.php and self.app.pargs.php73:
|
||||
Log.error(self,"Error: two different PHP versions cannot be combined within the same WordOps site")
|
||||
|
||||
if not self.app.pargs.php and stype in ['php', 'mysql', 'wp', 'wpsubdir', 'wpsubdomain']:
|
||||
if not self.app.pargs.php73 and stype in ['php', 'mysql', 'wp', 'wpsubdir', 'wpsubdomain']:
|
||||
Log.debug(self, "Setting apt_packages variable for PHP 7.2")
|
||||
apt_packages = apt_packages + WOVariables.wo_php + WOVariables.wo_php_extra
|
||||
|
||||
if self.app.pargs.php and stype in [ 'mysql', 'wp', 'wpsubdir', 'wpsubdomain']:
|
||||
if self.app.pargs.php73 and stype in [ 'mysql', 'wp', 'wpsubdir', 'wpsubdomain']:
|
||||
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.2")
|
||||
Log.debug(self, "Setting apt_packages variable for PHP 7.3")
|
||||
if not WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
apt_packages = apt_packages + WOVariables.wo_php + WOVariables.wo_php_extra
|
||||
apt_packages = apt_packages + WOVariables.wo_php73 + WOVariables.wo_php_extra
|
||||
else:
|
||||
Log.debug(self, "Setting apt_packages variable for PHP 7.2")
|
||||
if not WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
Log.debug(self, "Setting apt_packages variable for PHP 7.3")
|
||||
if not WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
apt_packages = apt_packages + WOVariables.wo_php73
|
||||
|
||||
if stype in ['mysql', 'wp', 'wpsubdir', 'wpsubdomain']:
|
||||
@@ -896,8 +896,8 @@ def site_package_check(self, stype):
|
||||
if not WOFileUtils.grep(self, "/etc/nginx/conf.d/upstream.conf",
|
||||
"php73"):
|
||||
with open("/etc/nginx/conf.d/upstream.conf", "a") as php_file:
|
||||
php_file.write("upstream php73 {\nserver 127.0.0.1:9072;\n}\n"
|
||||
"upstream debug72 {\nserver 127.0.0.1:9172;\n}\n")
|
||||
php_file.write("upstream php73 {\nserver unix:/var/run/php/php73-fpm.sock;\n}\n"
|
||||
"upstream debug73 {\nserver 127.0.0.1:9173;\n}\n")
|
||||
|
||||
return(stack.install(apt_packages=apt_packages, packages=packages,
|
||||
disp_msg=False))
|
||||
|
||||
@@ -76,7 +76,7 @@ class WOStackController(CementBaseController):
|
||||
(['--phpredisadmin'],
|
||||
dict(help='Install phpRedisAdmin', action='store_true')),
|
||||
]
|
||||
usage = "ee stack (command) [options]"
|
||||
usage = "wo stack (command) [options]"
|
||||
|
||||
@expose(hide=True)
|
||||
def default(self):
|
||||
@@ -154,13 +154,14 @@ class WOStackController(CementBaseController):
|
||||
WORepo.add_key(self, WOVariables.wo_nginx_key)
|
||||
|
||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
||||
if set(WOVariables.wo_php73).issubset(set(apt_packages)):
|
||||
Log.info(self, "Adding repository for PHP 7.3, please wait...")
|
||||
if set(WOVariables.wo_php73).issubset(set(apt_packages)) \
|
||||
or set(WOVariables.wo_php).issubset(set(apt_packages)):
|
||||
Log.info(self, "Adding repository for PHP, please wait...")
|
||||
Log.debug(self, 'Adding ppa for PHP')
|
||||
WORepo.add(self, ppa=WOVariables.wo_php_repo)
|
||||
else:
|
||||
if set(WOVariables.wo_php).issubset(set(apt_packages)):
|
||||
Log.info(self, "Adding repository for PHP 7.2, please wait...")
|
||||
Log.info(self, "Adding repository for PHP, please wait...")
|
||||
# Add repository for php
|
||||
if WOVariables.wo_platform_distro == 'debian':
|
||||
if WOVariables.wo_platform_codename != 'jessie':
|
||||
@@ -244,7 +245,7 @@ class WOStackController(CementBaseController):
|
||||
wo_nginx.close()
|
||||
|
||||
data = dict(php="9000", debug="9001", hhvm="8000", php73="9072", debug7="9172",
|
||||
hhvmconf=False, php7conf=True if WOAptGet.is_installed(self, 'php7.2-fpm') else False)
|
||||
hhvmconf=False, php7conf=True if WOAptGet.is_installed(self, 'php7.3-fpm') else False)
|
||||
Log.debug(self, 'Writting the nginx configuration to '
|
||||
'file /etc/nginx/conf.d/upstream.conf')
|
||||
wo_nginx = open('/etc/nginx/conf.d/upstream.conf',
|
||||
@@ -627,8 +628,8 @@ class WOStackController(CementBaseController):
|
||||
if not WOFileUtils.grep(self, "/etc/nginx/conf.d/upstream.conf",
|
||||
"php73"):
|
||||
with open("/etc/nginx/conf.d/upstream.conf", "a") as php_file:
|
||||
php_file.write("upstream php73 {\nserver 127.0.0.1:9072;\n}\n"
|
||||
"upstream debug72 {\nserver 127.0.0.1:9172;\n}\n")
|
||||
php_file.write("upstream php73 {\nserver unix:/var/run/php/php73-fpm.sock;\n}\n"
|
||||
"upstream debug73 {\nserver 127.0.0.1:9172;\n}\n")
|
||||
|
||||
if set(WOVariables.wo_hhvm).issubset(set(apt_packages)):
|
||||
|
||||
@@ -774,7 +775,7 @@ class WOStackController(CementBaseController):
|
||||
# Parse /etc/php/7.2/fpm/php-fpm.conf
|
||||
data = dict(pid="/run/php/php7.2-fpm.pid", error_log="/var/log/php/7.2/fpm.log",
|
||||
include="/etc/php/7.2/fpm/pool.d/*.conf")
|
||||
Log.debug(self, "writting php5 configuration into "
|
||||
Log.debug(self, "writting php7.2 configuration into "
|
||||
"/etc/php/7.2/fpm/php-fpm.conf")
|
||||
wo_php_fpm = open('/etc/php/7.2/fpm/php-fpm.conf',
|
||||
encoding='utf-8', mode='w')
|
||||
@@ -796,7 +797,7 @@ class WOStackController(CementBaseController):
|
||||
config['www']['pm'] = 'ondemand'
|
||||
config['www']['chdir'] = '/'
|
||||
config['www']['prefix'] = '/var/run/php'
|
||||
config['www']['listen'] = 'php73-fpm.sock'
|
||||
config['www']['listen'] = 'php72-fpm.sock'
|
||||
config['www']['listen.backlog'] = '32768'
|
||||
with codecs.open('/etc/php/7.2/fpm/pool.d/www.conf',
|
||||
encoding='utf-8', mode='w') as configfile:
|
||||
@@ -899,7 +900,7 @@ class WOStackController(CementBaseController):
|
||||
# Parse /etc/php/7.3/fpm/php-fpm.conf
|
||||
data = dict(pid="/run/php/php7.3-fpm.pid", error_log="/var/log/php7.3-fpm.log",
|
||||
include="/etc/php/7.3/fpm/pool.d/*.conf")
|
||||
Log.debug(self, "writting php 7.0 configuration into "
|
||||
Log.debug(self, "writting php 7.3 configuration into "
|
||||
"/etc/php/7.3/fpm/php-fpm.conf")
|
||||
wo_php_fpm = open('/etc/php/7.3/fpm/php-fpm.conf',
|
||||
encoding='utf-8', mode='w')
|
||||
@@ -925,7 +926,7 @@ class WOStackController(CementBaseController):
|
||||
config['www']['listen.backlog'] = '32768'
|
||||
with codecs.open('/etc/php/7.3/fpm/pool.d/www.conf',
|
||||
encoding='utf-8', mode='w') as configfile:
|
||||
Log.debug(self, "writting PHP5 configuration into "
|
||||
Log.debug(self, "writting PHP 7.3 configuration into "
|
||||
"/etc/php/7.3/fpm/pool.d/www.conf")
|
||||
config.write(configfile)
|
||||
|
||||
@@ -936,13 +937,13 @@ class WOStackController(CementBaseController):
|
||||
"debug.conf", "[www]", "[debug]")
|
||||
config = configparser.ConfigParser()
|
||||
config.read('/etc/php/7.3/fpm/pool.d/debug.conf')
|
||||
config['debug']['listen'] = '127.0.0.1:9182'
|
||||
config['debug']['listen'] = '127.0.0.1:9173'
|
||||
config['debug']['rlimit_core'] = 'unlimited'
|
||||
config['debug']['slowlog'] = '/var/log/php/7.3/slow.log'
|
||||
config['debug']['request_slowlog_timeout'] = '10s'
|
||||
with open('/etc/php/7.3/fpm/pool.d/debug.conf',
|
||||
encoding='utf-8', mode='w') as confifile:
|
||||
Log.debug(self, "writting PHP5 configuration into "
|
||||
Log.debug(self, "writting PHP 7.3 configuration into "
|
||||
"/etc/php/7.3/fpm/pool.d/debug.conf")
|
||||
config.write(confifile)
|
||||
|
||||
@@ -999,41 +1000,41 @@ class WOStackController(CementBaseController):
|
||||
WOGit.add(self, ["/etc/php"], msg="Adding PHP into Git")
|
||||
WOService.restart_service(self, 'php7.3-fpm')
|
||||
|
||||
# preconfiguration for php7.2
|
||||
# preconfiguration for php7.3
|
||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') and set(WOVariables.wo_php).issubset(set(apt_packages)):
|
||||
# Create log directories
|
||||
if not os.path.exists('/var/log/php/7.2/'):
|
||||
Log.debug(self, 'Creating directory /var/log/php/7.2/')
|
||||
os.makedirs('/var/log/php/7.2/')
|
||||
if not os.path.exists('/var/log/php/7.3/'):
|
||||
Log.debug(self, 'Creating directory /var/log/php/7.3/')
|
||||
os.makedirs('/var/log/php/7.3/')
|
||||
|
||||
# Parse etc/php/7.2/fpm/php.ini
|
||||
config = configparser.ConfigParser()
|
||||
Log.debug(self, "configuring php file /etc/php/7.2/fpm/php.ini")
|
||||
config.read('/etc/php/7.2/fpm/php.ini')
|
||||
Log.debug(self, "configuring php file /etc/php/7.3/fpm/php.ini")
|
||||
config.read('/etc/php/7.3/fpm/php.ini')
|
||||
config['PHP']['expose_php'] = 'Off'
|
||||
config['PHP']['post_max_size'] = '64M'
|
||||
config['PHP']['upload_max_filesize'] = '64M'
|
||||
config['PHP']['max_execution_time'] = '30'
|
||||
config['PHP']['date.timezone'] = WOVariables.wo_timezone
|
||||
with open('/etc/php/7.2/fpm/php.ini',
|
||||
with open('/etc/php/7.3/fpm/php.ini',
|
||||
encoding='utf-8', mode='w') as configfile:
|
||||
Log.debug(self, "Writting php configuration into "
|
||||
"/etc/php/7.2/fpm/php.ini")
|
||||
"/etc/php/7.3/fpm/php.ini")
|
||||
config.write(configfile)
|
||||
|
||||
# Parse /etc/php/7.2/fpm/php-fpm.conf
|
||||
data = dict(pid="/run/php/php7.2-fpm.pid", error_log="/var/log/php/7.2/fpm.log",
|
||||
include="/etc/php/7.2/fpm/pool.d/*.conf")
|
||||
Log.debug(self, "writting php 7.0 configuration into "
|
||||
"/etc/php/7.2/fpm/php-fpm.conf")
|
||||
wo_php_fpm = open('/etc/php/7.2/fpm/php-fpm.conf',
|
||||
data = dict(pid="/run/php/php7.3-fpm.pid", error_log="/var/log/php/7.3/fpm.log",
|
||||
include="/etc/php/7.3/fpm/pool.d/*.conf")
|
||||
Log.debug(self, "writting php 7.3 configuration into "
|
||||
"/etc/php/7.3/fpm/php-fpm.conf")
|
||||
wo_php_fpm = open('/etc/php/7.3/fpm/php-fpm.conf',
|
||||
encoding='utf-8', mode='w')
|
||||
self.app.render((data), 'php-fpm.mustache', out=wo_php_fpm)
|
||||
wo_php_fpm.close()
|
||||
|
||||
# Parse /etc/php/7.2/fpm/pool.d/www.conf
|
||||
# Parse /etc/php/7.3/fpm/pool.d/www.conf
|
||||
config = configparser.ConfigParser()
|
||||
config.read_file(codecs.open('/etc/php/7.2/fpm/pool.d/www.conf',
|
||||
config.read_file(codecs.open('/etc/php/7.3/fpm/pool.d/www.conf',
|
||||
"r", "utf8"))
|
||||
config['www']['ping.path'] = '/ping'
|
||||
config['www']['pm.status_path'] = '/status'
|
||||
@@ -1044,31 +1045,34 @@ class WOStackController(CementBaseController):
|
||||
config['www']['pm.max_spare_servers'] = '5'
|
||||
config['www']['request_terminate_timeout'] = '100'
|
||||
config['www']['pm'] = 'ondemand'
|
||||
config['www']['listen'] = '127.0.0.1:9072'
|
||||
with codecs.open('/etc/php/7.2/fpm/pool.d/www.conf',
|
||||
config['www']['chdir'] = '/'
|
||||
config['www']['prefix'] = '/var/run/php'
|
||||
config['www']['listen'] = 'php73-fpm.sock'
|
||||
config['www']['listen.backlog'] = '32768'
|
||||
with codecs.open('/etc/php/7.3/fpm/pool.d/www.conf',
|
||||
encoding='utf-8', mode='w') as configfile:
|
||||
Log.debug(self, "writting PHP5 configuration into "
|
||||
"/etc/php/7.2/fpm/pool.d/www.conf")
|
||||
Log.debug(self, "writting PHP 7.3 configuration into "
|
||||
"/etc/php/7.3/fpm/pool.d/www.conf")
|
||||
config.write(configfile)
|
||||
|
||||
# Generate /etc/php/7.2/fpm/pool.d/debug.conf
|
||||
WOFileUtils.copyfile(self, "/etc/php/7.2/fpm/pool.d/www.conf",
|
||||
"/etc/php/7.2/fpm/pool.d/debug.conf")
|
||||
WOFileUtils.searchreplace(self, "/etc/php/7.2/fpm/pool.d/"
|
||||
# Generate /etc/php/7.3/fpm/pool.d/debug.conf
|
||||
WOFileUtils.copyfile(self, "/etc/php/7.3/fpm/pool.d/www.conf",
|
||||
"/etc/php/7.3/fpm/pool.d/debug.conf")
|
||||
WOFileUtils.searchreplace(self, "/etc/php/7.3/fpm/pool.d/"
|
||||
"debug.conf", "[www]", "[debug]")
|
||||
config = configparser.ConfigParser()
|
||||
config.read('/etc/php/7.2/fpm/pool.d/debug.conf')
|
||||
config['debug']['listen'] = '127.0.0.1:9172'
|
||||
config.read('/etc/php/7.3/fpm/pool.d/debug.conf')
|
||||
config['debug']['listen'] = '127.0.0.1:9173'
|
||||
config['debug']['rlimit_core'] = 'unlimited'
|
||||
config['debug']['slowlog'] = '/var/log/php/7.2/slow.log'
|
||||
config['debug']['slowlog'] = '/var/log/php/7.3/slow.log'
|
||||
config['debug']['request_slowlog_timeout'] = '10s'
|
||||
with open('/etc/php/7.2/fpm/pool.d/debug.conf',
|
||||
with open('/etc/php/7.3/fpm/pool.d/debug.conf',
|
||||
encoding='utf-8', mode='w') as confifile:
|
||||
Log.debug(self, "writting PHP5 configuration into "
|
||||
"/etc/php/7.2/fpm/pool.d/debug.conf")
|
||||
Log.debug(self, "writting PHP 7.3 configuration into "
|
||||
"/etc/php/7.3/fpm/pool.d/debug.conf")
|
||||
config.write(confifile)
|
||||
|
||||
with open("/etc/php/7.2/fpm/pool.d/debug.conf",
|
||||
with open("/etc/php/7.3/fpm/pool.d/debug.conf",
|
||||
encoding='utf-8', mode='a') as myfile:
|
||||
myfile.write("php_admin_value[xdebug.profiler_output_dir] "
|
||||
"= /tmp/ \nphp_admin_value[xdebug.profiler_"
|
||||
@@ -1078,8 +1082,8 @@ class WOStackController(CementBaseController):
|
||||
"profiler_enable] = off\n")
|
||||
|
||||
# Disable xdebug
|
||||
if not WOShellExec.cmd_exec(self, "grep -q \';zend_extension\' /etc/php/7.2/mods-available/xdebug.ini"):
|
||||
WOFileUtils.searchreplace(self, "/etc/php/7.2/mods-available/"
|
||||
if not WOShellExec.cmd_exec(self, "grep -q \';zend_extension\' /etc/php/7.3/mods-available/xdebug.ini"):
|
||||
WOFileUtils.searchreplace(self, "/etc/php/7.3/mods-available/"
|
||||
"xdebug.ini",
|
||||
"zend_extension",
|
||||
";zend_extension")
|
||||
@@ -1119,7 +1123,7 @@ class WOStackController(CementBaseController):
|
||||
WOVariables.wo_php_user, recursive=True)
|
||||
|
||||
WOGit.add(self, ["/etc/php"], msg="Adding PHP into Git")
|
||||
WOService.restart_service(self, 'php7.2-fpm')
|
||||
WOService.restart_service(self, 'php7.3-fpm')
|
||||
|
||||
if set(WOVariables.wo_mysql).issubset(set(apt_packages)):
|
||||
if not os.path.isfile("/etc/mysql/my.cnf"):
|
||||
@@ -1147,9 +1151,9 @@ class WOStackController(CementBaseController):
|
||||
WOService.reload_service(self, 'mysql')
|
||||
|
||||
if len(packages):
|
||||
if any('/usr/bin/wp' == x[1] for x in packages):
|
||||
Log.debug(self, "Setting Privileges to /usr/bin/wp file ")
|
||||
WOFileUtils.chmod(self, "/usr/bin/wp", 0o775)
|
||||
if any('/usr/local/bin/wp' == x[1] for x in packages):
|
||||
Log.debug(self, "Setting Privileges to /usr/local/bin/wp file ")
|
||||
WOFileUtils.chmod(self, "/usr/local/bin/wp", 0o775)
|
||||
|
||||
if any('/tmp/pma.tar.gz' == x[1]
|
||||
for x in packages):
|
||||
@@ -1175,7 +1179,7 @@ class WOStackController(CementBaseController):
|
||||
.format(WOVariables.wo_webroot))
|
||||
blowfish_key = ''.join([random.choice
|
||||
(string.ascii_letters + string.digits)
|
||||
for n in range(10)])
|
||||
for n in range(25)])
|
||||
WOFileUtils.searchreplace(self,
|
||||
'{0}22222/htdocs/db/pma/config.inc.php'
|
||||
.format(WOVariables.wo_webroot),
|
||||
@@ -1398,7 +1402,7 @@ class WOStackController(CementBaseController):
|
||||
|
||||
if self.app.pargs.php:
|
||||
Log.debug(self, "Setting apt_packages variable for PHP 7.2")
|
||||
if not (WOAptGet.is_installed(self, 'php5-fpm') or WOAptGet.is_installed(self, 'php7.2-fpm')):
|
||||
if not (WOAptGet.is_installed(self, 'php7.2-fpm') or WOAptGet.is_installed(self, 'php7.2-fpm')):
|
||||
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 + WOVariables.wo_php_extra
|
||||
else:
|
||||
@@ -1413,7 +1417,7 @@ class WOStackController(CementBaseController):
|
||||
Log.debug(self, "Setting apt_packages variable for PHP 7.3")
|
||||
if not WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
apt_packages = apt_packages + WOVariables.wo_php73
|
||||
if not WOAptGet.is_installed(self, 'php5-fpm'):
|
||||
if not WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
apt_packages = apt_packages + WOVariables.wo_php
|
||||
else:
|
||||
Log.debug(self, "PHP 7.3 already installed")
|
||||
@@ -1429,6 +1433,8 @@ class WOStackController(CementBaseController):
|
||||
Log.debug(self, "Setting apt_packages variable for PHP 7.3")
|
||||
if not WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
apt_packages = apt_packages + WOVariables.wo_php73 + WOVariables.wo_php_extra
|
||||
if not WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
apt_packages = apt_packages + WOVariables.wo_php + WOVariables.wo_php_extra
|
||||
else:
|
||||
Log.debug(self, "PHP 7.3 already installed")
|
||||
Log.info(self, "PHP 7.3 already installed")
|
||||
@@ -1640,7 +1646,7 @@ class WOStackController(CementBaseController):
|
||||
Log.debug(self, "Removing apt_packages variable of PHP")
|
||||
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
|
||||
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
|
||||
else:
|
||||
apt_packages = apt_packages + WOVariables.wo_php
|
||||
@@ -1650,7 +1656,7 @@ class WOStackController(CementBaseController):
|
||||
if (WOVariables.wo_platform_codename == 'jessie'):
|
||||
Log.debug(self, "Removing apt_packages variable of PHP 7.3")
|
||||
apt_packages = apt_packages + WOVariables.wo_php73
|
||||
if not WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
if not WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
apt_packages = apt_packages + WOVariables.wo_php_extra
|
||||
else:
|
||||
Log.info(self, "PHP 7.3 not supported.")
|
||||
@@ -1659,7 +1665,7 @@ class WOStackController(CementBaseController):
|
||||
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")
|
||||
apt_packages = apt_packages + WOVariables.wo_php73
|
||||
if not WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
if not WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
apt_packages = apt_packages + WOVariables.wo_php_extra
|
||||
else:
|
||||
Log.info(self, "PHP 7.3 not supported.")
|
||||
@@ -1788,9 +1794,11 @@ class WOStackController(CementBaseController):
|
||||
if self.app.pargs.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'):
|
||||
apt_packages = apt_packages + WOVariables.wo_php_extra
|
||||
apt_packages = apt_packages + WOVariables.wo_php
|
||||
if not WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
apt_packages = apt_packages + WOVariables.wo_php_extra
|
||||
else:
|
||||
apt_packages = apt_packages + WOVariables.wo_php73
|
||||
apt_packages = apt_packages + WOVariables.wo_php
|
||||
|
||||
# For debian --php73
|
||||
if self.app.pargs.php73:
|
||||
@@ -1806,7 +1814,7 @@ class WOStackController(CementBaseController):
|
||||
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")
|
||||
apt_packages = apt_packages + WOVariables.wo_php73
|
||||
if not WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
if not WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
apt_packages = apt_packages + WOVariables.wo_php_extra
|
||||
else:
|
||||
Log.info(self, "PHP 7.3 not supported.")
|
||||
@@ -1814,14 +1822,7 @@ class WOStackController(CementBaseController):
|
||||
if WOAptGet.is_installed(self, 'hhvm'):
|
||||
Log.debug(self, "Purge apt_packages varible of HHVM")
|
||||
apt_packages = apt_packages + WOVariables.wo_hhvm
|
||||
if self.app.pargs.redis:
|
||||
Log.debug(self, "Purge apt_packages variable of Redis")
|
||||
apt_packages = apt_packages + WOVariables.wo_redis
|
||||
if self.app.pargs.mysql:
|
||||
Log.debug(self, "Purge apt_packages variable MySQL")
|
||||
apt_packages = apt_packages + WOVariables.wo_mysql
|
||||
packages = packages + ['/usr/bin/mysqltuner']
|
||||
if self.app.pargs.wpcli:
|
||||
|
||||
Log.debug(self, "Purge package variable WPCLI")
|
||||
if os.path.isfile('/usr/bin/wp'):
|
||||
packages = packages + ['/usr/bin/wp']
|
||||
@@ -1880,8 +1881,8 @@ class WOStackController(CementBaseController):
|
||||
|
||||
# Added for php Ondrej repo missing package fix
|
||||
if self.app.pargs.php73:
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
Log.info(self, "PHP7.3-fpm found on system.")
|
||||
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(
|
||||
|
||||
@@ -46,10 +46,10 @@ class WOStackStatusController(CementBaseController):
|
||||
else:
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
|
||||
if self.app.pargs.php73:
|
||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
||||
@@ -116,17 +116,17 @@ class WOStackStatusController(CementBaseController):
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP5-FPM is not installed")
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
else:
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
|
||||
if self.app.pargs.php73:
|
||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
||||
@@ -200,10 +200,10 @@ class WOStackStatusController(CementBaseController):
|
||||
else:
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
|
||||
if self.app.pargs.php73:
|
||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
||||
@@ -278,10 +278,10 @@ class WOStackStatusController(CementBaseController):
|
||||
else:
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
|
||||
if self.app.pargs.php73:
|
||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
||||
@@ -355,10 +355,10 @@ class WOStackStatusController(CementBaseController):
|
||||
else:
|
||||
Log.info(self, "php7.2-fpm is not installed")
|
||||
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
|
||||
if self.app.pargs.php73:
|
||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
||||
@@ -367,7 +367,7 @@ class WOStackStatusController(CementBaseController):
|
||||
else:
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
else:
|
||||
Log.info(self, "Your platform does not support PHP 7")
|
||||
Log.info(self, "Your platform does not support PHP 7.3")
|
||||
|
||||
if self.app.pargs.mysql:
|
||||
if ((WOVariables.wo_mysql_host is "localhost") or
|
||||
|
||||
@@ -89,8 +89,8 @@ class WOStackUpgradeController(CementBaseController):
|
||||
|
||||
if ((not self.app.pargs.web) and (not self.app.pargs.nginx) and
|
||||
(not self.app.pargs.php) and (not self.app.pargs.mysql) and
|
||||
(not self.app.pargs.hhvm) and (not self.app.pargs.all) and
|
||||
(not self.app.pargs.wpcli) and (not self.app.pargs.redis) and
|
||||
(not self.app.pargs.hhvm) and (not self.app.pargs.all) and
|
||||
(not self.app.pargs.wpcli) and (not self.app.pargs.redis) and
|
||||
(not self.app.pargs.nginxmainline)):
|
||||
self.app.pargs.web = True
|
||||
|
||||
@@ -178,13 +178,13 @@ class WOStackUpgradeController(CementBaseController):
|
||||
|
||||
if len(packages):
|
||||
if self.app.pargs.wpcli:
|
||||
WOFileUtils.remove(self,['/usr/bin/wp'])
|
||||
WOFileUtils.remove(self,['/usr/local/bin/wp'])
|
||||
|
||||
Log.debug(self, "Downloading following: {0}".format(packages))
|
||||
WODownload.download(self, packages)
|
||||
|
||||
if self.app.pargs.wpcli:
|
||||
WOFileUtils.chmod(self, "/usr/bin/wp", 0o775)
|
||||
WOFileUtils.chmod(self, "/usr/local/bin/wp", 0o775)
|
||||
|
||||
Log.info(self, "Successfully updated packages")
|
||||
else:
|
||||
|
||||
@@ -39,6 +39,6 @@ server {
|
||||
location ~ \.php$ {
|
||||
try_files $uri =404;
|
||||
include fastcgi_params;
|
||||
fastcgi_pass php;
|
||||
fastcgi_pass php72;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ location = /nginx_status {
|
||||
}
|
||||
location ~ ^/(status|ping)$ {
|
||||
include fastcgi_params;
|
||||
fastcgi_pass php7;
|
||||
fastcgi_pass php73;
|
||||
include common/acl.conf;
|
||||
}
|
||||
# WordOps (wo) utilities
|
||||
|
||||
@@ -59,7 +59,7 @@ location = /nginx_status {
|
||||
}
|
||||
location ~ ^/(status|ping)$ {
|
||||
include fastcgi_params;
|
||||
fastcgi_pass php;
|
||||
fastcgi_pass php72;
|
||||
include common/acl.conf;
|
||||
}
|
||||
# WordOps (wo) utilities
|
||||
|
||||
@@ -18,13 +18,14 @@ fastcgi_read_timeout 300;
|
||||
client_max_body_size 100m;
|
||||
|
||||
# SSL Settings
|
||||
ssl_protocols TLSv1.1 TLSv1.2;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_timeout 10m;
|
||||
ssl_protocols TLSv1.2;
|
||||
ssl_session_cache shared:SSL:50m;
|
||||
ssl_session_timeout 1d;
|
||||
ssl_session_tickets off;
|
||||
{{#Ubuntu}}
|
||||
ssl_prefer_server_ciphers on;
|
||||
{{/Ubuntu}}
|
||||
ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-CHACHA20-POLY1305:EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
|
||||
ssl_ciphers "EECDH+CHACHA20:EECDH+AESGCM:EECDH+AES";
|
||||
|
||||
# Log format Settings
|
||||
log_format rt_cache '$remote_addr $upstream_response_time $upstream_cache_status [$time_local] '
|
||||
|
||||
@@ -4,7 +4,7 @@ server 127.0.0.1:9000;
|
||||
}
|
||||
upstream debug {
|
||||
# Debug Pool
|
||||
server 127.0.0.1:9100;
|
||||
server 127.0.0.1:9001;
|
||||
}
|
||||
upstream php72 {
|
||||
server unix:/var/run/php/php72-fpm.sock;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
location = /wp-login.php {
|
||||
limit_req zone=one burst=1 nodelay;
|
||||
include fastcgi_params;
|
||||
fastcgi_pass php;
|
||||
fastcgi_pass php72;
|
||||
}
|
||||
# Disable wp-config.txt
|
||||
location = /wp-config.txt {
|
||||
|
||||
@@ -1,28 +1,11 @@
|
||||
# WPFC NGINX CONFIGURATION
|
||||
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
||||
set $skip_cache 0;
|
||||
# POST requests and URL with a query string should always go to php
|
||||
if ($request_method = POST) {
|
||||
set $skip_cache 1;
|
||||
}
|
||||
if ($query_string != "") {
|
||||
set $skip_cache 1;
|
||||
}
|
||||
# Don't cache URL containing the following segments
|
||||
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") {
|
||||
set $skip_cache 1;
|
||||
}
|
||||
# Don't use the cache for logged in users or recent commenter or customer with items in cart
|
||||
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") {
|
||||
set $skip_cache 1;
|
||||
}
|
||||
# $skip_cache variable set in /etc/nginx/conf.d/map-wp-fastcgi-cache.conf
|
||||
|
||||
# Use cached or actual file if they exists, Otherwise pass request to WordPress
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php$is_args$args;
|
||||
}
|
||||
location ~ ^/wp-content/cache/minify/(.+\.(css|js))$ {
|
||||
try_files $uri /wp-content/plugins/w3-total-cache/pub/minify.php?file=$1;
|
||||
}
|
||||
location ~ \.php$ {
|
||||
try_files $uri =404;
|
||||
include fastcgi_params;
|
||||
|
||||
@@ -1,28 +1,11 @@
|
||||
# WPFC NGINX CONFIGURATION
|
||||
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
||||
set $skip_cache 0;
|
||||
# POST requests and URL with a query string should always go to php
|
||||
if ($request_method = POST) {
|
||||
set $skip_cache 1;
|
||||
}
|
||||
if ($query_string != "") {
|
||||
set $skip_cache 1;
|
||||
}
|
||||
# Don't cache URL containing the following segments
|
||||
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*\.php|index.php|/feed/|.*sitemap.*\.xml)") {
|
||||
set $skip_cache 1;
|
||||
}
|
||||
# Don't use the cache for logged in users or recent commenter or customer with items in cart
|
||||
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|[a-z0-9]+_items_in_cart") {
|
||||
set $skip_cache 1;
|
||||
}
|
||||
# $skip_cache variable set in /etc/nginx/conf.d/map-wp-fastcgi-cache.conf
|
||||
|
||||
# Use cached or actual file if they exists, Otherwise pass request to WordPress
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php$is_args$args;
|
||||
}
|
||||
location ~ ^/wp-content/cache/minify/(.+\.(css|js))$ {
|
||||
try_files $uri /wp-content/plugins/w3-total-cache/pub/minify.php?file=$1;
|
||||
}
|
||||
location ~ \.php$ {
|
||||
try_files $uri =404;
|
||||
include fastcgi_params;
|
||||
|
||||
@@ -12,10 +12,10 @@ class WOVariables():
|
||||
"""Intialization of core variables"""
|
||||
|
||||
# WordOps version
|
||||
wo_version = "3.9.2"
|
||||
wo_version = "3.9.5"
|
||||
# WordOps packages versions
|
||||
wo_wp_cli = "2.0.1"
|
||||
wo_adminer = "4.6.3"
|
||||
wo_wp_cli = "2.1.0"
|
||||
wo_adminer = "4.7.1"
|
||||
|
||||
# Get WPCLI path
|
||||
wo_wpcli_path = os.popen('command -v wp | tr "\n" " "').read()
|
||||
@@ -113,7 +113,7 @@ class WOVariables():
|
||||
"php7.3-cli", "php7.3-mbstring",
|
||||
"php7.3-bcmath", "php7.3-mysql", "php7.3-opcache", "php7.3-zip", "php7.3-xml", "php7.3-soap"]
|
||||
wo_php_extra = ["php-memcached", "php-imagick",
|
||||
"graphviz", "php-pear", "php-xdebug", "php-msgpack", "php-redis"]
|
||||
"graphviz", "php-xdebug", "php-msgpack", "php-redis"]
|
||||
elif wo_platform_distro == 'debian':
|
||||
wo_php_repo = (
|
||||
"deb https://packages.sury.org/php/ {codename} main".format(codename=wo_platform_codename))
|
||||
@@ -121,13 +121,13 @@ class WOVariables():
|
||||
"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", "php7.2-msgpack",
|
||||
"php7.2-soap", "php-msgpack",
|
||||
"graphviz", "php-pear", "php-xdebug"]
|
||||
wo_php73 = ["php7.3-fpm", "php7.3-curl", "php7.3-gd", "php7.3-imap",
|
||||
"php7.3-common", "php7.3-readline", "php-redis",
|
||||
"php7.3-mysql", "php7.3-cli", "php-imagick",
|
||||
"php7.3-mbstring", "php7.3-recode", "php7.3-bcmath", "php7.3-opcache", "php7.3-zip", "php7.3-xml",
|
||||
"php7.3-soap", "php7.3-msgpack",
|
||||
"php7.3-soap", "php-msgpack",
|
||||
"graphviz", "php-pear", "php-xdebug"]
|
||||
wo_php_extra = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user