remove hhvm

This commit is contained in:
VirtuBox
2019-03-13 05:02:53 +01:00
parent 5756fb6a56
commit 65068c6727
19 changed files with 59 additions and 546 deletions

2
.gitignore vendored
View File

@@ -64,3 +64,5 @@ coverage_report/
include/
local/
man/
\.pytest_cache/

42
install
View File

@@ -481,12 +481,6 @@ wo_update_latest()
sed -i "s/.*X-Powered-By.*/\tadd_header X-Powered-By \"WordOps $wo_version_new\";/" /etc/nginx/conf.d/wo-plus.conf &>> /dev/null
fi
# Fix HHVM autostart on reboot
CHECK_HHVM_INSTALL=$(dpkg --get-selections | grep -v deinstall | grep hhvm &>> /dev/null)
if [ -n "$CHECK_HHVM_INSTALL" ]; then
update-rc.d hhvm defaults &>> /dev/null
fi
# Fix WordPress example.html issue
# Ref: http://wptavern.com/xss-vulnerability-in-jetpack-and-the-twenty-fifteen-default-theme-affects-millions-of-wordpress-users
dpkg --get-selections | grep -v deinstall | grep nginx &>> /dev/null
@@ -494,48 +488,12 @@ wo_update_latest()
cp /usr/lib/wo/templates/locations.mustache /etc/nginx/common/locations.conf &>> /dev/null
fi
# Fix HHVM upstream issue that was preventing from using EasyEngine for site operations
if [ -f /etc/nginx/conf.d/upstream.conf ]; then
grep -Hr hhvm /etc/nginx/conf.d/upstream.conf &>> /dev/null
if [ $? -ne 0 ]; then
echo -e "upstream hhvm {\n# HHVM Pool\nserver 127.0.0.1:8000;\nserver 127.0.0.1:9000 backup;\n}\n" >> /etc/nginx/conf.d/upstream.conf
fi
fi
# Fix HHVM server IP
if [ -f /etc/hhvm/server.ini ]; then
grep -Hr "hhvm.server.ip" /etc/hhvm/server.ini &>> /dev/null
if [ $? -ne 0 ]; then
echo -e "hhvm.server.ip = 127.0.0.1\n" >> /etc/hhvm/server.ini
fi
fi
# Rename Redis Header
if [ -f /etc/nginx/common/redis-hhvm.conf ]; then
sed -i "s/X-Cache /X-SRCache-Fetch-Status /g" /etc/nginx/common/redis-hhvm.conf &>> /dev/null
sed -i "s/X-Cache-2 /X-SRCache-Store-Status /g" /etc/nginx/common/redis-hhvm.conf &>> /dev/null
fi
if [ -f /etc/nginx/common/redis.conf ]; then
sed -i "s/X-Cache /X-SRCache-Fetch-Status /g" /etc/nginx/common/redis.conf &>> /dev/null
sed -i "s/X-Cache-2 /X-SRCache-Store-Status /g" /etc/nginx/common/redis.conf &>> /dev/null
fi
if [ -f /etc/nginx/common/redis-hhvm.conf ]; then
# Update Timeout redis-hhvm.conf
grep -0 'redis2_query expire $key 6h' /etc/nginx/common/redis-hhvm.conf &>> /dev/null
if [ $? -eq 0 ]; then
sed -i 's/redis2_query expire $key 6h/redis2_query expire $key 14400/g' /etc/nginx/common/redis-hhvm.conf &>> /dev/null
fi
#Fix for 3.3.4 redis-hhvm issue
grep -0 'HTTP_ACCEPT_ENCODING' /etc/nginx/common/redis-hhvm.conf &>> /dev/null
if [ $? -ne 0 ]; then
sed -i 's/fastcgi_params;/fastcgi_params;\n fastcgi_param HTTP_ACCEPT_ENCODING "";/g' /etc/nginx/common/redis-hhvm.conf &>> /dev/null
fi
fi
# Fix Redis-server security issue
# http://redis.io/topics/security
if [ -f /etc/redis/redis.conf ]; then

View File

@@ -188,27 +188,24 @@ class WODebugController(CementBaseController):
nc = NginxConfig()
nc.loadf('/etc/nginx/conf.d/upstream.conf')
nc.set([('upstream', 'php',), 'server'], '127.0.0.1:9001')
if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"):
nc.set([('upstream', 'hhvm',), 'server'], '127.0.0.1:9001')
nc.savef('/etc/nginx/conf.d/upstream.conf')
# Enable xdebug
WOFileUtils.searchreplace(self, "/etc/{0}/mods-available/".format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5") +
WOFileUtils.searchreplace(self, "/etc/{0}/mods-available/".format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5") +
"xdebug.ini",
";zend_extension",
"zend_extension")
# Fix slow log is not enabled default in PHP5.6
config = configparser.ConfigParser()
config.read('/etc/{0}/fpm/pool.d/debug.conf'.format("php/7.2" if (WOVariables.wo_platform_codename ==
'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
config.read('/etc/{0}/fpm/pool.d/debug.conf'.format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5"))
config['debug']['slowlog'] = '/var/log/{0}/slow.log'.format("php/7.2" if (
WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")
WOVariables.wo_platform_distro == 'ubuntu') else "php5")
config['debug']['request_slowlog_timeout'] = '10s'
with open('/etc/{0}/fpm/pool.d/debug.conf'.format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"),
with open('/etc/{0}/fpm/pool.d/debug.conf'.format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5"),
encoding='utf-8', mode='w') as confifile:
Log.debug(self, "Writting debug.conf configuration into "
"/etc/{0}/fpm/pool.d/debug.conf".format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
"/etc/{0}/fpm/pool.d/debug.conf".format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5"))
config.write(confifile)
self.trigger_php = True
@@ -217,7 +214,7 @@ class WODebugController(CementBaseController):
Log.info(self, "PHP debug is already enabled")
self.msg = self.msg + ['/var/log/{0}/slow.log'.format("php/7.2" if (
WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")]
WOVariables.wo_platform_distro == 'ubuntu') else "php5")]
# PHP global debug stop
elif (self.app.pargs.php == 'off' and not self.app.pargs.site_name):
@@ -230,12 +227,10 @@ class WODebugController(CementBaseController):
nc = NginxConfig()
nc.loadf('/etc/nginx/conf.d/upstream.conf')
nc.set([('upstream', 'php',), 'server'], '127.0.0.1:9000')
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')
# Disable xdebug
WOFileUtils.searchreplace(self, "/etc/{0}/mods-available/".format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5") +
WOFileUtils.searchreplace(self, "/etc/{0}/mods-available/".format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5") +
"xdebug.ini",
"zend_extension",
";zend_extension")
@@ -251,43 +246,41 @@ class WODebugController(CementBaseController):
# PHP5-FPM start global debug
if (self.app.pargs.fpm == 'on' and not self.app.pargs.site_name):
if not WOShellExec.cmd_exec(self, "grep \"log_level = debug\" "
"/etc/{0}/fpm/php-fpm.conf".format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")):
"/etc/{0}/fpm/php-fpm.conf".format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5")):
Log.info(self, "Setting up PHP5-FPM log_level = debug")
config = configparser.ConfigParser()
config.read('/etc/{0}/fpm/php-fpm.conf'.format("php/7.2" if (WOVariables.wo_platform_codename ==
'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
config.read('/etc/{0}/fpm/php-fpm.conf'.format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5"))
config.remove_option('global', 'include')
config['global']['log_level'] = 'debug'
config['global']['include'] = '/etc/{0}/fpm/pool.d/*.conf'.format("php/7.2" if (
WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")
with open('/etc/{0}/fpm/php-fpm.conf'.format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"),
WOVariables.wo_platform_distro == 'ubuntu') else "php5")
with open('/etc/{0}/fpm/php-fpm.conf'.format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5"),
encoding='utf-8', mode='w') as configfile:
Log.debug(self, "Writting php5-FPM configuration into "
"/etc/{0}/fpm/php-fpm.conf".format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
"/etc/{0}/fpm/php-fpm.conf".format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5"))
config.write(configfile)
self.trigger_php = True
else:
Log.info(self, "PHP5-FPM log_level = debug already setup")
self.msg = self.msg + ['/var/log/{0}/fpm.log'.format("php/7.2" if (
WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")]
WOVariables.wo_platform_distro == 'ubuntu') else "php5")]
# PHP5-FPM stop global debug
elif (self.app.pargs.fpm == 'off' and not self.app.pargs.site_name):
if WOShellExec.cmd_exec(self, "grep \"log_level = debug\" "
"/etc/{0}/fpm/php-fpm.conf".format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")):
"/etc/{0}/fpm/php-fpm.conf".format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5")):
Log.info(self, "Disabling PHP5-FPM log_level = debug")
config = configparser.ConfigParser()
config.read('/etc/{0}/fpm/php-fpm.conf'.format("php/7.2" if (WOVariables.wo_platform_codename ==
'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
config.read('/etc/{0}/fpm/php-fpm.conf'.format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5"))
config.remove_option('global', 'include')
config['global']['log_level'] = 'notice'
config['global']['include'] = '/etc/{0}/fpm/pool.d/*.conf'.format("php/7.2" if (
WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")
with open('/etc/{0}/fpm/php-fpm.conf'.format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"),
WOVariables.wo_platform_distro == 'ubuntu') else "php5")
with open('/etc/{0}/fpm/php-fpm.conf'.format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5"),
encoding='utf-8', mode='w') as configfile:
Log.debug(self, "writting php5 configuration into "
"/etc/{0}/fpm/php-fpm.conf".format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
"/etc/{0}/fpm/php-fpm.conf".format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5"))
config.write(configfile)
self.trigger_php = True
@@ -300,8 +293,6 @@ class WODebugController(CementBaseController):
# PHP global debug start
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.3 not supported.")
if not (WOShellExec.cmd_exec(self, "sed -n \"/upstream php73"
"{/,/}/p \" /etc/nginx/"
"conf.d/upstream.conf "
@@ -313,8 +304,6 @@ class WODebugController(CementBaseController):
nc = NginxConfig()
nc.loadf('/etc/nginx/conf.d/upstream.conf')
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:9173')
nc.savef('/etc/nginx/conf.d/upstream.conf')
# Enable xdebug
@@ -352,8 +341,6 @@ class WODebugController(CementBaseController):
nc = NginxConfig()
nc.loadf('/etc/nginx/conf.d/upstream.conf')
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')
# Disable xdebug
@@ -633,7 +620,7 @@ 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 WOVariables.wo_platform_distro == 'ubuntu':
if WOAptGet.is_installed(self, 'php7.2-fpm'):
WOService.reload_service(self, 'php7.2-fpm')
if WOAptGet.is_installed(self, 'php7.3-fpm'):
@@ -724,7 +711,7 @@ class WODebugController(CementBaseController):
self.app.pargs.nginx = 'on'
self.app.pargs.php = 'on'
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'):
if (WOVariables.wo_platform_distro == 'ubuntu') and WOAptGet.is_installed(self, 'php7.2-fpm'):
self.app.pargs.php73 = 'on'
self.app.pargs.fpm73 = 'on'
self.app.pargs.mysql = 'on'
@@ -736,7 +723,7 @@ class WODebugController(CementBaseController):
self.app.pargs.nginx = 'off'
self.app.pargs.php = 'off'
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'):
if (WOVariables.wo_platform_distro == 'ubuntu') and WOAptGet.is_installed(self, 'php7.2-fpm'):
self.app.pargs.php73 = 'off'
self.app.pargs.fpm73 = 'off'
self.app.pargs.mysql = 'off'
@@ -781,15 +768,10 @@ class WODebugController(CementBaseController):
WOService.reload_service(self, 'nginx')
# 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, '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, 'php7.2-fpm')
if WOVariables.wo_platform_codename == 'jessie':
WOService.restart_service(self, 'php7.2-fpm')
if len(self.msg) > 0:
if not self.app.pargs.interactive:

View File

@@ -148,8 +148,6 @@ class WOSiteController(CementBaseController):
wo_db_user = siteinfo.db_user
wo_db_pass = siteinfo.db_password
wo_db_host = siteinfo.db_host
if sitetype != "html":
hhvm = ("enabled" if siteinfo.is_hhvm else "disabled")
if sitetype == "proxy":
access_log = "/var/log/nginx/{0}.access.log".format(wo_domain)
error_log = "/var/log/nginx/{0}.error.log".format(wo_domain)
@@ -331,8 +329,6 @@ class WOSiteCreateController(CementBaseController):
(['--wpredis'],
dict(help="create wordpress single/multi site with redis cache",
action='store_true')),
(['--hhvm'],
dict(help="create HHVM site", action='store_true')),
(['-le', '--letsencrypt'],
dict(help="configure letsencrypt ssl for the site", action='store_true')),
(['--subdomain'],
@@ -375,8 +371,6 @@ class WOSiteCreateController(CementBaseController):
stype, cache = 'html', 'basic'
elif stype and self.app.pargs.proxy:
Log.error(self, "proxy should not be used with other site types")
if (self.app.pargs.proxy and self.app.pargs.hhvm):
Log.error(self, "Proxy site can not run on hhvm")
if not self.app.pargs.site_name:
try:
@@ -452,8 +446,6 @@ class WOSiteCreateController(CementBaseController):
else:
pass
if stype == "html" and self.app.pargs.hhvm:
Log.error(self, "Can not create HTML site with HHVM")
if data and self.app.pargs.php73:
if (self.app.pargs.experimental):
@@ -478,10 +470,9 @@ class WOSiteCreateController(CementBaseController):
data['php73'] = False
php73 = 0
if (not self.app.pargs.wpfc) and (not self.app.pargs.wpsc) and (not self.app.pargs.wpredis) and (not self.app.pargs.hhvm):
if (not self.app.pargs.wpfc) and (not self.app.pargs.wpsc) and (not self.app.pargs.wpredis):
data['basic'] = True
if data and self.app.pargs.hhvm:
if (not self.app.pargs.experimental):
Log.info(self, "HHVM is experimental feature and it may not "
"work with all plugins of your site.\nYou can "
@@ -502,7 +493,6 @@ class WOSiteCreateController(CementBaseController):
data['hhvm'] = True
hhvm = 1
elif data:
data['hhvm'] = False
hhvm = 0
@@ -804,10 +794,6 @@ class WOSiteUpdateController(CementBaseController):
dict(help="update to wpsc cache", action='store_true')),
(['--wpredis'],
dict(help="update to redis cache", action='store_true')),
(['--hhvm'],
dict(help='Use HHVM for site',
action='store' or 'store_const',
choices=('on', 'off'), const='on', nargs='?')),
(['-le', '--letsencrypt'],
dict(help="configure letsencrypt ssl for the site",
action='store' or 'store_const',
@@ -835,7 +821,7 @@ class WOSiteUpdateController(CementBaseController):
if not (pargs.php or pargs.php73 or
pargs.mysql or pargs.wp or pargs.wpsubdir or
pargs.wpsubdomain or pargs.wpfc or pargs.wpsc or
pargs.hhvm or pargs.wpredis or pargs.letsencrypt):
pargs.wpredis or pargs.letsencrypt):
Log.error(self, "Please provide options to update sites.")
if pargs.all:
@@ -882,8 +868,6 @@ class WOSiteUpdateController(CementBaseController):
stype, cache = 'html', 'basic'
elif stype and pargs.proxy:
Log.error(self, "--proxy can not be used with other site types")
if (pargs.proxy and pargs.hhvm):
Log.error(self, "Proxy site can not run on hhvm")
if not pargs.site_name:
try:
@@ -904,7 +888,6 @@ class WOSiteUpdateController(CementBaseController):
else:
oldsitetype = check_site.site_type
oldcachetype = check_site.cache_type
old_hhvm = check_site.is_hhvm
check_ssl = check_site.is_ssl
check_php_version = check_site.php_version
@@ -924,16 +907,6 @@ class WOSiteUpdateController(CementBaseController):
Log.info(self, "\nPassword Unchanged.")
return 0
if ((stype == "proxy" and stype == oldsitetype and self.app.pargs.hhvm)
or (stype == "proxy" and
stype == oldsitetype)):
Log.info(self, Log.FAIL +
"Can not update proxy site to HHVM")
return 1
if stype == "html" and stype == oldsitetype and self.app.pargs.hhvm:
Log.info(self, Log.FAIL + "Can not update HTML site to HHVM")
return 1
if ((stype == 'php' and
oldsitetype not in ['html', 'proxy', 'php73']) or
(stype == 'mysql' and oldsitetype not in ['html', 'php',
@@ -985,7 +958,7 @@ class WOSiteUpdateController(CementBaseController):
if stype == 'wpsubdir':
data['wpsubdir'] = True
if pargs.hhvm or pargs.php73:
if pargs.php73:
if not data:
data = dict(site_name=wo_domain, www_domain=wo_www_domain,
currsitetype=oldsitetype,
@@ -1153,25 +1126,6 @@ class WOSiteUpdateController(CementBaseController):
"site")
pargs.letsencrypt = False
if pargs.hhvm:
if hhvm is old_hhvm:
if hhvm is False:
Log.info(self, "HHVM is allready disabled for given "
"site")
elif hhvm is True:
Log.info(self, "HHVM is allready enabled for given "
"site")
pargs.hhvm = False
if data and (not pargs.hhvm):
if old_hhvm is True:
data['hhvm'] = True
hhvm = True
else:
data['hhvm'] = False
hhvm = False
if data and (not pargs.php73):
if old_php73 is True:
data['php73'] = True
@@ -1180,7 +1134,7 @@ class WOSiteUpdateController(CementBaseController):
data['php73'] = False
php73 = False
if pargs.hhvm == "on" or pargs.letsencrypt == "on" or pargs.php73 == "on":
if pargs.letsencrypt == "on" or pargs.php73 == "on":
if pargs.php73 == "on":
if pargs.experimental:
Log.info(
@@ -1298,7 +1252,7 @@ class WOSiteUpdateController(CementBaseController):
if 'proxy' in data.keys() and data['proxy']:
updateSiteInfo(self, wo_domain, stype=stype, cache=cache,
hhvm=hhvm, ssl=True if check_site.is_ssl else False)
ssl=True if check_site.is_ssl else False)
Log.info(self, "Successfully updated site"
" http://{0}".format(wo_domain))
return 0

View File

@@ -769,18 +769,6 @@ def site_package_check(self, stype):
out=wo_nginx)
wo_nginx.close()
if os.path.isfile("/etc/nginx/nginx.conf") and (not
os.path.isfile("/etc/nginx/common/redis-hhvm.conf")):
data = dict()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/redis-hhvm.conf')
wo_nginx = open('/etc/nginx/common/redis-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'redis-hhvm.mustache',
out=wo_nginx)
wo_nginx.close()
if os.path.isfile("/etc/nginx/conf.d/upstream.conf"):
if not WOFileUtils.grep(self, "/etc/nginx/conf.d/"
"upstream.conf",
@@ -802,47 +790,6 @@ def site_package_check(self, stype):
" $body_bytes_sent '\n"
"'\"$http_referer\" \"$http_user_agent\"';\n")
if self.app.pargs.hhvm:
if platform.architecture()[0] is '32bit':
Log.error(self, "HHVM is not supported by 32bit system")
Log.debug(self, "Setting apt_packages variable for HHVM")
if not WOAptGet.is_installed(self, 'hhvm'):
apt_packages = apt_packages + WOVariables.wo_hhvm
if os.path.isdir("/etc/nginx/common") and (not
os.path.isfile("/etc/nginx/common/php-hhvm.conf")):
data = dict()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/php-hhvm.conf')
wo_nginx = open('/etc/nginx/common/php-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'php-hhvm.mustache',
out=wo_nginx)
wo_nginx.close()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/wpfc-hhvm.conf')
wo_nginx = open('/etc/nginx/common/wpfc-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'wpfc-hhvm.mustache',
out=wo_nginx)
wo_nginx.close()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/wpsc-hhvm.conf')
wo_nginx = open('/etc/nginx/common/wpsc-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'wpsc-hhvm.mustache',
out=wo_nginx)
wo_nginx.close()
if os.path.isfile("/etc/nginx/conf.d/upstream.conf"):
if not WOFileUtils.grep(self, "/etc/nginx/conf.d/upstream.conf",
"hhvm"):
with open("/etc/nginx/conf.d/upstream.conf", "a") as hhvm_file:
hhvm_file.write("upstream hhvm {\nserver 127.0.0.1:8000;\n"
"server 127.0.0.1:9000 backup;\n}\n")
if self.app.pargs.php73:
Log.debug(self, "Setting apt_packages variable for PHP 7.3")
if not WOAptGet.is_installed(self, 'php7.3-fpm'):

View File

@@ -59,8 +59,6 @@ class WOStackController(CementBaseController):
dict(help='Install PHP 7.3 stack', action='store_true')),
(['--mysql'],
dict(help='Install MySQL stack', action='store_true')),
(['--hhvm'],
dict(help='Install HHVM stack', action='store_true')),
(['--wpcli'],
dict(help='Install WPCLI stack', action='store_true')),
(['--phpmyadmin'],
@@ -178,17 +176,6 @@ class WOStackController(CementBaseController):
Log.debug(self, 'Adding Dotdeb/php GPG key')
WORepo.add_key(self, '89DF5277')
if set(WOVariables.wo_hhvm).issubset(set(apt_packages)):
if (WOVariables.wo_platform_codename != 'xenial' or
WOVariables.wo_platform_codename != 'bionic'):
Log.info(self, "Adding repository for HHVM, please wait...")
Log.debug(self, 'Adding ppa repo for HHVM')
WORepo.add(self, repo_url=WOVariables.wo_hhvm_repo)
Log.debug(self, 'Adding HHVM GPG Key')
WORepo.add_key(self, '0x5a16e7281be7a449')
else:
Log.info(self, "Using default Ubuntu repository for HHVM")
if set(WOVariables.wo_redis).issubset(set(apt_packages)):
Log.info(self, "Adding repository for Redis, please wait...")
if WOVariables.wo_platform_distro == 'debian':
@@ -210,12 +197,12 @@ class WOStackController(CementBaseController):
# Fix for white screen death with NGINX PLUS
if not WOFileUtils.grep(self, '/etc/nginx/fastcgi_params',
'SCRIPT_FILENAME'):
with open('/etc/nginx/fastcgi_params', encoding='utf-8',
mode='a') as wo_nginx:
with open('/etc/nginx/fastcgi_params',
encoding='utf-8', mode='a') as wo_nginx:
wo_nginx.write('fastcgi_param \tSCRIPT_FILENAME '
'\t$request_filename;\n')
if not (os.path.isfile('/etc/nginx/common/wpfc.conf')):
if not (os.path.isfile('/etc/nginx/common/wpfc-php72.conf')):
# Change WordOpsVersion in nginx.conf file
WOFileUtils.searchreplace(self, "/etc/nginx/nginx.conf",
"# add_header",
@@ -225,44 +212,6 @@ class WOStackController(CementBaseController):
"\"WordOps\"",
"\"WordOps v{0}\""
.format(WOVariables.wo_version))
WOFileUtils.searchreplace(self, '/etc/nginx/nginx.conf',
'ECDHE-RSA-AES128-GCM'
'-SHA256:'
'ECDHE-ECDSA-AES128'
'-GCM-SHA256:'
'ECDHE-RSA-AES256-GCM-SHA384:'
'ECDHE-ECDSA-AES256-GCM-SHA384:'
'DHE-RSA-AES128-GCM-SHA256:'
'DHE-DSS-AES128-GCM-SHA256:'
'kEDH+AESGCM:'
'ECDHE-RSA-AES128-SHA256:'
'ECDHE-ECDSA-AES128-SHA256:'
'ECDHE-RSA-AES128-SHA:'
'ECDHE-ECDSA-AES128-SHA:'
'ECDHE-RSA-AES256-SHA384:'
'ECDHE-ECDSA-AES256-SHA384:'
'ECDHE-RSA-AES256-SHA:'
'ECDHE-ECDSA-AES256-SHA:'
'DHE-RSA-AES128-SHA256:'
'DHE-RSA-AES128-SHA'
'DHE-DSS-AES128-SHA256:'
'DHE-RSA-AES256-SHA256:'
'DHE-DSS-AES256-SHA:'
'DHE-RSA-AES256-SHA:'
'ECDHE-RSA-DES-CBC3-SHA:'
'ECDHE-ECDSA-DES-CBC3-SHA:'
'AES128-GCM-SA256:'
'AES256-GCM-SHA384:'
'AES128-SHA256:AES256-SHA256:'
'AES128-SHA:AES256-SHA:AES:'
'CAMELLIA:DES-CBC3-SHA:!aNULL:'
'!eNULL:!EXPORT:!DES:'
'!RC4:!MD5:!PSK:'
'!ECDH:!EDH-DSS-DES-CBC3-SHA:'
'!EDH-RSA-DES-CBC3-SHA:'
'!KRB5-DES-CBC3-SHA',
'EECDH+CHACHA20:EECDH+AESGCM:'
'EECDH+AES')
data = dict()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/conf.d/blockips.conf')
@@ -278,10 +227,10 @@ class WOStackController(CementBaseController):
self.app.render((data), 'fastcgi.mustache', out=wo_nginx)
wo_nginx.close()
data = dict(php="9000", debug="9001", hhvm="8000",
data = dict(php="9000", debug="9001",
php7="9070", debug7="9170",
hhvmconf=False, php7conf=True if
WOAptGet.is_installed(self, 'php7.0-fpm')
php7conf=True
if WOAptGet.is_installed(self, 'php7.0-fpm')
else False)
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/conf.d/upstream.conf')
@@ -371,9 +320,7 @@ class WOStackController(CementBaseController):
wo_nginx.close()
# php7 conf
if (WOVariables.wo_platform_distro == 'debian' or
WOVariables.wo_platform_distro == 'ubuntu') and (not
os.path.isfile("/etc/nginx/common/php73.conf")):
if not os.path.isfile("/etc/nginx/common/php73.conf"):
# data = dict()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/locations-php73.conf')
@@ -504,7 +451,7 @@ class WOStackController(CementBaseController):
"{0}22222/cert/22222.key 2048"
.format(WOVariables.wo_webroot))
WOShellExec.cmd_exec(self, "openssl req -new -batch "
"-subj /commonName=localhost.localdomain/ "
"-subj /commonName=localhost/ "
"-key {0}22222/cert/22222.key "
"-out {0}22222/cert/"
"22222.csr"
@@ -582,16 +529,6 @@ class WOStackController(CementBaseController):
out=wo_nginx)
wo_nginx.close()
if os.path.isfile("/etc/nginx/nginx.conf") and (not os.path.isfile("/etc/nginx/common/redis-hhvm.conf")):
data = dict()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/redis-hhvm.conf')
wo_nginx = open('/etc/nginx/common/redis-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'redis-hhvm.mustache',
out=wo_nginx)
wo_nginx.close()
if (WOVariables.wo_platform_distro == 'ubuntu'):
if os.path.isfile("/etc/nginx/nginx.conf") and (not os.path.isfile("/etc/nginx/common/redis-php73.conf")):
data = dict()
@@ -680,82 +617,6 @@ class WOStackController(CementBaseController):
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")
if set(WOVariables.wo_hhvm).issubset(set(apt_packages)):
WOShellExec.cmd_exec(self, "update-rc.d hhvm defaults")
WOFileUtils.searchreplace(self, "/etc/hhvm/server.ini",
"9000", "8000")
if (WOVariables.wo_platform_codename != 'xenial' or WOVariables.wo_platform_codename != 'bionic'):
WOFileUtils.searchreplace(self, "/etc/nginx/hhvm.conf",
"9000", "8000")
with open("/etc/hhvm/php.ini", "a") as hhvm_file:
hhvm_file.write("hhvm.log.header = true\n"
"hhvm.log.natives_stack_trace = true\n"
"hhvm.mysql.socket = "
"/var/run/mysqld/mysqld.sock\n"
"hhvm.pdo_mysql.socket = "
"/var/run/mysqld/mysqld.sock\n"
"hhvm.mysqli.socket = "
"/var/run/mysqld/mysqld.sock\n")
with open("/etc/hhvm/server.ini", "a") as hhvm_file:
hhvm_file.write("hhvm.server.ip = 127.0.0.1\n")
if os.path.isfile("/etc/nginx/conf.d/fastcgi.conf"):
if not WOFileUtils.grep(self, "/etc/nginx/conf.d/"
"fastcgi.conf",
"fastcgi_keep_conn"):
with open("/etc/nginx/conf.d/fastcgi.conf",
"a") as hhvm_file:
hhvm_file.write("fastcgi_keep_conn on;\n")
if os.path.isfile("/etc/nginx/conf.d/upstream.conf"):
if not WOFileUtils.grep(self, "/etc/nginx/conf.d/"
"upstream.conf",
"hhvm"):
with open("/etc/nginx/conf.d/upstream.conf",
"a") as hhvm_file:
hhvm_file.write("upstream hhvm {\nserver "
"127.0.0.1:8000;\n"
"server 127.0.0.1:9000 backup;\n}"
"\n")
WOGit.add(self, ["/etc/hhvm"], msg="Adding HHVM into Git")
WOService.restart_service(self, 'hhvm')
if os.path.isfile("/etc/nginx/nginx.conf") and (not os.path.isfile("/etc/nginx/common/php-hhvm.conf")):
data = dict()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/php-hhvm.conf')
wo_nginx = open('/etc/nginx/common/php-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'php-hhvm.mustache',
out=wo_nginx)
wo_nginx.close()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/wpfc-hhvm.conf')
wo_nginx = open('/etc/nginx/common/wpfc-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'wpfc-hhvm.mustache',
out=wo_nginx)
wo_nginx.close()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/wpsc-hhvm.conf')
wo_nginx = open('/etc/nginx/common/wpsc-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'wpsc-hhvm.mustache',
out=wo_nginx)
wo_nginx.close()
if not WOService.reload_service(self, 'nginx'):
Log.error(self, "Failed to reload Nginx, please check "
"output of `nginx -t`")
if set(WOVariables.wo_redis).issubset(set(apt_packages)):
if os.path.isfile("/etc/nginx/nginx.conf") and (not os.path.isfile("/etc/nginx/common/redis-php72.conf")):
@@ -768,17 +629,6 @@ class WOStackController(CementBaseController):
out=wo_nginx)
wo_nginx.close()
if os.path.isfile("/etc/nginx/nginx.conf") and (not os.path.isfile("/etc/nginx/common/redis-hhvm.conf")):
data = dict()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/redis-hhvm.conf')
wo_nginx = open('/etc/nginx/common/redis-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'redis-hhvm.mustache',
out=wo_nginx)
wo_nginx.close()
if os.path.isfile("/etc/nginx/conf.d/upstream.conf"):
if not WOFileUtils.grep(self, "/etc/nginx/conf.d/"
"upstream.conf",
@@ -870,7 +720,7 @@ class WOStackController(CementBaseController):
config['debug']['request_slowlog_timeout'] = '10s'
with open('/etc/php/7.2/fpm/pool.d/debug.conf',
encoding='utf-8', mode='w') as confifile:
Log.debug(self, "writting PHP5 configuration into "
Log.debug(self, "writting PHP7.2 configuration into "
"/etc/php/7.2/fpm/pool.d/debug.conf")
config.write(confifile)
@@ -1066,7 +916,7 @@ class WOStackController(CementBaseController):
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']['max_execution_time'] = '300'
config['PHP']['date.timezone'] = WOVariables.wo_timezone
with open('/etc/php/7.3/fpm/php.ini',
encoding='utf-8', mode='w') as configfile:
@@ -1402,7 +1252,6 @@ class WOStackController(CementBaseController):
(not self.app.pargs.nginx) and (not self.app.pargs.php) and
(not self.app.pargs.mysql) and (not self.app.pargs.wpcli) and
(not self.app.pargs.phpmyadmin) and
(not self.app.pargs.hhvm) and
(not self.app.pargs.adminer) and (not self.app.pargs.utils) and
(not self.app.pargs.redis) and
(not self.app.pargs.phpredisadmin) and
@@ -1485,16 +1334,6 @@ class WOStackController(CementBaseController):
Log.debug(self, "PHP 7.3 already installed")
Log.info(self, "PHP 7.3 already installed")
if self.app.pargs.hhvm:
Log.debug(self, "Setting apt packages variable for HHVM")
if platform.architecture()[0] is '32bit':
Log.error(self, "HHVM is not supported by 32bit system")
if not WOAptGet.is_installed(self, 'hhvm'):
apt_packages = apt_packages + WOVariables.wo_hhvm
else:
Log.debug(self, "HHVM already installed")
Log.info(self, "HHVM already installed")
if self.app.pargs.mysql:
Log.debug(self, "Setting apt_packages variable for MySQL")
if not WOShellExec.cmd_exec(self, "mysqladmin ping"):
@@ -1653,9 +1492,8 @@ class WOStackController(CementBaseController):
(not self.app.pargs.nginx) and (not self.app.pargs.php) and
(not self.app.pargs.php73) and (not self.app.pargs.mysql) and
(not self.app.pargs.wpcli) and (not self.app.pargs.phpmyadmin) and
(not self.app.pargs.hhvm) and (not self.app.pargs.adminer) and
(not self.app.pargs.utils) and (not self.app.pargs.all) and
(not self.app.pargs.redis) and
(not self.app.pargs.adminer) and (not self.app.pargs.utils) and
(not self.app.pargs.all) and (not self.app.pargs.redis) and
(not self.app.pargs.phpredisadmin)):
self.app.pargs.web = True
self.app.pargs.admin = True
@@ -1702,11 +1540,6 @@ class WOStackController(CementBaseController):
else:
apt_packages = apt_packages + WOVariables.wo_php73
if self.app.pargs.hhvm:
if WOAptGet.is_installed(self, 'hhvm'):
Log.debug(self, "Removing apt_packages variable of HHVM")
apt_packages = apt_packages + WOVariables.wo_hhvm
if self.app.pargs.redis:
Log.debug(self, "Remove apt_packages variable of Redis")
apt_packages = apt_packages + WOVariables.wo_redis
@@ -1794,9 +1627,9 @@ class WOStackController(CementBaseController):
(not self.app.pargs.nginx) and (not self.app.pargs.php) and
(not self.app.pargs.php73) and (not self.app.pargs.mysql) and
(not self.app.pargs.wpcli) and (not self.app.pargs.phpmyadmin) and
(not self.app.pargs.hhvm) and (not self.app.pargs.adminer) and
(not self.app.pargs.utils) and (not self.app.pargs.all) and
(not self.app.pargs.redis) and (not self.app.pargs.phpredisadmin)):
(not self.app.pargs.adminer) and (not self.app.pargs.utils) and
(not self.app.pargs.all) and (not self.app.pargs.redis) and
(not self.app.pargs.phpredisadmin)):
self.app.pargs.web = True
self.app.pargs.admin = True
@@ -1846,11 +1679,6 @@ class WOStackController(CementBaseController):
if not WOAptGet.is_installed(self, 'php7.2-fpm'):
apt_packages = apt_packages + WOVariables.wo_php
if self.app.pargs.hhvm:
if WOAptGet.is_installed(self, 'hhvm'):
Log.debug(self, "Purge apt_packages varible of HHVM")
apt_packages = apt_packages + WOVariables.wo_hhvm
Log.debug(self, "Purge package variable WPCLI")
if os.path.isfile('/usr/local/bin/wp'):
packages = packages + ['/usr/local/bin/wp']

View File

@@ -21,9 +21,11 @@ class WOStackStatusController(CementBaseController):
def start(self):
"""Start services"""
services = []
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcached
or self.app.pargs.redis):
if not (self.app.pargs.nginx or self.app.pargs.php or
self.app.pargs.php73 or
self.app.pargs.mysql or
self.app.pargs.memcached or
self.app.pargs.redis):
self.app.pargs.nginx = True
self.app.pargs.php = True
self.app.pargs.mysql = True
@@ -63,11 +65,6 @@ class WOStackStatusController(CementBaseController):
Log.warn(self, "Remote MySQL found, "
"Unable to check MySQL service status")
if self.app.pargs.hhvm:
if WOAptGet.is_installed(self, 'hhvm'):
services = services + ['hhvm']
else:
Log.info(self, "HHVM is not installed")
if self.app.pargs.memcached:
if WOAptGet.is_installed(self, 'memcached'):
services = services + ['memcached']
@@ -89,7 +86,7 @@ class WOStackStatusController(CementBaseController):
"""Stop services"""
services = []
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcached
or self.app.pargs.mysql or self.app.pargs.memcached
or self.app.pargs.redis):
self.app.pargs.nginx = True
self.app.pargs.php = True
@@ -131,11 +128,6 @@ class WOStackStatusController(CementBaseController):
Log.warn(self, "Remote MySQL found, "
"Unable to check MySQL service status")
if self.app.pargs.hhvm:
if WOAptGet.is_installed(self, 'hhvm'):
services = services + ['hhvm']
else:
Log.info(self, "HHVM is not installed")
if self.app.pargs.memcached:
if WOAptGet.is_installed(self, 'memcached'):
services = services + ['memcached']
@@ -157,7 +149,7 @@ class WOStackStatusController(CementBaseController):
"""Restart services"""
services = []
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcached
or self.app.pargs.mysql or self.app.pargs.memcached
or self.app.pargs.redis):
self.app.pargs.nginx = True
self.app.pargs.php = True
@@ -199,11 +191,6 @@ class WOStackStatusController(CementBaseController):
Log.warn(self, "Remote MySQL found, "
"Unable to check MySQL service status")
if self.app.pargs.hhvm:
if WOAptGet.is_installed(self, 'hhvm'):
services = services + ['hhvm']
else:
Log.info(self, "HHVM is not installed")
if self.app.pargs.memcached:
if WOAptGet.is_installed(self, 'memcached'):
services = services + ['memcached']
@@ -225,12 +212,11 @@ class WOStackStatusController(CementBaseController):
"""Status of services"""
services = []
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcached
or self.app.pargs.mysql or self.app.pargs.memcached
or self.app.pargs.redis):
self.app.pargs.nginx = True
self.app.pargs.php = True
self.app.pargs.mysql = True
self.app.pargs.hhvm = True
if self.app.pargs.nginx:
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self, 'nginx-mainline'):
@@ -268,11 +254,6 @@ class WOStackStatusController(CementBaseController):
Log.warn(self, "Remote MySQL found, "
"Unable to check MySQL service status")
if self.app.pargs.hhvm:
if WOAptGet.is_installed(self, 'hhvm'):
services = services + ['hhvm']
else:
Log.info(self, "HHVM is not installed")
if self.app.pargs.memcached:
if WOAptGet.is_installed(self, 'memcached'):
services = services + ['memcached']
@@ -294,7 +275,7 @@ class WOStackStatusController(CementBaseController):
"""Reload service"""
services = []
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcached
or self.app.pargs.mysql or self.app.pargs.memcached
or self.app.pargs.redis):
self.app.pargs.nginx = True
self.app.pargs.php = True
@@ -336,9 +317,6 @@ class WOStackStatusController(CementBaseController):
Log.warn(self, "Remote MySQL found, "
"Unable to check MySQL service status")
if self.app.pargs.hhvm:
Log.info(self, "HHVM does not support to reload")
if self.app.pargs.memcached:
if WOAptGet.is_installed(self, 'memcached'):
services = services + ['memcached']

View File

@@ -34,8 +34,6 @@ class WOStackUpgradeController(CementBaseController):
dict(help='Upgrade PHP stack', action='store_true')),
(['--mysql'],
dict(help='Upgrade MySQL stack', action='store_true')),
(['--hhvm'],
dict(help='Upgrade HHVM stack', action='store_true')),
(['--wpcli'],
dict(help='Upgrade WPCLI', action='store_true')),
(['--redis'],
@@ -89,9 +87,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.nginxmainline)):
(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
if self.app.pargs.all:
@@ -118,12 +115,6 @@ class WOStackUpgradeController(CementBaseController):
else:
Log.info(self, "PHP 7.2 is not installed")
if self.app.pargs.hhvm:
if WOAptGet.is_installed(self, 'hhvm'):
apt_packages = apt_packages + WOVariables.wo_hhvm
else:
Log.info(self, "HHVM is not installed")
if self.app.pargs.mysql:
if WOAptGet.is_installed(self, 'mariadb-server'):
apt_packages = apt_packages + WOVariables.wo_mysql
@@ -169,8 +160,6 @@ class WOStackUpgradeController(CementBaseController):
WOService.restart_service(self, 'nginx')
if set(WOVariables.wo_php).issubset(set(apt_packages)):
WOService.restart_service(self, 'php7.2-fpm')
if set(WOVariables.wo_hhvm).issubset(set(apt_packages)):
WOService.restart_service(self, 'hhvm')
if set(WOVariables.wo_mysql).issubset(set(apt_packages)):
WOService.restart_service(self, 'mysql')
if set(WOVariables.wo_redis).issubset(set(apt_packages)):

View File

@@ -39,6 +39,7 @@ location ~ /\.(?!well-known\/) {
# letsencrypt validation
location /.well-known/acme-challenge/ {
alias /var/www/html/.well-known/acme-challenge/;
allow all;
}
# Return 403 forbidden for readme.(txt|html) or license.(txt|html) or example.(txt|html) or other common git repository files
location ~* "/(^$|readme|license|example|README|LEGALNOTICE|INSTALLATION|CHANGELOG)\.(txt|html|md)" {

View File

@@ -39,6 +39,7 @@ location ~ /\.(?!well-known\/) {
# letsencrypt validation
location /.well-known/acme-challenge/ {
alias /var/www/html/.well-known/acme-challenge/;
allow all;
}
# Return 403 forbidden for readme.(txt|html) or license.(txt|html) or example.(txt|html) or other common git repository files
location ~* "/(^$|readme|license|example|README|LEGALNOTICE|INSTALLATION|CHANGELOG)\.(txt|html|md)" {

View File

@@ -1,10 +0,0 @@
# PHP NGINX CONFIGURATION
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass hhvm;
}

View File

@@ -1,58 +0,0 @@
# Redis 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;
}
# Use cached or actual file if they exists, Otherwise pass request to WordPress
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location /redis-fetch {
internal ;
set $redis_key $args;
redis_pass redis;
}
location /redis-store {
internal ;
set_unescape_uri $key $arg_key ;
redis2_query set $key $echo_request_body;
redis2_query expire $key 14400;
redis2_pass redis;
}
location ~ \.php$ {
set $key "nginx-cache:$scheme$request_method$host$request_uri";
try_files $uri =404;
srcache_fetch_skip $skip_cache;
srcache_store_skip $skip_cache;
srcache_response_cache_control off;
set_escape_uri $escaped_key $key;
srcache_fetch GET /redis-fetch $key;
srcache_store PUT /redis-store key=$escaped_key;
more_set_headers 'X-SRCache-Fetch-Status $srcache_fetch_status';
more_set_headers 'X-SRCache-Store-Status $srcache_store_status';
include fastcgi_params;
fastcgi_param HTTP_ACCEPT_ENCODING "";
fastcgi_pass hhvm;
}

View File

@@ -2,7 +2,6 @@ Information about {{domain}}:
Nginx configuration {{type}} {{enable}}
{{#php_version}}PHP Version {{php_version}}{{/php_version}}
{{#hhvm}}HHVM {{hhvm}}{{/hhvm}}
{{#ssl}}SSL {{ssl}}{{/ssl}}
{{#sslprovider}}SSL PROVIDER {{sslprovider}}{{/sslprovider}}
{{#sslexpiry}}SSL EXPIRY DATE {{sslexpiry}}{{/sslexpiry}}

View File

@@ -24,15 +24,6 @@ server 127.0.0.1:{{debug7}};
}
{{/php7conf}}
{{#hhvmconf}}
upstream hhvm {
# HHVM Pool
server 127.0.0.1:{{hhvm}};
server 127.0.0.1:{{php}} backup;
}
{{/hhvmconf}}
#-------------------------------
# PHP 7.2
#-------------------------------

View File

@@ -38,7 +38,7 @@ server {
}
{{/static}}
{{^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}}
{{^static}}include {{#basic}}common/php73.conf;{{/basic}}{{#wpfc}}common/wpfc-php73.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php73.conf;{{/wpsc}}{{#wpredis}}common/redis-php73.conf;{{/wpredis}}
{{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}}
{{#wp}}include common/wpcommon-php73.conf;{{/wp}}
{{^proxy}}include common/locations-php73.conf;{{/proxy}}

View File

@@ -38,7 +38,8 @@ server {
}
{{/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}}
{{^static}}include {{#basic}}common/php72.conf;{{/basic}}{{#wpfc}}common/wpfc-php72.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php72.conf;{{/wpsc}}{{#wpredis}}common/redis-php72.conf;{{/wpredis}}
{{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}}
{{#wp}}include common/wpcommon-php72.conf;{{/wp}}
{{^proxy}}include common/locations-php72.conf;{{/proxy}}
{{^vma}}{{^rc}}include {{webroot}}/conf/nginx/*.conf;{{/rc}}{{/vma}}

View File

@@ -1,23 +0,0 @@
# WPFC NGINX CONFIGURATION
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
# $skip_cache variable set in /etc/nginx/conf.d/map-wp.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;
fastcgi_pass hhvm;
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;
fastcgi_cache WORDPRESS;
}
location ~ /purge(/.*) {
fastcgi_cache_purge WORDPRESS "$scheme$request_method$host$1";
access_log off;
}

View File

@@ -1,17 +0,0 @@
# WPSC NGINX CONFIGURATION
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
# $skip_cache variable set in /etc/nginx/conf.d/map-wp.conf
# Use cached or actual file if they exists, Otherwise pass request to WordPress
location / {
# If we add index.php?$args its break WooCommerce like plugins
# Ref: #330
try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php;
}
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass hhvm;
# Following line is needed by WP Super Cache plugin
fastcgi_param SERVER_NAME $http_host;
}

View File

@@ -152,16 +152,6 @@ class WOVariables():
wo_mysql = ["mariadb-server", "percona-toolkit"]
# HHVM repo details
if wo_platform_distro == 'ubuntu':
wo_hhvm_repo = ("deb http://dl.hhvm.com/ubuntu {codename} main"
.format(codename=wo_platform_codename))
else:
wo_hhvm_repo = ("deb http://dl.hhvm.com/debian {codename} main"
.format(codename=wo_platform_codename))
wo_hhvm = ["hhvm"]
# Redis repo details
if wo_platform_distro == 'ubuntu':
wo_redis_repo = ("ppa:chris-lea/redis-server")