From 7f0bdb987903be71678c91de072b955d64696f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20M=C3=BChl?= Date: Fri, 11 Dec 2015 12:18:13 +0700 Subject: [PATCH 001/115] Update ee.8 updated the path to ee.conf file --- docs/ee.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ee.8 b/docs/ee.8 index 7b5d0658..e07f793f 100644 --- a/docs/ee.8 +++ b/docs/ee.8 @@ -287,7 +287,7 @@ Install, activate, configure Nginx-helper and Redis Object Cache Plugin, Configu Install, activate Nginx-helper and configure NGINX for HHVM. .SH FILES .br -/etc/easyengine/ee.conf +/etc/ee/ee.conf .SH BUGS Report bugs at .SH AUTHOR From bfacc2d322830ae78258c6f89a63aead4301adee Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 2 Feb 2016 15:48:37 +0530 Subject: [PATCH 002/115] Added php7 upstream port --- ee/cli/plugins/stack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index cf360e4d..5653e56d 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -289,7 +289,7 @@ class EEStackController(CementBaseController): self.app.render((data), 'fastcgi.mustache', out=ee_nginx) ee_nginx.close() - data = dict(php="9000", debug="9001", hhvm="8000", + data = dict(php="9000", debug="9001", hhvm="8000",php7="9070",debug7="9170", hhvmconf=False) Log.debug(self, 'Writting the nginx configuration to ' 'file /etc/nginx/conf.d/upstream.conf') From ec3ba1f6bcf981e66b5ec0ac64ff631dce7c12df Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 2 Feb 2016 19:20:12 +0530 Subject: [PATCH 003/115] Added php packages --- ee/core/variables.py | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/ee/core/variables.py b/ee/core/variables.py index 7848c816..119ebd01 100644 --- a/ee/core/variables.py +++ b/ee/core/variables.py @@ -112,14 +112,30 @@ class EEVariables(): # PHP repo and packages if ee_platform_distro == 'ubuntu': - ee_php_repo = "ppa:ondrej/php5-5.6" - elif ee_platform_codename == 'wheezy': - ee_php_repo = ("deb http://packages.dotdeb.org {codename}-php56 all" + if ee_platform_codename == 'precise': + ee_php_repo = "ppa:ondrej/php5-5.6" + ee_php = ["php5-fpm", "php5-curl", "php5-gd", "php5-imap", + "php5-mcrypt", "php5-common", "php5-readline", + "php5-mysql", "php5-cli", "php5-memcache", "php5-imagick", + "memcached", "graphviz", "php-pear"] + elif ee_platform_codename == 'trusty': + ee_php_repo = "ppa:ondrej/php" + ee_php5_6 = ["php5.6-fpm", "php5.6-curl", "php5.6-gd", "php5.6-imap", + "php5.6-mcrypt", "php5.6-common", "php5.6-readline", + "php5.6-mysql", "php5.6-cli", "php5.6-memcache", "php-imagick", + "memcached", "graphviz", "php-pear"] + ee_php7_0 = ["php7.0-fpm", "php7.0-curl", "php7.0-gd", "php7.0-imap", + "php7.0-mcrypt", "php7.0-common", "php7.0-readline", + "php7.0-mysql", "php7.0-cli", "php7.0-memcache", "php-imagick", + "memcached", "graphviz", "php-pear"] + elif ee_platform_distro == 'debian': + if ee_platform_codename == 'wheezy': + ee_php_repo = ("deb http://packages.dotdeb.org {codename}-php56 all" .format(codename=ee_platform_codename)) - ee_php = ["php5-fpm", "php5-curl", "php5-gd", "php5-imap", - "php5-mcrypt", "php5-common", "php5-readline", - "php5-mysql", "php5-cli", "php5-memcache", "php5-imagick", - "memcached", "graphviz", "php-pear"] + ee_php = ["php5-fpm", "php5-curl", "php5-gd", "php5-imap", + "php5-mcrypt", "php5-common", "php5-readline", + "php5-mysql", "php5-cli", "php5-memcache", "php5-imagick", + "memcached", "graphviz", "php-pear"] if ee_platform_codename == 'wheezy': ee_php = ee_php + ["php5-dev"] @@ -180,7 +196,10 @@ class EEVariables(): ee_redis_repo = ("deb http://packages.dotdeb.org {codename} all" .format(codename=ee_platform_codename)) - ee_redis = ['redis-server', 'php5-redis'] + if ee_platform_codename == 'trusty': + ee_redis = ['redis-server', 'php-redis'] + else: + ee_redis = ['redis-server', 'php5-redis'] # Repo path ee_repo_file = "ee-repo.list" From 7229b020b4721ba2ee712cd1d0a998c8c6704ef1 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 2 Feb 2016 19:20:41 +0530 Subject: [PATCH 004/115] Added --php7 command --- ee/cli/plugins/stack.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 5653e56d..fc0fc9dd 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -62,6 +62,8 @@ class EEStackController(CementBaseController): dict(help='Install Nginx mainline stack', action='store_true')), (['--php'], dict(help='Install PHP stack', action='store_true')), + (['--php7'], + dict(help='Install PHP 7.0 stack', action='store_true')), (['--mysql'], dict(help='Install MySQL stack', action='store_true')), (['--hhvm'], @@ -178,7 +180,8 @@ class EEStackController(CementBaseController): Log.debug(self, 'Adding ppa of Nginx-mainline') EERepo.add_key(self, EEVariables.ee_nginx_key) - if set(EEVariables.ee_php).issubset(set(apt_packages)): + if (set(EEVariables.ee_php).issubset(set(apt_packages)) or set(EEVariables.ee_php7_0).issubset(set(apt_packages))\ + or set(EEVariables.ee_php5_6).issubset(set(apt_packages))): Log.info(self, "Adding repository for PHP, please wait...") # Add repository for php if EEVariables.ee_platform_distro == 'debian': From 1674d9a6dc8a11e232fed17284c57affebfcfd01 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 2 Feb 2016 19:29:48 +0530 Subject: [PATCH 005/115] Added php5.6 post configuration --- ee/cli/plugins/stack.py | 128 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index fc0fc9dd..51100b94 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -848,6 +848,134 @@ class EEStackController(CementBaseController): EEGit.add(self, ["/etc/php5"], msg="Adding PHP into Git") EEService.restart_service(self, 'php5-fpm') + + if set(EEVariables.ee_php5_6).issubset(set(apt_packages)): + # Create log directories + if not os.path.exists('/var/log/php/5.6/'): + Log.debug(self, 'Creating directory /var/log/php/5.6/') + os.makedirs('/var/log/php/5.6/') + + # Parse etc/php/5.6/fpm/php.ini + config = configparser.ConfigParser() + Log.debug(self, "configuring php file /etc/php/5.6/fpm/php.ini") + config.read('/etc/php/5.6/fpm/php.ini') + config['PHP']['expose_php'] = 'Off' + config['PHP']['post_max_size'] = '100M' + config['PHP']['upload_max_filesize'] = '100M' + config['PHP']['max_execution_time'] = '300' + config['PHP']['date.timezone'] = EEVariables.ee_timezone + with open('/etc/php/5.6/fpm/php.ini', + encoding='utf-8', mode='w') as configfile: + Log.debug(self, "Writting php configuration into " + "/etc/php/5.6/fpm/php.ini") + config.write(configfile) + + # Parse /etc/php/5.6/fpm/php-fpm.conf + config = configparser.ConfigParser() + Log.debug(self, "configuring php file" + "/etc/php/5.6/fpm/php-fpm.conf") + config.read_file(codecs.open("/etc/php/5.6/fpm/php-fpm.conf", + "r", "utf8")) + config['global']['error_log'] = '/var/log/php/5.6/fpm.log' + config.remove_option('global', 'include') + config['global']['log_level'] = 'notice' + config['global']['include'] = '/etc/php/5.6/fpm/pool.d/*.conf' + with codecs.open('/etc/php/5.6/fpm/php-fpm.conf', + encoding='utf-8', mode='w') as configfile: + Log.debug(self, "writting php5 configuration into " + "/etc/php/5.6/fpm/php-fpm.conf") + config.write(configfile) + + # Parse /etc/php/5.6/fpm/pool.d/www.conf + config = configparser.ConfigParser() + config.read_file(codecs.open('/etc/php/5.6/fpm/pool.d/www.conf', + "r", "utf8")) + config['www']['ping.path'] = '/ping' + config['www']['pm.status_path'] = '/status' + config['www']['pm.max_requests'] = '500' + config['www']['pm.max_children'] = '100' + config['www']['pm.start_servers'] = '20' + config['www']['pm.min_spare_servers'] = '10' + config['www']['pm.max_spare_servers'] = '30' + config['www']['request_terminate_timeout'] = '300' + config['www']['pm'] = 'ondemand' + config['www']['listen'] = '127.0.0.1:9000' + with codecs.open('/etc/php/5.6/fpm/pool.d/www.conf', + encoding='utf-8', mode='w') as configfile: + Log.debug(self, "writting PHP5 configuration into " + "/etc/php/5.6/fpm/pool.d/www.conf") + config.write(configfile) + + # Generate /etc/php/5.6/fpm/pool.d/debug.conf + EEFileUtils.copyfile(self, "/etc/php/5.6/fpm/pool.d/www.conf", + "/etc/php/5.6/fpm/pool.d/debug.conf") + EEFileUtils.searchreplace(self, "/etc/php/5.6/fpm/pool.d/" + "debug.conf", "[www]", "[debug]") + config = configparser.ConfigParser() + config.read('/etc/php/5.6/fpm/pool.d/debug.conf') + config['debug']['listen'] = '127.0.0.1:9001' + config['debug']['rlimit_core'] = 'unlimited' + config['debug']['slowlog'] = '/var/log/php/5.6/slow.log' + config['debug']['request_slowlog_timeout'] = '10s' + with open('/etc/php/5.6/fpm/pool.d/debug.conf', + encoding='utf-8', mode='w') as confifile: + Log.debug(self, "writting PHP5 configuration into " + "/etc/php/5.6/fpm/pool.d/debug.conf") + config.write(confifile) + + with open("/etc/php/5.6/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_" + "output_name] = cachegrind.out.%p-%H-%R " + "\nphp_admin_flag[xdebug.profiler_enable" + "_trigger] = on \nphp_admin_flag[xdebug." + "profiler_enable] = off\n") + + # Disable xdebug + EEFileUtils.searchreplace(self, "/etc/php/5.6/mods-available/" + "xdebug.ini", + "zend_extension", + ";zend_extension") + + # PHP and Debug pull configuration + if not os.path.exists('{0}22222/htdocs/fpm/status/' + .format(EEVariables.ee_webroot)): + Log.debug(self, 'Creating directory ' + '{0}22222/htdocs/fpm/status/ ' + .format(EEVariables.ee_webroot)) + os.makedirs('{0}22222/htdocs/fpm/status/' + .format(EEVariables.ee_webroot)) + open('{0}22222/htdocs/fpm/status/debug' + .format(EEVariables.ee_webroot), + encoding='utf-8', mode='a').close() + open('{0}22222/htdocs/fpm/status/php' + .format(EEVariables.ee_webroot), + encoding='utf-8', mode='a').close() + + # Write info.php + if not os.path.exists('{0}22222/htdocs/php/' + .format(EEVariables.ee_webroot)): + Log.debug(self, 'Creating directory ' + '{0}22222/htdocs/php/ ' + .format(EEVariables.ee_webroot)) + os.makedirs('{0}22222/htdocs/php' + .format(EEVariables.ee_webroot)) + + with open("{0}22222/htdocs/php/info.php" + .format(EEVariables.ee_webroot), + encoding='utf-8', mode='w') as myfile: + myfile.write("") + + EEFileUtils.chown(self, "{0}22222" + .format(EEVariables.ee_webroot), + EEVariables.ee_php_user, + EEVariables.ee_php_user, recursive=True) + + EEGit.add(self, ["/etc/php5.6"], msg="Adding PHP into Git") + EEService.restart_service(self, 'php5.6-fpm') + + if set(EEVariables.ee_mysql).issubset(set(apt_packages)): # TODO: Currently we are using, we need to remove it in future # config = configparser.ConfigParser() From ea5f7fb756a506a18a1c725092cb06a7aeb62f85 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 2 Feb 2016 19:48:29 +0530 Subject: [PATCH 006/115] Added php7.0 post configuration --- ee/cli/plugins/stack.py | 130 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 129 insertions(+), 1 deletion(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 51100b94..72e710c6 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -933,7 +933,7 @@ class EEStackController(CementBaseController): "profiler_enable] = off\n") # Disable xdebug - EEFileUtils.searchreplace(self, "/etc/php/5.6/mods-available/" + EEFileUtils.searchreplace(self, "/etc/php/mods-available/" "xdebug.ini", "zend_extension", ";zend_extension") @@ -975,6 +975,134 @@ class EEStackController(CementBaseController): EEGit.add(self, ["/etc/php5.6"], msg="Adding PHP into Git") EEService.restart_service(self, 'php5.6-fpm') + #preconfiguration for php7.0 + if set(EEVariables.ee_php7_0).issubset(set(apt_packages)): + # Create log directories + if not os.path.exists('/var/log/php/7.0/'): + Log.debug(self, 'Creating directory /var/log/php/7.0/') + os.makedirs('/var/log/php/7.0/') + + # Parse etc/php/7.0/fpm/php.ini + config = configparser.ConfigParser() + Log.debug(self, "configuring php file /etc/php/7.0/fpm/php.ini") + config.read('/etc/php/7.0/fpm/php.ini') + config['PHP']['expose_php'] = 'Off' + config['PHP']['post_max_size'] = '100M' + config['PHP']['upload_max_filesize'] = '100M' + config['PHP']['max_execution_time'] = '300' + config['PHP']['date.timezone'] = EEVariables.ee_timezone + with open('/etc/php/7.0/fpm/php.ini', + encoding='utf-8', mode='w') as configfile: + Log.debug(self, "Writting php configuration into " + "/etc/php/7.0/fpm/php.ini") + config.write(configfile) + + # Parse /etc/php/7.0/fpm/php-fpm.conf + config = configparser.ConfigParser() + Log.debug(self, "configuring php file" + "/etc/php/7.0/fpm/php-fpm.conf") + config.read_file(codecs.open("/etc/php/7.0/fpm/php-fpm.conf", + "r", "utf8")) + config['global']['error_log'] = '/var/log/php/7.0/fpm.log' + config.remove_option('global', 'include') + config['global']['log_level'] = 'notice' + config['global']['include'] = '/etc/php/7.0/fpm/pool.d/*.conf' + with codecs.open('/etc/php/7.0/fpm/php-fpm.conf', + encoding='utf-8', mode='w') as configfile: + Log.debug(self, "writting php5 configuration into " + "/etc/php/7.0/fpm/php-fpm.conf") + config.write(configfile) + + # Parse /etc/php/7.0/fpm/pool.d/www.conf + config = configparser.ConfigParser() + config.read_file(codecs.open('/etc/php/7.0/fpm/pool.d/www.conf', + "r", "utf8")) + config['www']['ping.path'] = '/ping' + config['www']['pm.status_path'] = '/status' + config['www']['pm.max_requests'] = '500' + config['www']['pm.max_children'] = '100' + config['www']['pm.start_servers'] = '20' + config['www']['pm.min_spare_servers'] = '10' + config['www']['pm.max_spare_servers'] = '30' + config['www']['request_terminate_timeout'] = '300' + config['www']['pm'] = 'ondemand' + config['www']['listen'] = '127.0.0.1:9070' + with codecs.open('/etc/php/7.0/fpm/pool.d/www.conf', + encoding='utf-8', mode='w') as configfile: + Log.debug(self, "writting PHP5 configuration into " + "/etc/php/7.0/fpm/pool.d/www.conf") + config.write(configfile) + + # Generate /etc/php/7.0/fpm/pool.d/debug.conf + EEFileUtils.copyfile(self, "/etc/php/7.0/fpm/pool.d/www.conf", + "/etc/php/7.0/fpm/pool.d/debug.conf") + EEFileUtils.searchreplace(self, "/etc/php/7.0/fpm/pool.d/" + "debug.conf", "[www]", "[debug]") + config = configparser.ConfigParser() + config.read('/etc/php/7.0/fpm/pool.d/debug.conf') + config['debug']['listen'] = '127.0.0.1:9170' + config['debug']['rlimit_core'] = 'unlimited' + config['debug']['slowlog'] = '/var/log/php/7.0/slow.log' + config['debug']['request_slowlog_timeout'] = '10s' + with open('/etc/php/7.0/fpm/pool.d/debug.conf', + encoding='utf-8', mode='w') as confifile: + Log.debug(self, "writting PHP5 configuration into " + "/etc/php/7.0/fpm/pool.d/debug.conf") + config.write(confifile) + + with open("/etc/php/7.0/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_" + "output_name] = cachegrind.out.%p-%H-%R " + "\nphp_admin_flag[xdebug.profiler_enable" + "_trigger] = on \nphp_admin_flag[xdebug." + "profiler_enable] = off\n") + + # Disable xdebug + EEFileUtils.searchreplace(self, "/etc/php/mods-available/" + "xdebug.ini", + "zend_extension", + ";zend_extension") + + # PHP and Debug pull configuration + if not os.path.exists('{0}22222/htdocs/fpm/status/' + .format(EEVariables.ee_webroot)): + Log.debug(self, 'Creating directory ' + '{0}22222/htdocs/fpm/status/ ' + .format(EEVariables.ee_webroot)) + os.makedirs('{0}22222/htdocs/fpm/status/' + .format(EEVariables.ee_webroot)) + open('{0}22222/htdocs/fpm/status/debug' + .format(EEVariables.ee_webroot), + encoding='utf-8', mode='a').close() + open('{0}22222/htdocs/fpm/status/php' + .format(EEVariables.ee_webroot), + encoding='utf-8', mode='a').close() + + # Write info.php + if not os.path.exists('{0}22222/htdocs/php/' + .format(EEVariables.ee_webroot)): + Log.debug(self, 'Creating directory ' + '{0}22222/htdocs/php/ ' + .format(EEVariables.ee_webroot)) + os.makedirs('{0}22222/htdocs/php' + .format(EEVariables.ee_webroot)) + + with open("{0}22222/htdocs/php/info.php" + .format(EEVariables.ee_webroot), + encoding='utf-8', mode='w') as myfile: + myfile.write("") + + EEFileUtils.chown(self, "{0}22222" + .format(EEVariables.ee_webroot), + EEVariables.ee_php_user, + EEVariables.ee_php_user, recursive=True) + + EEGit.add(self, ["/etc/php7.0"], msg="Adding PHP into Git") + EEService.restart_service(self, 'php7.0-fpm') + + if set(EEVariables.ee_mysql).issubset(set(apt_packages)): # TODO: Currently we are using, we need to remove it in future From 68223aafff5047c4ed703cde2c781da1b237ad48 Mon Sep 17 00:00:00 2001 From: "nikhilc@bsf.io" Date: Tue, 2 Feb 2016 20:07:26 +0530 Subject: [PATCH 007/115] updated the WordPress rademark in some strings --- ee/cli/plugins/site_functions.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index 38232fca..95d5a94f 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -250,7 +250,7 @@ def setupwordpress(self, data): if 'wp-pass' in data.keys() and data['wp-pass']: ee_wp_pass = data['wp-pass'] - Log.info(self, "Downloading Wordpress \t\t", end='') + Log.info(self, "Downloading WordPress \t\t", end='') EEFileUtils.chdir(self, '{0}/htdocs/'.format(ee_site_webroot)) try: if EEShellExec.cmd_exec(self, "wp --allow-root core" @@ -258,10 +258,10 @@ def setupwordpress(self, data): pass else: Log.info(self, "[" + Log.ENDC + Log.FAIL + "Fail" + Log.OKBLUE + "]") - raise SiteError("download wordpress core failed") + raise SiteError("download WordPress core failed") except CommandExecutionError as e: Log.info(self, "[" + Log.ENDC + Log.FAIL + "Fail" + Log.OKBLUE + "]") - raise SiteError(self, "download wordpress core failed") + raise SiteError(self, "download WordPress core failed") Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]") @@ -389,7 +389,7 @@ def setupwordpress(self, data): ee_wp_user = input('Enter WordPress username: ') except EOFError as e: Log.debug(self, "{0}".format(e)) - raise SiteError("input wordpress username failed") + raise SiteError("input WordPress username failed") if not ee_wp_pass: ee_wp_pass = ee_random @@ -400,7 +400,7 @@ def setupwordpress(self, data): ee_wp_email = input('Enter WordPress email: ') except EOFError as e: Log.debug(self, "{0}".format(e)) - raise SiteError("input wordpress username failed") + raise SiteError("input WordPress username failed") try: while not re.match(r"^[A-Za-z0-9\.\+_-]+@[A-Za-z0-9\._-]+\.[a-zA-Z]*$", @@ -434,9 +434,9 @@ def setupwordpress(self, data): log=False): pass else: - raise SiteError("setup wordpress tables failed for single site") + raise SiteError("setup WordPress tables failed for single site") except CommandExecutionError as e: - raise SiteError("setup wordpress tables failed for single site") + raise SiteError("setup WordPress tables failed for single site") else: Log.debug(self, "Creating tables for WordPress multisite") Log.debug(self, "php {0} --allow-root " @@ -465,9 +465,9 @@ def setupwordpress(self, data): log=False): pass else: - raise SiteError("setup wordpress tables failed for wp multi site") + raise SiteError("setup WordPress tables failed for wp multi site") except CommandExecutionError as e: - raise SiteError("setup wordpress tables failed for wp multi site") + raise SiteError("setup WordPress tables failed for wp multi site") Log.debug(self, "Updating WordPress permalink") try: @@ -518,11 +518,11 @@ def setupwordpressnetwork(self, data): pass else: Log.info(self, "[" + Log.ENDC + Log.FAIL + "Fail" + Log.OKBLUE + "]") - raise SiteError("setup wordpress network failed") + raise SiteError("setup WordPress network failed") except CommandExecutionError as e: Log.info(self, "[" + Log.ENDC + Log.FAIL + "Fail" + Log.OKBLUE + "]") - raise SiteError("setup wordpress network failed") + raise SiteError("setup WordPress network failed") Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]") @@ -852,7 +852,7 @@ def updatewpuserpassword(self, ee_domain, ee_site_webroot): is_wp = EEShellExec.cmd_exec(self, "wp --allow-root core" " version") except CommandExecutionError as e: - raise SiteError("is wordpress site? check command failed ") + raise SiteError("is WordPress site? check command failed ") # Exit if ee_domain is not wordpress install if not is_wp: @@ -1207,7 +1207,7 @@ def setupLetsEncrypt(self, ee_domain_name): ee_wp_email = input('Enter WordPress email: ') except EOFError as e: Log.debug(self, "{0}".format(e)) - raise SiteError("input wordpress username failed") + raise SiteError("input WordPress username failed") if not os.path.isdir("/opt/letsencrypt"): cloneLetsEncrypt(self) @@ -1265,7 +1265,7 @@ def renewLetsEncrypt(self, ee_domain_name): ee_wp_email = input('Enter email address: ') except EOFError as e: Log.debug(self, "{0}".format(e)) - raise SiteError("Input wordpress email failed") + raise SiteError("Input WordPress email failed") if not os.path.isdir("/opt/letsencrypt"): cloneLetsEncrypt(self) From 65ffad58ac8993aaece8238d83d46e25276403b4 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 2 Feb 2016 20:16:37 +0530 Subject: [PATCH 008/115] Added php7.0 install --- ee/cli/plugins/stack.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 72e710c6..d314a8fd 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -1858,6 +1858,7 @@ class EEStackController(CementBaseController): @expose(help="Install packages") def install(self, packages=[], apt_packages=[], disp_msg=True): """Start installation of packages""" + ee_platform_codename = os.popen("lsb_release -sc | tr -d \'\\n\'").read() self.msg = [] try: # Default action for stack installation @@ -1870,7 +1871,7 @@ class EEStackController(CementBaseController): (not self.app.pargs.adminer) and (not self.app.pargs.utils) and (not self.app.pargs.mailscanner) and (not self.app.pargs.all) and (not self.app.pargs.redis) and (not self.app.pargs.nginxmainline) and - (not self.app.pargs.phpredisadmin)): + (not self.app.pargs.phpredisadmin) and (not self.app.pargs.php7)): self.app.pargs.web = True self.app.pargs.admin = True @@ -2015,12 +2016,26 @@ class EEStackController(CementBaseController): if self.app.pargs.php: Log.debug(self, "Setting apt_packages variable for PHP") - if not EEAptGet.is_installed(self, 'php5-fpm'): + if not (EEAptGet.is_installed(self, 'php5-fpm') and EEAptGet.is_installed(self, 'php5.6-fpm')): apt_packages = apt_packages + EEVariables.ee_php else: Log.debug(self, "PHP already installed") Log.info(self, "PHP already installed") + + if self.app.pargs.php7: + if ee_platform_codename == 'trusty': + Log.debug(self, "Setting apt_packages variable for PHP 7.0") + if not EEAptGet.is_installed(self, 'php7.0-fpm') : + apt_packages = apt_packages + EEVariables.ee_php7_0 + else: + Log.debug(self, "PHP already installed") + Log.info(self, "PHP already installed") + else: + Log.debug(self, "PHP 7.0 Not Available for your Distribution") + Log.info(self, "PHP 7.0 Not Available for your Distribution") + + if self.app.pargs.hhvm: Log.debug(self, "Setting apt packages variable for HHVM") if platform.architecture()[0] is '32bit': From 5284c4760c39f5998cfd5efd1a720d168424df20 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 3 Feb 2016 13:11:53 +0530 Subject: [PATCH 009/115] Fix or --- ee/cli/plugins/stack.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index d314a8fd..807a0e9f 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -180,8 +180,8 @@ class EEStackController(CementBaseController): Log.debug(self, 'Adding ppa of Nginx-mainline') EERepo.add_key(self, EEVariables.ee_nginx_key) - if (set(EEVariables.ee_php).issubset(set(apt_packages)) or set(EEVariables.ee_php7_0).issubset(set(apt_packages))\ - or set(EEVariables.ee_php5_6).issubset(set(apt_packages))): + if set(EEVariables.ee_php).issubset(set(apt_packages)) or set(EEVariables.ee_php7_0).issubset(set(apt_packages))\ + or set(EEVariables.ee_php5_6).issubset(set(apt_packages)): Log.info(self, "Adding repository for PHP, please wait...") # Add repository for php if EEVariables.ee_platform_distro == 'debian': From bb326ad0717f0c36db53213e70db033e71e04afd Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 3 Feb 2016 13:23:57 +0530 Subject: [PATCH 010/115] Fix 'EEVariables' has no attribute 'ee_php5_6' --- ee/cli/plugins/stack.py | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 807a0e9f..940be69c 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -180,17 +180,23 @@ class EEStackController(CementBaseController): Log.debug(self, 'Adding ppa of Nginx-mainline') EERepo.add_key(self, EEVariables.ee_nginx_key) - if set(EEVariables.ee_php).issubset(set(apt_packages)) or set(EEVariables.ee_php7_0).issubset(set(apt_packages))\ - or set(EEVariables.ee_php5_6).issubset(set(apt_packages)): - Log.info(self, "Adding repository for PHP, please wait...") - # Add repository for php - if EEVariables.ee_platform_distro == 'debian': - if EEVariables.ee_platform_codename != 'jessie': - Log.debug(self, 'Adding repo_url of php for debian') - EERepo.add(self, repo_url=EEVariables.ee_php_repo) - Log.debug(self, 'Adding Dotdeb/php GPG key') - EERepo.add_key(self, '89DF5277') - else: + if EEVariables.ee_platform_codename != 'trusty': + if set(EEVariables.ee_php).issubset(set(apt_packages)): + Log.info(self, "Adding repository for PHP, please wait...") + # Add repository for php + if EEVariables.ee_platform_distro == 'debian': + if EEVariables.ee_platform_codename != 'jessie': + Log.debug(self, 'Adding repo_url of php for debian') + EERepo.add(self, repo_url=EEVariables.ee_php_repo) + Log.debug(self, 'Adding Dotdeb/php GPG key') + EERepo.add_key(self, '89DF5277') + else: + Log.debug(self, 'Adding ppa for PHP') + EERepo.add(self, ppa=EEVariables.ee_php_repo) + else: + if set(EEVariables.ee_php7_0).issubset(set(apt_packages)) \ + or set(EEVariables.ee_php5_6).issubset(set(apt_packages)): + Log.info(self, "Adding repository for PHP, please wait...") Log.debug(self, 'Adding ppa for PHP') EERepo.add(self, ppa=EEVariables.ee_php_repo) @@ -1858,7 +1864,6 @@ class EEStackController(CementBaseController): @expose(help="Install packages") def install(self, packages=[], apt_packages=[], disp_msg=True): """Start installation of packages""" - ee_platform_codename = os.popen("lsb_release -sc | tr -d \'\\n\'").read() self.msg = [] try: # Default action for stack installation @@ -2024,7 +2029,7 @@ class EEStackController(CementBaseController): if self.app.pargs.php7: - if ee_platform_codename == 'trusty': + if EEVariables.ee_platform_codename == 'trusty': Log.debug(self, "Setting apt_packages variable for PHP 7.0") if not EEAptGet.is_installed(self, 'php7.0-fpm') : apt_packages = apt_packages + EEVariables.ee_php7_0 From c1c7ac2823d9aaae0d71e4fc2c54cd90a73cf244 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 3 Feb 2016 13:33:44 +0530 Subject: [PATCH 011/115] Fix 'EEVariables' has no attribute 'ee_php5_6' --- ee/cli/plugins/stack.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 940be69c..05f4a410 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -855,7 +855,7 @@ class EEStackController(CementBaseController): EEService.restart_service(self, 'php5-fpm') - if set(EEVariables.ee_php5_6).issubset(set(apt_packages)): + if EEVariables.ee_platform_codename == 'trusty' and set(EEVariables.ee_php5_6).issubset(set(apt_packages)): # Create log directories if not os.path.exists('/var/log/php/5.6/'): Log.debug(self, 'Creating directory /var/log/php/5.6/') @@ -982,7 +982,7 @@ class EEStackController(CementBaseController): EEService.restart_service(self, 'php5.6-fpm') #preconfiguration for php7.0 - if set(EEVariables.ee_php7_0).issubset(set(apt_packages)): + if EEVariables.ee_platform_codename == 'trusty' and set(EEVariables.ee_php7_0).issubset(set(apt_packages)): # Create log directories if not os.path.exists('/var/log/php/7.0/'): Log.debug(self, 'Creating directory /var/log/php/7.0/') From 0a52dcf7da14a7c1a15f09d59a697d2bbe78e574 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 3 Feb 2016 14:54:13 +0530 Subject: [PATCH 012/115] Handle conflict for PHP7.0 with PHP5 #651 --- ee/cli/plugins/stack.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 05f4a410..f4b19628 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -712,7 +712,7 @@ class EEStackController(CementBaseController): "'$http_host \"$request\" $status $body_bytes_sent '\n" "'\"$http_referer\" \"$http_user_agent\"';\n") - if set(EEVariables.ee_php).issubset(set(apt_packages)): + if EEVariables.ee_platform_codename != 'trusty' and set(EEVariables.ee_php).issubset(set(apt_packages)): # Create log directories if not os.path.exists('/var/log/php5/'): Log.debug(self, 'Creating directory /var/log/php5/') @@ -2022,7 +2022,10 @@ class EEStackController(CementBaseController): if self.app.pargs.php: Log.debug(self, "Setting apt_packages variable for PHP") if not (EEAptGet.is_installed(self, 'php5-fpm') and EEAptGet.is_installed(self, 'php5.6-fpm')): - apt_packages = apt_packages + EEVariables.ee_php + if EEVariables.ee_platform_codename == 'trusty': + apt_packages = apt_packages + EEVariables.ee_php5_6 + else: + apt_packages = apt_packages + EEVariables.ee_php else: Log.debug(self, "PHP already installed") Log.info(self, "PHP already installed") @@ -2283,7 +2286,10 @@ class EEStackController(CementBaseController): Log.error(self,"Cannot Remove! Nginx Mainline version not found.") if self.app.pargs.php: Log.debug(self, "Removing apt_packages variable of PHP") - apt_packages = apt_packages + EEVariables.ee_php + if EEVariables.ee_platform_codename == 'trusty': + apt_packages = apt_packages + EEVariables.ee_php5_6 + else: + apt_packages = apt_packages + EEVariables.ee_php if self.app.pargs.hhvm: if EEAptGet.is_installed(self, 'hhvm'): @@ -2432,7 +2438,10 @@ class EEStackController(CementBaseController): Log.error(self,"Cannot Purge! Nginx Mainline version not found.") if self.app.pargs.php: Log.debug(self, "Purge apt_packages variable PHP") - apt_packages = apt_packages + EEVariables.ee_php + if EEVariables.ee_platform_codename == 'trusty': + apt_packages = apt_packages + EEVariables.ee_php5_6 + else: + apt_packages = apt_packages + EEVariables.ee_php if self.app.pargs.hhvm: if EEAptGet.is_installed(self, 'hhvm'): Log.debug(self, "Purge apt_packages varible of HHVM") From d459c51a05d8f3f0992566ec35766465398bd44b Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 3 Feb 2016 15:15:48 +0530 Subject: [PATCH 013/115] name 'ee_php' is not defined --- ee/core/variables.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ee/core/variables.py b/ee/core/variables.py index 119ebd01..321d84d2 100644 --- a/ee/core/variables.py +++ b/ee/core/variables.py @@ -141,7 +141,11 @@ class EEVariables(): ee_php = ee_php + ["php5-dev"] if ee_platform_distro == 'ubuntu' or ee_platform_codename == 'jessie': - ee_php = ee_php + ["php5-xdebug"] + if ee_platform_codename == 'trusty': + ee_php = ee_php5_6 + ["php-xdebug"] + ee_php = ee_php7_0 + ["php-xdebug"] + else: + ee_php = ee_php + ["php5-xdebug"] # MySQL repo and packages if ee_platform_distro == 'ubuntu': From 46525adffd825161d9786f38756b63c3620920a9 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 3 Feb 2016 15:21:24 +0530 Subject: [PATCH 014/115] Unable to locate package php5.6-memcache --- ee/core/variables.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ee/core/variables.py b/ee/core/variables.py index 321d84d2..4b81c12e 100644 --- a/ee/core/variables.py +++ b/ee/core/variables.py @@ -122,11 +122,11 @@ class EEVariables(): ee_php_repo = "ppa:ondrej/php" ee_php5_6 = ["php5.6-fpm", "php5.6-curl", "php5.6-gd", "php5.6-imap", "php5.6-mcrypt", "php5.6-common", "php5.6-readline", - "php5.6-mysql", "php5.6-cli", "php5.6-memcache", "php-imagick", + "php5.6-mysql", "php5.6-cli", "php-memcached", "php-imagick", "memcached", "graphviz", "php-pear"] ee_php7_0 = ["php7.0-fpm", "php7.0-curl", "php7.0-gd", "php7.0-imap", "php7.0-mcrypt", "php7.0-common", "php7.0-readline", - "php7.0-mysql", "php7.0-cli", "php7.0-memcache", "php-imagick", + "php7.0-mysql", "php7.0-cli", "php-memcached", "php-imagick", "memcached", "graphviz", "php-pear"] elif ee_platform_distro == 'debian': if ee_platform_codename == 'wheezy': From d4e6d14adad4eec7f8ce690168b4f9ab3b6b7546 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 3 Feb 2016 16:01:26 +0530 Subject: [PATCH 015/115] include error --- ee/cli/plugins/stack.py | 10 ++++++---- ee/core/variables.py | 12 ++++-------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index f4b19628..efb1496c 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -885,7 +885,7 @@ class EEStackController(CementBaseController): config['global']['error_log'] = '/var/log/php/5.6/fpm.log' config.remove_option('global', 'include') config['global']['log_level'] = 'notice' - config['global']['include'] = '/etc/php/5.6/fpm/pool.d/*.conf' + # config['global']['include'] = '/etc/php/5.6/fpm/pool.d/*.conf' with codecs.open('/etc/php/5.6/fpm/php-fpm.conf', encoding='utf-8', mode='w') as configfile: Log.debug(self, "writting php5 configuration into " @@ -939,7 +939,8 @@ class EEStackController(CementBaseController): "profiler_enable] = off\n") # Disable xdebug - EEFileUtils.searchreplace(self, "/etc/php/mods-available/" + if not EEShellExec.cmd_exec(self, "grep -q \';zend_extension\' /etc/php/mods-available/xdebug.ini"): + EEFileUtils.searchreplace(self, "/etc/php/mods-available/" "xdebug.ini", "zend_extension", ";zend_extension") @@ -1012,7 +1013,7 @@ class EEStackController(CementBaseController): config['global']['error_log'] = '/var/log/php/7.0/fpm.log' config.remove_option('global', 'include') config['global']['log_level'] = 'notice' - config['global']['include'] = '/etc/php/7.0/fpm/pool.d/*.conf' + #config['global']['include'] = '/etc/php/7.0/fpm/pool.d/*.conf' with codecs.open('/etc/php/7.0/fpm/php-fpm.conf', encoding='utf-8', mode='w') as configfile: Log.debug(self, "writting php5 configuration into " @@ -1066,7 +1067,8 @@ class EEStackController(CementBaseController): "profiler_enable] = off\n") # Disable xdebug - EEFileUtils.searchreplace(self, "/etc/php/mods-available/" + if not EEShellExec.cmd_exec(self, "grep -q \';zend_extension\' /etc/php/mods-available/xdebug.ini"): + EEFileUtils.searchreplace(self, "/etc/php/mods-available/" "xdebug.ini", "zend_extension", ";zend_extension") diff --git a/ee/core/variables.py b/ee/core/variables.py index 4b81c12e..73e2ec99 100644 --- a/ee/core/variables.py +++ b/ee/core/variables.py @@ -123,11 +123,11 @@ class EEVariables(): ee_php5_6 = ["php5.6-fpm", "php5.6-curl", "php5.6-gd", "php5.6-imap", "php5.6-mcrypt", "php5.6-common", "php5.6-readline", "php5.6-mysql", "php5.6-cli", "php-memcached", "php-imagick", - "memcached", "graphviz", "php-pear"] + "memcached", "graphviz", "php-pear", "php-xdebug"] ee_php7_0 = ["php7.0-fpm", "php7.0-curl", "php7.0-gd", "php7.0-imap", "php7.0-mcrypt", "php7.0-common", "php7.0-readline", "php7.0-mysql", "php7.0-cli", "php-memcached", "php-imagick", - "memcached", "graphviz", "php-pear"] + "memcached", "graphviz", "php-pear", "php-xdebug"] elif ee_platform_distro == 'debian': if ee_platform_codename == 'wheezy': ee_php_repo = ("deb http://packages.dotdeb.org {codename}-php56 all" @@ -140,12 +140,8 @@ class EEVariables(): if ee_platform_codename == 'wheezy': ee_php = ee_php + ["php5-dev"] - if ee_platform_distro == 'ubuntu' or ee_platform_codename == 'jessie': - if ee_platform_codename == 'trusty': - ee_php = ee_php5_6 + ["php-xdebug"] - ee_php = ee_php7_0 + ["php-xdebug"] - else: - ee_php = ee_php + ["php5-xdebug"] + if ee_platform_codename == 'precise' or ee_platform_codename == 'jessie': + ee_php = ee_php + ["php5-xdebug"] # MySQL repo and packages if ee_platform_distro == 'ubuntu': From f284efc66ff9a1d4af5d7dfa359ae4a7c7a9446d Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 3 Feb 2016 18:47:47 +0530 Subject: [PATCH 016/115] Typo mistack fix --- ee/cli/plugins/stack.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index efb1496c..2debcbb2 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -878,14 +878,14 @@ class EEStackController(CementBaseController): # Parse /etc/php/5.6/fpm/php-fpm.conf config = configparser.ConfigParser() - Log.debug(self, "configuring php file" + Log.debug(self, "configuring php file " "/etc/php/5.6/fpm/php-fpm.conf") config.read_file(codecs.open("/etc/php/5.6/fpm/php-fpm.conf", "r", "utf8")) config['global']['error_log'] = '/var/log/php/5.6/fpm.log' config.remove_option('global', 'include') config['global']['log_level'] = 'notice' - # config['global']['include'] = '/etc/php/5.6/fpm/pool.d/*.conf' + config['global']['include'] = '/etc/php/5.6/fpm/pool.d/*.conf' with codecs.open('/etc/php/5.6/fpm/php-fpm.conf', encoding='utf-8', mode='w') as configfile: Log.debug(self, "writting php5 configuration into " @@ -1013,7 +1013,7 @@ class EEStackController(CementBaseController): config['global']['error_log'] = '/var/log/php/7.0/fpm.log' config.remove_option('global', 'include') config['global']['log_level'] = 'notice' - #config['global']['include'] = '/etc/php/7.0/fpm/pool.d/*.conf' + config['global']['include'] = '/etc/php/7.0/fpm/pool.d/*.conf' with codecs.open('/etc/php/7.0/fpm/php-fpm.conf', encoding='utf-8', mode='w') as configfile: Log.debug(self, "writting php5 configuration into " @@ -2039,8 +2039,8 @@ class EEStackController(CementBaseController): if not EEAptGet.is_installed(self, 'php7.0-fpm') : apt_packages = apt_packages + EEVariables.ee_php7_0 else: - Log.debug(self, "PHP already installed") - Log.info(self, "PHP already installed") + Log.debug(self, "PHP 7.0 already installed") + Log.info(self, "PHP 7.0 already installed") else: Log.debug(self, "PHP 7.0 Not Available for your Distribution") Log.info(self, "PHP 7.0 Not Available for your Distribution") From 30b9086ecae0597155a035c05fc9a34902f66205 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 3 Feb 2016 19:40:03 +0530 Subject: [PATCH 017/115] php-fpm mustache added --- ee/cli/templates/php-fpm.mustache | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 ee/cli/templates/php-fpm.mustache diff --git a/ee/cli/templates/php-fpm.mustache b/ee/cli/templates/php-fpm.mustache new file mode 100644 index 00000000..eae67a41 --- /dev/null +++ b/ee/cli/templates/php-fpm.mustache @@ -0,0 +1,5 @@ +[global] +pid = {{pid}} +error_log = {{error_log}} +log_level = notice +include = {{include}} \ No newline at end of file From ef84c9e2906e5acc791131fffad49cac95a28666 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 3 Feb 2016 19:40:50 +0530 Subject: [PATCH 018/115] Depreciated config_parser code for php-fpm.conf. --- ee/cli/plugins/stack.py | 42 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 2debcbb2..0f7403b5 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -749,7 +749,9 @@ class EEStackController(CementBaseController): "/etc/php5/fpm/php.ini") config.write(configfile) - # Prase /etc/php5/fpm/php-fpm.conf + ''' + #Code depreciated. Mustache version applied + # Parse /etc/php5/fpm/php-fpm.conf config = configparser.ConfigParser() Log.debug(self, "configuring php file" "/etc/php5/fpm/php-fpm.conf") @@ -764,6 +766,17 @@ class EEStackController(CementBaseController): Log.debug(self, "writting php5 configuration into " "/etc/php5/fpm/php-fpm.conf") config.write(configfile) + ''' + #configure /etc/php5/fpm/php-fpm.conf + data = dict(pid="/run/php5-fpm.pid", error_log="/var/log/php5/fpm.log", + include="/etc/php5/fpm/pool.d/*.conf") + Log.debug(self, "writting php configuration into " + "/etc/php5/fpm/php-fpm.conf") + ee_php_fpm = open('/etc/php5/fpm/php-fpm.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'php-fpm.mustache', out=ee_php_fpm) + ee_php_fpm.close() + # Parse /etc/php5/fpm/pool.d/www.conf config = configparser.ConfigParser() @@ -877,6 +890,9 @@ class EEStackController(CementBaseController): config.write(configfile) # Parse /etc/php/5.6/fpm/php-fpm.conf + ''' + #Depreciated code. Mustache version Applied. + config = configparser.ConfigParser() Log.debug(self, "configuring php file " "/etc/php/5.6/fpm/php-fpm.conf") @@ -891,6 +907,19 @@ class EEStackController(CementBaseController): Log.debug(self, "writting php5 configuration into " "/etc/php/5.6/fpm/php-fpm.conf") config.write(configfile) + ''' + data = dict(pid="/run/php/php5.6-fpm.pid", error_log="/var/log/php/5.6/fpm.log", + include="/etc/php/5.6/fpm/pool.d/*.conf") + Log.debug(self, "writting php5 configuration into " + "/etc/php/5.6/fpm/php-fpm.conf") + ee_php_fpm = open('/etc/php/5.6/fpm/php-fpm.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'php-fpm.mustache', out=ee_php_fpm) + ee_php_fpm.close() + + + + # Parse /etc/php/5.6/fpm/pool.d/www.conf config = configparser.ConfigParser() @@ -1005,6 +1034,8 @@ class EEStackController(CementBaseController): config.write(configfile) # Parse /etc/php/7.0/fpm/php-fpm.conf + ''' + #Depreciated code. Mustache version applied config = configparser.ConfigParser() Log.debug(self, "configuring php file" "/etc/php/7.0/fpm/php-fpm.conf") @@ -1019,6 +1050,15 @@ class EEStackController(CementBaseController): Log.debug(self, "writting php5 configuration into " "/etc/php/7.0/fpm/php-fpm.conf") config.write(configfile) + ''' + data = dict(pid="/run/php/php7.0-fpm.pid", error_log="/var/log/php/7.0/fpm.log", + include="/etc/php/7.0/fpm/pool.d/*.conf") + Log.debug(self, "writting php 7.0 configuration into " + "/etc/php/7.0/fpm/php-fpm.conf") + ee_php_fpm = open('/etc/php/7.0/fpm/php-fpm.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'php-fpm.mustache', out=ee_php_fpm) + ee_php_fpm.close() # Parse /etc/php/7.0/fpm/pool.d/www.conf config = configparser.ConfigParser() From 5d7c686ba47ca117ed452795900878f78eca07b7 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 3 Feb 2016 19:48:38 +0530 Subject: [PATCH 019/115] Fix php older version check --- ee/cli/plugins/stack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 0f7403b5..e4d0cb74 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -2063,7 +2063,7 @@ class EEStackController(CementBaseController): if self.app.pargs.php: Log.debug(self, "Setting apt_packages variable for PHP") - if not (EEAptGet.is_installed(self, 'php5-fpm') and EEAptGet.is_installed(self, 'php5.6-fpm')): + if not (EEAptGet.is_installed(self, 'php5-fpm') or EEAptGet.is_installed(self, 'php5.6-fpm')): if EEVariables.ee_platform_codename == 'trusty': apt_packages = apt_packages + EEVariables.ee_php5_6 else: From e31c92f8edf4bdf50468153e594314ff340e0306 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 3 Feb 2016 20:31:36 +0530 Subject: [PATCH 020/115] stack php5.6 status --- ee/cli/plugins/stack_services.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ee/cli/plugins/stack_services.py b/ee/cli/plugins/stack_services.py index 45a947bf..b949b96a 100644 --- a/ee/cli/plugins/stack_services.py +++ b/ee/cli/plugins/stack_services.py @@ -253,10 +253,16 @@ class EEStackStatusController(CementBaseController): Log.info(self, "Nginx is not installed") if self.app.pargs.php: - if EEAptGet.is_installed(self, 'php5-fpm'): - services = services + ['php5-fpm'] + if EEVariables.ee_platform_codename != 'trusty': + if EEAptGet.is_installed(self, 'php5-fpm'): + services = services + ['php5-fpm'] + else: + Log.info(self, "PHP5-FPM is not installed") else: - Log.info(self, "PHP5-FPM is not installed") + if EEAptGet.is_installed(self, 'php5.6-fpm'): + services = services + ['php5.6-fpm'] + else: + Log.info(self, "PHP5.6-FPM is not installed") if self.app.pargs.mysql: if ((EEVariables.ee_mysql_host is "localhost") or From 027c44af88bd8550cd650f4432ae3c75a271e4fc Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 3 Feb 2016 20:37:04 +0530 Subject: [PATCH 021/115] stack php7.0 status --- ee/cli/plugins/stack_services.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ee/cli/plugins/stack_services.py b/ee/cli/plugins/stack_services.py index b949b96a..3c4b1603 100644 --- a/ee/cli/plugins/stack_services.py +++ b/ee/cli/plugins/stack_services.py @@ -264,6 +264,11 @@ class EEStackStatusController(CementBaseController): else: Log.info(self, "PHP5.6-FPM is not installed") + if EEAptGet.is_installed(self, 'php7.0-fpm'): + services = services + ['php7.0-fpm'] + else: + Log.info(self, "PHP7.0-FPM is not installed") + if self.app.pargs.mysql: if ((EEVariables.ee_mysql_host is "localhost") or (EEVariables.ee_mysql_host is "127.0.0.1")): From 9ca044a276ca507d5f6b3169a5ca81cf561c37bc Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Thu, 4 Feb 2016 15:48:46 +0530 Subject: [PATCH 022/115] Added stack restart --php7 --- ee/cli/plugins/stack_services.py | 40 ++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/ee/cli/plugins/stack_services.py b/ee/cli/plugins/stack_services.py index 3c4b1603..6df23398 100644 --- a/ee/cli/plugins/stack_services.py +++ b/ee/cli/plugins/stack_services.py @@ -165,7 +165,7 @@ class EEStackStatusController(CementBaseController): def restart(self): """Restart services""" services = [] - if not (self.app.pargs.nginx or self.app.pargs.php + if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7 or self.app.pargs.mysql or self.app.pargs.postfix or self.app.pargs.hhvm or self.app.pargs.memcache or self.app.pargs.dovecot or self.app.pargs.redis): @@ -181,10 +181,31 @@ class EEStackStatusController(CementBaseController): Log.info(self, "Nginx is not installed") if self.app.pargs.php: - if EEAptGet.is_installed(self, 'php5-fpm'): - services = services + ['php5-fpm'] + if EEVariables.ee_platform_codename != 'trusty': + if EEAptGet.is_installed(self, 'php5-fpm'): + services = services + ['php5-fpm'] + else: + Log.info(self, "PHP5-FPM is not installed") else: - Log.info(self, "PHP5-FPM is not installed") + if EEAptGet.is_installed(self, 'php5.6-fpm'): + services = services + ['php5.6-fpm'] + else: + Log.info(self, "PHP5.6-FPM is not installed") + + if EEAptGet.is_installed(self, 'php7.0-fpm'): + services = services + ['php7.0-fpm'] + else: + Log.info(self, "PHP7.0-FPM is not installed") + + if self.app.pargs.php7: + if EEVariables.ee_platform_codename == 'trusty': + if EEAptGet.is_installed(self, 'php7.0-fpm'): + services = services + ['php7.0-fpm'] + else: + Log.info(self, "PHP7.0-FPM is not installed") + else: + Log.info(self, "Your platform does not support PHP 7") + if self.app.pargs.mysql: if ((EEVariables.ee_mysql_host is "localhost") or @@ -236,7 +257,7 @@ class EEStackStatusController(CementBaseController): def status(self): """Status of services""" services = [] - if not (self.app.pargs.nginx or self.app.pargs.php + if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7 or self.app.pargs.mysql or self.app.pargs.postfix or self.app.pargs.hhvm or self.app.pargs.memcache or self.app.pargs.dovecot or self.app.pargs.redis): @@ -269,6 +290,15 @@ class EEStackStatusController(CementBaseController): else: Log.info(self, "PHP7.0-FPM is not installed") + if self.app.pargs.php7: + if EEVariables.ee_platform_codename == 'trusty': + if EEAptGet.is_installed(self, 'php7.0-fpm'): + services = services + ['php7.0-fpm'] + else: + Log.info(self, "PHP7.0-FPM is not installed") + else: + Log.info(self, "Your platform does not support PHP 7") + if self.app.pargs.mysql: if ((EEVariables.ee_mysql_host is "localhost") or (EEVariables.ee_mysql_host is "127.0.0.1")): From 761e3175459311cdb89a6a6244d715df88c92d90 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Thu, 4 Feb 2016 15:52:09 +0530 Subject: [PATCH 023/115] Added stack services --php7/--php --- ee/cli/plugins/stack_services.py | 84 +++++++++++++++++++++++++++----- 1 file changed, 72 insertions(+), 12 deletions(-) diff --git a/ee/cli/plugins/stack_services.py b/ee/cli/plugins/stack_services.py index 6df23398..26b540fc 100644 --- a/ee/cli/plugins/stack_services.py +++ b/ee/cli/plugins/stack_services.py @@ -23,7 +23,7 @@ class EEStackStatusController(CementBaseController): def start(self): """Start services""" services = [] - if not (self.app.pargs.nginx or self.app.pargs.php + if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7 or self.app.pargs.mysql or self.app.pargs.postfix or self.app.pargs.hhvm or self.app.pargs.memcache or self.app.pargs.dovecot or self.app.pargs.redis): @@ -39,10 +39,30 @@ class EEStackStatusController(CementBaseController): Log.info(self, "Nginx is not installed") if self.app.pargs.php: - if EEAptGet.is_installed(self, 'php5-fpm'): - services = services + ['php5-fpm'] + if EEVariables.ee_platform_codename != 'trusty': + if EEAptGet.is_installed(self, 'php5-fpm'): + services = services + ['php5-fpm'] + else: + Log.info(self, "PHP5-FPM is not installed") + else: + if EEAptGet.is_installed(self, 'php5.6-fpm'): + services = services + ['php5.6-fpm'] + else: + Log.info(self, "PHP5.6-FPM is not installed") + + if EEAptGet.is_installed(self, 'php7.0-fpm'): + services = services + ['php7.0-fpm'] + else: + Log.info(self, "PHP7.0-FPM is not installed") + + if self.app.pargs.php7: + if EEVariables.ee_platform_codename == 'trusty': + if EEAptGet.is_installed(self, 'php7.0-fpm'): + services = services + ['php7.0-fpm'] + else: + Log.info(self, "PHP7.0-FPM is not installed") else: - Log.info(self, "PHP5-FPM is not installed") + Log.info(self, "Your platform does not support PHP 7") if self.app.pargs.mysql: if ((EEVariables.ee_mysql_host is "localhost") or @@ -94,7 +114,7 @@ class EEStackStatusController(CementBaseController): def stop(self): """Stop services""" services = [] - if not (self.app.pargs.nginx or self.app.pargs.php + if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7 or self.app.pargs.mysql or self.app.pargs.postfix or self.app.pargs.hhvm or self.app.pargs.memcache or self.app.pargs.dovecot or self.app.pargs.redis): @@ -110,10 +130,30 @@ class EEStackStatusController(CementBaseController): Log.info(self, "Nginx is not installed") if self.app.pargs.php: - if EEAptGet.is_installed(self, 'php5-fpm'): - services = services + ['php5-fpm'] + if EEVariables.ee_platform_codename != 'trusty': + if EEAptGet.is_installed(self, 'php5-fpm'): + services = services + ['php5-fpm'] + else: + Log.info(self, "PHP5-FPM is not installed") + else: + if EEAptGet.is_installed(self, 'php5.6-fpm'): + services = services + ['php5.6-fpm'] + else: + Log.info(self, "PHP5.6-FPM is not installed") + + if EEAptGet.is_installed(self, 'php7.0-fpm'): + services = services + ['php7.0-fpm'] + else: + Log.info(self, "PHP7.0-FPM is not installed") + + if self.app.pargs.php7: + if EEVariables.ee_platform_codename == 'trusty': + if EEAptGet.is_installed(self, 'php7.0-fpm'): + services = services + ['php7.0-fpm'] + else: + Log.info(self, "PHP7.0-FPM is not installed") else: - Log.info(self, "PHP5-FPM is not installed") + Log.info(self, "Your platform does not support PHP 7") if self.app.pargs.mysql: if ((EEVariables.ee_mysql_host is "localhost") or @@ -349,7 +389,7 @@ class EEStackStatusController(CementBaseController): def reload(self): """Reload service""" services = [] - if not (self.app.pargs.nginx or self.app.pargs.php + if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7 or self.app.pargs.mysql or self.app.pargs.postfix or self.app.pargs.hhvm or self.app.pargs.memcache or self.app.pargs.dovecot or self.app.pargs.redis): @@ -365,10 +405,30 @@ class EEStackStatusController(CementBaseController): Log.info(self, "Nginx is not installed") if self.app.pargs.php: - if EEAptGet.is_installed(self, 'php5-fpm'): - services = services + ['php5-fpm'] + if EEVariables.ee_platform_codename != 'trusty': + if EEAptGet.is_installed(self, 'php5-fpm'): + services = services + ['php5-fpm'] + else: + Log.info(self, "PHP5-FPM is not installed") else: - Log.info(self, "PHP5-FPM is not installed") + if EEAptGet.is_installed(self, 'php5.6-fpm'): + services = services + ['php5.6-fpm'] + else: + Log.info(self, "PHP5.6-FPM is not installed") + + if EEAptGet.is_installed(self, 'php7.0-fpm'): + services = services + ['php7.0-fpm'] + else: + Log.info(self, "PHP7.0-FPM is not installed") + + if self.app.pargs.php7: + if EEVariables.ee_platform_codename == 'trusty': + if EEAptGet.is_installed(self, 'php7.0-fpm'): + services = services + ['php7.0-fpm'] + else: + Log.info(self, "PHP7.0-FPM is not installed") + else: + Log.info(self, "Your platform does not support PHP 7") if self.app.pargs.mysql: if ((EEVariables.ee_mysql_host is "localhost") or From 15034c30785b68477d98ecf77c1e9e875dc9a777 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 8 Feb 2016 20:24:41 +0530 Subject: [PATCH 024/115] added --php7 in site_functions --- ee/cli/plugins/site.py | 29 +++++++++++++++++++++++++++-- ee/cli/plugins/site_functions.py | 25 ++++++++++++++++++++++--- 2 files changed, 49 insertions(+), 5 deletions(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 8be95629..c0d3d655 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -336,6 +336,8 @@ class EESiteCreateController(CementBaseController): dict(help="create html site", action='store_true')), (['--php'], dict(help="create php site", action='store_true')), + (['--php7'], + dict(help="create php site", action='store_true')), (['--mysql'], dict(help="create mysql site", action='store_true')), (['--wp'], @@ -441,13 +443,13 @@ class EESiteCreateController(CementBaseController): data['port'] = port ee_site_webroot = "" - if stype in ['html', 'php']: + if stype in ['html', 'php' , 'php7']: data = dict(site_name=ee_domain, www_domain=ee_www_domain, static=True, basic=False, wp=False, w3tc=False, wpfc=False, wpsc=False, multisite=False, wpsubdir=False, webroot=ee_site_webroot) - if stype == 'php': + if stype == 'php' or stype == 'php7': data['static'] = False data['basic'] = True @@ -477,6 +479,29 @@ class EESiteCreateController(CementBaseController): if stype == "html" and self.app.pargs.hhvm: Log.error(self, "Can not create HTML site with HHVM") + if data and self.app.pargs.php7: + if (not self.app.pargs.experimental): + Log.info(self, "PHP7.0 is experimental feature and it may not " + "work with all CSS/JS/Cache of your site.\nDo you wish" + " to install PHP 7.0 now for {0}?".format(ee_domain)) + + # Check prompt + check_prompt = input("Type \"y\" to continue [n]:") + if check_prompt != "Y" and check_prompt != "y": + Log.info(self, "Not using PHP 7.0 for site.") + data['php7'] = False + php7 = 0 + self.app.pargs.php7 = False + else: + data['php7'] = True + php7 = 1 + else: + data['php7'] = True + php7 = 1 + elif data: + data['php7'] = False + php7 = 0 + if data and self.app.pargs.hhvm: if (not self.app.pargs.experimental): Log.info(self, "HHVM is experimental feature and it may not " diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index 38232fca..642e4e97 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -699,10 +699,29 @@ def site_package_check(self, stype): ee_nginx.write('fastcgi_param \tSCRIPT_FILENAME ' '\t$request_filename;\n') - if stype in ['php', 'mysql', 'wp', 'wpsubdir', 'wpsubdomain']: + if self.app.pargs.php and self.app.pargs.php7: + Log.error(self,"INVALID OPTION: PHP 7.0 provided with PHP 5.0") + + if not self.app.pargs.php7 and stype in ['php', 'mysql', 'wp', 'wpsubdir', 'wpsubdomain']: Log.debug(self, "Setting apt_packages variable for PHP") - if not EEAptGet.is_installed(self, 'php5-fpm'): - apt_packages = apt_packages + EEVariables.ee_php + if EEVariables.ee_platform_codename != 'trusty': + if not EEAptGet.is_installed(self, 'php5-fpm'): + apt_packages = apt_packages + EEVariables.ee_php + else: + if not EEAptGet.is_installed(self, 'php5.6-fpm'): + apt_packages = apt_packages + EEVariables.ee_php5_6 + + if self.app.pargs.php7 and stype in [ 'mysql', 'wp', 'wpsubdir', 'wpsubdomain']: + if EEVariables.ee_platform_codename == 'trusty': + Log.debug(self, "Setting apt_packages variable for PHP 7.0") + if not EEAptGet.is_installed(self, 'php7-fpm'): + apt_packages = apt_packages + EEVariables.ee_php7_0 + else: + Log.warn(self, "PHP 7.0 not available for your system.") + Log.info(self, "Setting apt_packages variable for PHP 5.0") + Log.debug(self, "Setting apt_packages variable for PHP 5.0") + if not EEAptGet.is_installed(self, 'php5-fpm'): + apt_packages = apt_packages + EEVariables.ee_php5_6 if stype in ['mysql', 'wp', 'wpsubdir', 'wpsubdomain']: Log.debug(self, "Setting apt_packages variable for MySQL") From d8dd1dafac59a17ed230746dfb1b274de54fc2ee Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 9 Feb 2016 13:06:49 +0530 Subject: [PATCH 025/115] fix namespace --- ee/cli/plugins/site.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index c0d3d655..258bfc6b 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -443,13 +443,13 @@ class EESiteCreateController(CementBaseController): data['port'] = port ee_site_webroot = "" - if stype in ['html', 'php' , 'php7']: + if stype in ['html', 'php' ] or self.app.pargs.php7: data = dict(site_name=ee_domain, www_domain=ee_www_domain, static=True, basic=False, wp=False, w3tc=False, wpfc=False, wpsc=False, multisite=False, wpsubdir=False, webroot=ee_site_webroot) - if stype == 'php' or stype == 'php7': + if stype == 'php' or self.app.pargs.php7: data['static'] = False data['basic'] = True From 6f785aa5496c129955ca67abf16b4f8fd7ea3437 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 9 Feb 2016 13:22:25 +0530 Subject: [PATCH 026/115] added --php7 in site update --- ee/cli/plugins/site.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 258bfc6b..49197307 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -824,6 +824,8 @@ class EESiteUpdateController(CementBaseController): dict(help="update to html site", action='store_true')), (['--php'], dict(help="update to php site", action='store_true')), + (['--php7'], + dict(help="update to php site", action='store_true')), (['--mysql'], dict(help="update to mysql site", action='store_true')), (['--wp'], @@ -873,7 +875,7 @@ class EESiteUpdateController(CementBaseController): if pargs.html: Log.error(self, "No site can be updated to html") - if not (pargs.php or + if not (pargs.php or pargs.php7 or pargs.mysql or pargs.wp or pargs.wpsubdir or pargs.wpsubdomain or pargs.w3tc or pargs.wpfc or pargs.wpsc or pargs.hhvm or pargs.pagespeed or pargs.wpredis or pargs.letsencrypt): From 085ef1aa9ac6d6831f950009a5659943ed854149 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 9 Feb 2016 14:42:01 +0530 Subject: [PATCH 027/115] Updated upstream conf with php7 --- ee/cli/templates/upstream.mustache | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ee/cli/templates/upstream.mustache b/ee/cli/templates/upstream.mustache index 62794c58..74c2bb64 100644 --- a/ee/cli/templates/upstream.mustache +++ b/ee/cli/templates/upstream.mustache @@ -7,6 +7,14 @@ upstream debug { # Debug Pool server 127.0.0.1:{{debug}}; } +upstream php7 { +# server unix:/run/php5-fpm.sock; +server 127.0.0.1:{{php7}}; +} +upstream debug7 { +# Debug Pool +server 127.0.0.1:{{debug7}}; +} {{#hhvmconf}} upstream hhvm { # HHVM Pool From 890e52c73ff0e42aeeaab656a0610476dd176504 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 9 Feb 2016 14:42:31 +0530 Subject: [PATCH 028/115] created php7.conf --- ee/cli/templates/php7.mustache | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 ee/cli/templates/php7.mustache diff --git a/ee/cli/templates/php7.mustache b/ee/cli/templates/php7.mustache new file mode 100644 index 00000000..85f3e44b --- /dev/null +++ b/ee/cli/templates/php7.mustache @@ -0,0 +1,10 @@ +# PHP NGINX CONFIGURATION +# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) +location / { + try_files $uri $uri/ /index.php?$args; +} +location ~ \.php$ { + try_files $uri =404; + include fastcgi_params; + fastcgi_pass php7; +} From 09e23c635706d9fa4ecb4b286ead620cf08b2baf Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 9 Feb 2016 14:42:57 +0530 Subject: [PATCH 029/115] created w3tc-php7.conf --- ee/cli/templates/w3tc-php7.mustache | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 ee/cli/templates/w3tc-php7.mustache diff --git a/ee/cli/templates/w3tc-php7.mustache b/ee/cli/templates/w3tc-php7.mustache new file mode 100644 index 00000000..389784cc --- /dev/null +++ b/ee/cli/templates/w3tc-php7.mustache @@ -0,0 +1,31 @@ + +# W3TC NGINX CONFIGURATION +# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) +set $cache_uri $request_uri; +# POST requests and URL with a query string should always go to php +if ($request_method = POST) { + set $cache_uri 'null cache'; +} +if ($query_string != "") { + set $cache_uri 'null cache'; +} +# Don't cache URL containing the following segments +if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|/feed/|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") { + set $cache_uri 'null cache'; +} +# Don't use the cache for logged in users or recent commenter +if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") { + set $cache_uri 'null cache'; +} +# Use cached or actual file if they exists, Otherwise pass request to WordPress +location / { + try_files /wp-content/cache/page_enhanced/${host}${cache_uri}_index.html $uri $uri/ /index.php?$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 php7; +} From b34eb1de7ec032ae61faf9d38a01799af6c6ad5b Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 9 Feb 2016 14:43:15 +0530 Subject: [PATCH 030/115] created w3fc-php7.conf --- ee/cli/templates/wpfc-php7.mustache | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 ee/cli/templates/wpfc-php7.mustache diff --git a/ee/cli/templates/wpfc-php7.mustache b/ee/cli/templates/wpfc-php7.mustache new file mode 100644 index 00000000..0f3bc4a9 --- /dev/null +++ b/ee/cli/templates/wpfc-php7.mustache @@ -0,0 +1,37 @@ +# WPFC NGINX CONFIGURATION +# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) +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(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") { + set $skip_cache 1; +} +# Don't use the cache for logged in users or recent commenter +if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") { + set $skip_cache 1; +} +# Use cached or actual file if they exists, Otherwise pass request to WordPress +location / { + try_files $uri $uri/ /index.php?$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 php7; + 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; +} From 2c84ec0dbb1317a9b28acba7edee398a3299b899 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 9 Feb 2016 14:43:35 +0530 Subject: [PATCH 031/115] created wpsc-php7.conf --- ee/cli/templates/wpsc-php7.mustache | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 ee/cli/templates/wpsc-php7.mustache diff --git a/ee/cli/templates/wpsc-php7.mustache b/ee/cli/templates/wpsc-php7.mustache new file mode 100644 index 00000000..202c0ad3 --- /dev/null +++ b/ee/cli/templates/wpsc-php7.mustache @@ -0,0 +1,31 @@ +# WPSC NGINX CONFIGURATION +# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) +set $cache_uri $request_uri; +# POST requests and URL with a query string should always go to php +if ($request_method = POST) { + set $cache_uri 'null cache'; +} +if ($query_string != "") { + set $cache_uri 'null cache'; +} +# Don't cache URL containing the following segments +if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|/feed/|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") { + set $cache_uri 'null cache'; +} +# Don't use the cache for logged in users or recent commenter +if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") { + set $cache_uri 'null cache'; +} +# 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 php7; + # Following line is needed by WP Super Cache plugin + fastcgi_param SERVER_NAME $http_host; +} From a424411fb599d387d8c2089048b69e19b71110b1 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 9 Feb 2016 14:45:41 +0530 Subject: [PATCH 032/115] created redis-php7.conf --- ee/cli/templates/redis-php7.mustache | 57 ++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 ee/cli/templates/redis-php7.mustache diff --git a/ee/cli/templates/redis-php7.mustache b/ee/cli/templates/redis-php7.mustache new file mode 100644 index 00000000..cab420c3 --- /dev/null +++ b/ee/cli/templates/redis-php7.mustache @@ -0,0 +1,57 @@ +# Redis NGINX CONFIGURATION +# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) +set $skip_cache 0; +# POST requests and URL with a query string should always go to php +if ($request_method = POST) { + set $skip_cache 0; +} +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(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") { + set $skip_cache 1; +} +# Don't use the cache for logged in users or recent commenter +if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") { + set $skip_cache 1; +} +# Use cached or actual file if they exists, Otherwise pass request to WordPress +location / { + try_files $uri $uri/ /index.php?$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_pass php7; +} From 42a2745a1819e5d5beb51fa4b127d9d5c3380b2b Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 9 Feb 2016 15:57:09 +0530 Subject: [PATCH 033/115] redis-php7.conf added --- ee/cli/templates/redis-php7.mustache | 1 - 1 file changed, 1 deletion(-) diff --git a/ee/cli/templates/redis-php7.mustache b/ee/cli/templates/redis-php7.mustache index cab420c3..1e4a8cd1 100644 --- a/ee/cli/templates/redis-php7.mustache +++ b/ee/cli/templates/redis-php7.mustache @@ -32,7 +32,6 @@ location /redis-store { redis2_query set $key $echo_request_body; redis2_query expire $key 14400; redis2_pass redis; - } location ~ \.php$ { From bbebed827a3008888773b2f26af119e9975c702f Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 9 Feb 2016 15:58:33 +0530 Subject: [PATCH 034/115] added php7 preconfig --- ee/cli/plugins/site_functions.py | 50 ++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index 642e4e97..e74bab40 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -840,6 +840,56 @@ def site_package_check(self, stype): 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.php7: + if EEVariables.ee_platform_codename != 'trusty': + Log.error(self,"PHP 7.0 is not supported in your Platform") + + Log.debug(self, "Setting apt_packages variable for HHVM") + if not EEAptGet.is_installed(self, 'php7-fpm'): + apt_packages = apt_packages + EEVariables.php7 + + if os.path.isdir("/etc/nginx/common") and (not + os.path.isfile("/etc/nginx/common/php7.conf")): + data = dict() + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/php7.conf') + ee_nginx = open('/etc/nginx/common/php7.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'php7.mustache', + out=ee_nginx) + ee_nginx.close() + + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/w3tc-php7.conf') + ee_nginx = open('/etc/nginx/common/w3tc-php7.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'w3tc-php7.mustache', out=ee_nginx) + ee_nginx.close() + + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/wpfc-php7.conf') + ee_nginx = open('/etc/nginx/common/wpfc-php7.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'wpfc-php7.mustache', + out=ee_nginx) + ee_nginx.close() + + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/wpsc-php7.conf') + ee_nginx = open('/etc/nginx/common/wpsc-php7.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'wpsc-php7.mustache', + out=ee_nginx) + ee_nginx.close() + + if os.path.isfile("/etc/nginx/conf.d/upstream.conf"): + if not EEFileUtils.grep(self, "/etc/nginx/conf.d/upstream.conf", + "php7"): + with open("/etc/nginx/conf.d/upstream.conf", "a") as php_file: + php_file.write("upstream php7 {\nserver 127.0.0.1:9070;\n}\n" + "upstream debug7 {\nserver 127.0.0.1:9170;\n}\n") + + # Check if Nginx is allready installed and Pagespeed config there or not # If not then copy pagespeed config if self.app.pargs.pagespeed: From dfea52d34c02aa7f5f373ec7ae61f762d0ab3cc0 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 9 Feb 2016 16:48:30 +0530 Subject: [PATCH 035/115] update site.py --- ee/cli/plugins/site.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 49197307..e51efa46 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -445,13 +445,16 @@ class EESiteCreateController(CementBaseController): if stype in ['html', 'php' ] or self.app.pargs.php7: data = dict(site_name=ee_domain, www_domain=ee_www_domain, - static=True, basic=False, wp=False, w3tc=False, + static=True, basic=False, php7=False, wp=False, w3tc=False, wpfc=False, wpsc=False, multisite=False, wpsubdir=False, webroot=ee_site_webroot) - if stype == 'php' or self.app.pargs.php7: + if stype == 'php': data['static'] = False data['basic'] = True + if self.app.pargs.php7: + data['static'] = False + data['php7'] = True elif stype in ['mysql', 'wp', 'wpsubdir', 'wpsubdomain']: From 6977e0cbb99a50190e1e2d3887bcff6f7cdad760 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 9 Feb 2016 16:55:29 +0530 Subject: [PATCH 036/115] update site_function with php7.0-fpm --- ee/cli/plugins/site_functions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index e74bab40..73add8fb 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -714,7 +714,7 @@ def site_package_check(self, stype): if self.app.pargs.php7 and stype in [ 'mysql', 'wp', 'wpsubdir', 'wpsubdomain']: if EEVariables.ee_platform_codename == 'trusty': Log.debug(self, "Setting apt_packages variable for PHP 7.0") - if not EEAptGet.is_installed(self, 'php7-fpm'): + if not EEAptGet.is_installed(self, 'php7.0-fpm'): apt_packages = apt_packages + EEVariables.ee_php7_0 else: Log.warn(self, "PHP 7.0 not available for your system.") @@ -845,7 +845,7 @@ def site_package_check(self, stype): Log.error(self,"PHP 7.0 is not supported in your Platform") Log.debug(self, "Setting apt_packages variable for HHVM") - if not EEAptGet.is_installed(self, 'php7-fpm'): + if not EEAptGet.is_installed(self, 'php7.0-fpm'): apt_packages = apt_packages + EEVariables.php7 if os.path.isdir("/etc/nginx/common") and (not From b7b376078a227c0bd3d4e9b0614cd1128a05da0a Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 9 Feb 2016 16:55:59 +0530 Subject: [PATCH 037/115] stack.py virtualconf --- ee/cli/plugins/stack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index e4d0cb74..d9f36717 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -299,7 +299,7 @@ class EEStackController(CementBaseController): ee_nginx.close() data = dict(php="9000", debug="9001", hhvm="8000",php7="9070",debug7="9170", - hhvmconf=False) + hhvmconf=False, php7conf= True if EEAptGet.is_installed(self,'php7.0-fpm') else False ) Log.debug(self, 'Writting the nginx configuration to ' 'file /etc/nginx/conf.d/upstream.conf') ee_nginx = open('/etc/nginx/conf.d/upstream.conf', From 69a31a985d1add48a1816eba90e028882a70811b Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 9 Feb 2016 16:56:19 +0530 Subject: [PATCH 038/115] update upstream.conf --- ee/cli/templates/upstream.mustache | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ee/cli/templates/upstream.mustache b/ee/cli/templates/upstream.mustache index 74c2bb64..0cd2ae3b 100644 --- a/ee/cli/templates/upstream.mustache +++ b/ee/cli/templates/upstream.mustache @@ -7,6 +7,7 @@ upstream debug { # Debug Pool server 127.0.0.1:{{debug}}; } +{{#php7conf}} upstream php7 { # server unix:/run/php5-fpm.sock; server 127.0.0.1:{{php7}}; @@ -15,6 +16,7 @@ upstream debug7 { # Debug Pool server 127.0.0.1:{{debug7}}; } +{{/php7conf}} {{#hhvmconf}} upstream hhvm { # HHVM Pool From 697faba0d1e6702797270f7435edabe000e1d8e5 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 9 Feb 2016 16:56:40 +0530 Subject: [PATCH 039/115] update virtualconf --- ee/cli/templates/virtualconf.mustache | 1 + 1 file changed, 1 insertion(+) diff --git a/ee/cli/templates/virtualconf.mustache b/ee/cli/templates/virtualconf.mustache index 8f9b4746..c661070a 100644 --- a/ee/cli/templates/virtualconf.mustache +++ b/ee/cli/templates/virtualconf.mustache @@ -41,6 +41,7 @@ server { {{/static}} {{^static}}include {{^hhvm}}{{#basic}}common/php.conf;{{/basic}}{{#w3tc}}common/w3tc.conf;{{/w3tc}}{{#wpfc}}common/wpfc.conf;{{/wpfc}} {{#wpsc}}common/wpsc.conf;{{/wpsc}}{{#wpredis}}common/redis.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}} + {{^static}}include {{^hhvm}}{{#php7}}common/php7.conf;{{/php7}}{{#w3tc}}common/w3tc-php7.conf;{{/w3tc}}{{#wpfc}}common/wpfc-php7.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php7.conf;{{/wpsc}}{{#wpredis}}common/redis-php7.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#php7}}common/php7-hhvm.conf;{{/php7}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}} {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}} {{#wp}}include common/wpcommon.conf;{{/wp}} {{^proxy}}include common/locations.conf;{{/proxy}} From 8523be5c5bdb0217b082e4673126fc2807162994 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 9 Feb 2016 18:54:32 +0530 Subject: [PATCH 040/115] Fix site nginx error --- ee/cli/plugins/site.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index e51efa46..d1f60905 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -443,7 +443,7 @@ class EESiteCreateController(CementBaseController): data['port'] = port ee_site_webroot = "" - if stype in ['html', 'php' ] or self.app.pargs.php7: + if stype in ['html', 'php' ]: data = dict(site_name=ee_domain, www_domain=ee_www_domain, static=True, basic=False, php7=False, wp=False, w3tc=False, wpfc=False, wpsc=False, multisite=False, @@ -452,9 +452,6 @@ class EESiteCreateController(CementBaseController): if stype == 'php': data['static'] = False data['basic'] = True - if self.app.pargs.php7: - data['static'] = False - data['php7'] = True elif stype in ['mysql', 'wp', 'wpsubdir', 'wpsubdomain']: From 1b9db554a2e5d3281e8ddbba186ac089e98568ee Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 9 Feb 2016 20:36:38 +0530 Subject: [PATCH 041/115] php7 --- ee/cli/plugins/site.py | 1 + ee/cli/plugins/stack.py | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index d1f60905..7021d424 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -490,6 +490,7 @@ class EESiteCreateController(CementBaseController): if check_prompt != "Y" and check_prompt != "y": Log.info(self, "Not using PHP 7.0 for site.") data['php7'] = False + data['basic'] = True php7 = 0 self.app.pargs.php7 = False else: diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index d9f36717..1aa1988d 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -394,8 +394,6 @@ class EEStackController(CementBaseController): '/etc/nginx/sites-available') os.makedirs('/etc/nginx/sites-enabled') - - # 22222 port settings Log.debug(self, 'Writting the nginx configuration to ' 'file /etc/nginx/sites-available/' From 9af9312fb3319489516b7931c16dfacedd0bd16a Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 10 Feb 2016 13:07:54 +0530 Subject: [PATCH 042/115] Fix virtualconf for pecise --- ee/cli/templates/virtualconf.mustache | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ee/cli/templates/virtualconf.mustache b/ee/cli/templates/virtualconf.mustache index c661070a..a4a8b39f 100644 --- a/ee/cli/templates/virtualconf.mustache +++ b/ee/cli/templates/virtualconf.mustache @@ -40,8 +40,7 @@ server { } {{/static}} - {{^static}}include {{^hhvm}}{{#basic}}common/php.conf;{{/basic}}{{#w3tc}}common/w3tc.conf;{{/w3tc}}{{#wpfc}}common/wpfc.conf;{{/wpfc}} {{#wpsc}}common/wpsc.conf;{{/wpsc}}{{#wpredis}}common/redis.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}} - {{^static}}include {{^hhvm}}{{#php7}}common/php7.conf;{{/php7}}{{#w3tc}}common/w3tc-php7.conf;{{/w3tc}}{{#wpfc}}common/wpfc-php7.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php7.conf;{{/wpsc}}{{#wpredis}}common/redis-php7.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#php7}}common/php7-hhvm.conf;{{/php7}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}} + {{^static}} include {{^php7}}{{^hhvm}}{{#basic}}common/php.conf;{{/basic}}{{#w3tc}}common/w3tc.conf;{{/w3tc}}{{#wpfc}}common/wpfc.conf;{{/wpfc}} {{#wpsc}}common/wpsc.conf;{{/wpsc}}{{#wpredis}}common/redis.conf;{{/wpredis}} {{/hhvm}}{{/php7}}{{^php7}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}}{{/php7}} {{^basic}}{{^hhvm}}{{#php7}}common/php7.conf;{{/php7}}{{#w3tc}}common/w3tc-php7.conf;{{/w3tc}}{{#wpfc}}common/wpfc-php7.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php7.conf;{{/wpsc}}{{#wpredis}}common/redis-php7.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#php7}}common/php7-hhvm.conf;{{/php7}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}}{{/basic}} {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}} {{#wp}}include common/wpcommon.conf;{{/wp}} {{^proxy}}include common/locations.conf;{{/proxy}} From 19f95422e0e6f61713fa1851c020c1e7c50d0332 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 10 Feb 2016 14:00:24 +0530 Subject: [PATCH 043/115] Fix virtualconf for pecise --- ee/cli/templates/virtualconf.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/cli/templates/virtualconf.mustache b/ee/cli/templates/virtualconf.mustache index a4a8b39f..ce312161 100644 --- a/ee/cli/templates/virtualconf.mustache +++ b/ee/cli/templates/virtualconf.mustache @@ -40,7 +40,7 @@ server { } {{/static}} - {{^static}} include {{^php7}}{{^hhvm}}{{#basic}}common/php.conf;{{/basic}}{{#w3tc}}common/w3tc.conf;{{/w3tc}}{{#wpfc}}common/wpfc.conf;{{/wpfc}} {{#wpsc}}common/wpsc.conf;{{/wpsc}}{{#wpredis}}common/redis.conf;{{/wpredis}} {{/hhvm}}{{/php7}}{{^php7}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}}{{/php7}} {{^basic}}{{^hhvm}}{{#php7}}common/php7.conf;{{/php7}}{{#w3tc}}common/w3tc-php7.conf;{{/w3tc}}{{#wpfc}}common/wpfc-php7.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php7.conf;{{/wpsc}}{{#wpredis}}common/redis-php7.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#php7}}common/php7-hhvm.conf;{{/php7}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}}{{/basic}} + {{^static}} include {{^php7}}{{^hhvm}}{{#basic}}common/php.conf;{{/basic}}{{#w3tc}}common/w3tc.conf;{{/w3tc}}{{#wpfc}}common/wpfc.conf;{{/wpfc}} {{#wpsc}}common/wpsc.conf;{{/wpsc}}{{#wpredis}}common/redis.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}}{{/php7}} {{#php7}}{{^hhvm}}{{#php7}}common/php7.conf;{{/php7}}{{#w3tc}}common/w3tc-php7.conf;{{/w3tc}}{{#wpfc}}common/wpfc-php7.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php7.conf;{{/wpsc}}{{#wpredis}}common/redis-php7.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#php7}}common/php7-hhvm.conf;{{/php7}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}}{{/php7}} {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}} {{#wp}}include common/wpcommon.conf;{{/wp}} {{^proxy}}include common/locations.conf;{{/proxy}} From e3f9a0ae366ac52330458813721c57d403ab5161 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 10 Feb 2016 14:24:06 +0530 Subject: [PATCH 044/115] Fix HHVM config error with php7 --- ee/cli/templates/virtualconf.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/cli/templates/virtualconf.mustache b/ee/cli/templates/virtualconf.mustache index ce312161..d2e2ff17 100644 --- a/ee/cli/templates/virtualconf.mustache +++ b/ee/cli/templates/virtualconf.mustache @@ -40,7 +40,7 @@ server { } {{/static}} - {{^static}} include {{^php7}}{{^hhvm}}{{#basic}}common/php.conf;{{/basic}}{{#w3tc}}common/w3tc.conf;{{/w3tc}}{{#wpfc}}common/wpfc.conf;{{/wpfc}} {{#wpsc}}common/wpsc.conf;{{/wpsc}}{{#wpredis}}common/redis.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}}{{/php7}} {{#php7}}{{^hhvm}}{{#php7}}common/php7.conf;{{/php7}}{{#w3tc}}common/w3tc-php7.conf;{{/w3tc}}{{#wpfc}}common/wpfc-php7.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php7.conf;{{/wpsc}}{{#wpredis}}common/redis-php7.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#php7}}common/php7-hhvm.conf;{{/php7}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}}{{/php7}} + {{^static}} include {{^php7}}{{^hhvm}}{{#basic}}common/php.conf;{{/basic}}{{#w3tc}}common/w3tc.conf;{{/w3tc}}{{#wpfc}}common/wpfc.conf;{{/wpfc}} {{#wpsc}}common/wpsc.conf;{{/wpsc}}{{#wpredis}}common/redis.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}}{{/php7}} {{#php7}}{{^hhvm}}{{#php7}}common/php7.conf;{{/php7}}{{#w3tc}}common/w3tc-php7.conf;{{/w3tc}}{{#wpfc}}common/wpfc-php7.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php7.conf;{{/wpsc}}{{#wpredis}}common/redis-php7.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}}{{/php7}} {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}} {{#wp}}include common/wpcommon.conf;{{/wp}} {{^proxy}}include common/locations.conf;{{/proxy}} From a439d095b9ff1cc726077dc52f4f1211fd6876ba Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 10 Feb 2016 14:40:34 +0530 Subject: [PATCH 045/115] redis-php7.conf while redis installation --- ee/cli/plugins/site_functions.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index 73add8fb..1266d10b 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -762,6 +762,18 @@ def site_package_check(self, stype): out=ee_nginx) ee_nginx.close() + if EEVariables.ee_platform_codename == 'trusty': + if os.path.isfile("/etc/nginx/nginx.conf") and (not + os.path.isfile("/etc/nginx/common/redis-php7.conf")): + data = dict() + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/redis-php7.conf') + ee_nginx = open('/etc/nginx/common/redis-php7.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'redis-php7.mustache', + out=ee_nginx) + ee_nginx.close() + if os.path.isfile("/etc/nginx/nginx.conf") and (not os.path.isfile("/etc/nginx/common/redis-hhvm.conf")): From 872b917a3e256e2597e0996bbdef8e91c94a630c Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 10 Feb 2016 14:48:12 +0530 Subject: [PATCH 046/115] redis-php7.conf while php7 installation --- ee/cli/plugins/site_functions.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index 1266d10b..82b45554 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -762,18 +762,6 @@ def site_package_check(self, stype): out=ee_nginx) ee_nginx.close() - if EEVariables.ee_platform_codename == 'trusty': - if os.path.isfile("/etc/nginx/nginx.conf") and (not - os.path.isfile("/etc/nginx/common/redis-php7.conf")): - data = dict() - Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/redis-php7.conf') - ee_nginx = open('/etc/nginx/common/redis-php7.conf', - encoding='utf-8', mode='w') - self.app.render((data), 'redis-php7.mustache', - out=ee_nginx) - ee_nginx.close() - if os.path.isfile("/etc/nginx/nginx.conf") and (not os.path.isfile("/etc/nginx/common/redis-hhvm.conf")): @@ -894,6 +882,17 @@ def site_package_check(self, stype): out=ee_nginx) ee_nginx.close() + if os.path.isfile("/etc/nginx/nginx.conf") and (not + os.path.isfile("/etc/nginx/common/redis-php7.conf")): + data = dict() + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/redis-php7.conf') + ee_nginx = open('/etc/nginx/common/redis-php7.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'redis-php7.mustache', + out=ee_nginx) + ee_nginx.close() + if os.path.isfile("/etc/nginx/conf.d/upstream.conf"): if not EEFileUtils.grep(self, "/etc/nginx/conf.d/upstream.conf", "php7"): From 99cc822a4a8e18ac48f37361b7f765575f539a9b Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 10 Feb 2016 15:31:44 +0530 Subject: [PATCH 047/115] php7 configuration added in stack --- ee/cli/plugins/stack.py | 65 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 1aa1988d..7f66460c 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -550,6 +550,19 @@ class EEStackController(CementBaseController): out=ee_nginx) ee_nginx.close() + if EEVariables.ee_platform_codename == 'trusty': + if os.path.isfile("/etc/nginx/nginx.conf") and (not + os.path.isfile("/etc/nginx/common/redis-php7.conf")): + + data = dict() + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/redis-php7.conf') + ee_nginx = open('/etc/nginx/common/redis-php7.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'redis-php7.mustache', + out=ee_nginx) + ee_nginx.close() + if os.path.isfile("/etc/nginx/conf.d/upstream.conf"): if not EEFileUtils.grep(self, "/etc/nginx/conf.d/" "upstream.conf", @@ -567,6 +580,58 @@ class EEStackController(CementBaseController): "log_format rt_cache_redis '$remote_addr $upstream_response_time $srcache_fetch_status [$time_local] '\n" "'$http_host \"$request\" $status $body_bytes_sent '\n" "'\"$http_referer\" \"$http_user_agent\"';\n") + #setup nginx common folder for php7 + if self.app.pargs.php7: + if os.path.isdir("/etc/nginx/common") and (not + os.path.isfile("/etc/nginx/common/php7.conf")): + data = dict() + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/php7.conf') + ee_nginx = open('/etc/nginx/common/php7.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'php7.mustache', + out=ee_nginx) + ee_nginx.close() + + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/w3tc-php7.conf') + ee_nginx = open('/etc/nginx/common/w3tc-php7.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'w3tc-php7.mustache', out=ee_nginx) + ee_nginx.close() + + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/wpfc-php7.conf') + ee_nginx = open('/etc/nginx/common/wpfc-php7.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'wpfc-php7.mustache', + out=ee_nginx) + ee_nginx.close() + + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/wpsc-php7.conf') + ee_nginx = open('/etc/nginx/common/wpsc-php7.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'wpsc-php7.mustache', + out=ee_nginx) + ee_nginx.close() + + if not os.path.isfile("/etc/nginx/common/redis-php7.conf"): + data = dict() + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/redis-php7.conf') + ee_nginx = open('/etc/nginx/common/redis-php7.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'redis-php7.mustache', + out=ee_nginx) + ee_nginx.close() + + if os.path.isfile("/etc/nginx/conf.d/upstream.conf"): + if not EEFileUtils.grep(self, "/etc/nginx/conf.d/upstream.conf", + "php7"): + with open("/etc/nginx/conf.d/upstream.conf", "a") as php_file: + php_file.write("upstream php7 {\nserver 127.0.0.1:9070;\n}\n" + "upstream debug7 {\nserver 127.0.0.1:9170;\n}\n") # Set up pagespeed config if self.app.pargs.pagespeed: From dc1202f1c6041c242fb24265fc390d26c1f295d6 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 10 Feb 2016 15:55:51 +0530 Subject: [PATCH 048/115] php7 configuration added in stack --- ee/cli/plugins/stack.py | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 7f66460c..3d636187 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -379,6 +379,42 @@ class EEStackController(CementBaseController): out=ee_nginx) ee_nginx.close() + #php7 conf + if EEVariables.ee_platform_codename == 'trusty' and (not + os.path.isfile("/etc/nginx/common/php7.conf")): + data = dict() + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/php7.conf') + ee_nginx = open('/etc/nginx/common/php7.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'php7.mustache', + out=ee_nginx) + ee_nginx.close() + + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/w3tc-php7.conf') + ee_nginx = open('/etc/nginx/common/w3tc-php7.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'w3tc-php7.mustache', out=ee_nginx) + ee_nginx.close() + + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/wpfc-php7.conf') + ee_nginx = open('/etc/nginx/common/wpfc-php7.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'wpfc-php7.mustache', + out=ee_nginx) + ee_nginx.close() + + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/wpsc-php7.conf') + ee_nginx = open('/etc/nginx/common/wpsc-php7.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'wpsc-php7.mustache', + out=ee_nginx) + ee_nginx.close() + + # Nginx-Plus does not have nginx package structure like this # So creating directories if set(["nginx-plus"]).issubset(set(apt_packages)): @@ -616,7 +652,7 @@ class EEStackController(CementBaseController): out=ee_nginx) ee_nginx.close() - if not os.path.isfile("/etc/nginx/common/redis-php7.conf"): + if os.path.isdir("/etc/nginx/common") and (not os.path.isfile("/etc/nginx/common/redis-php7.conf")): data = dict() Log.debug(self, 'Writting the nginx configuration to ' 'file /etc/nginx/common/redis-php7.conf') From e7d7bc05c716f5f9245a1e3132860d9dc91dc812 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 10 Feb 2016 17:54:12 +0530 Subject: [PATCH 049/115] fix try php7 with other cache option --- ee/cli/plugins/site.py | 6 ++++++ ee/cli/plugins/stack.py | 8 +++++++- ee/cli/templates/virtualconf.mustache | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 7021d424..9d0e3c08 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -503,6 +503,12 @@ class EESiteCreateController(CementBaseController): data['php7'] = False php7 = 0 + if (self.app.pargs.php7) and (not self.app.pargs.w3tc) and\ + (not self.app.pargs.wpfc) and (not self.app.pargs.wpsc) and (not self.app.pargs.wpredis) \ + and (not self.app.pargs.hhvm): + 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 " diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 3d636187..1c08c4f4 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -414,6 +414,13 @@ class EEStackController(CementBaseController): out=ee_nginx) ee_nginx.close() + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/redis-php7.conf') + ee_nginx = open('/etc/nginx/common/redis-php7.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'redis-php7.mustache', + out=ee_nginx) + ee_nginx.close() # Nginx-Plus does not have nginx package structure like this # So creating directories @@ -589,7 +596,6 @@ class EEStackController(CementBaseController): if EEVariables.ee_platform_codename == 'trusty': if os.path.isfile("/etc/nginx/nginx.conf") and (not os.path.isfile("/etc/nginx/common/redis-php7.conf")): - data = dict() Log.debug(self, 'Writting the nginx configuration to ' 'file /etc/nginx/common/redis-php7.conf') diff --git a/ee/cli/templates/virtualconf.mustache b/ee/cli/templates/virtualconf.mustache index d2e2ff17..853fb79e 100644 --- a/ee/cli/templates/virtualconf.mustache +++ b/ee/cli/templates/virtualconf.mustache @@ -40,7 +40,7 @@ server { } {{/static}} - {{^static}} include {{^php7}}{{^hhvm}}{{#basic}}common/php.conf;{{/basic}}{{#w3tc}}common/w3tc.conf;{{/w3tc}}{{#wpfc}}common/wpfc.conf;{{/wpfc}} {{#wpsc}}common/wpsc.conf;{{/wpsc}}{{#wpredis}}common/redis.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}}{{/php7}} {{#php7}}{{^hhvm}}{{#php7}}common/php7.conf;{{/php7}}{{#w3tc}}common/w3tc-php7.conf;{{/w3tc}}{{#wpfc}}common/wpfc-php7.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php7.conf;{{/wpsc}}{{#wpredis}}common/redis-php7.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}}{{/php7}} + {{^static}}include {{^php7}}{{^hhvm}}{{#basic}}common/php.conf;{{/basic}}{{#w3tc}}common/w3tc.conf;{{/w3tc}}{{#wpfc}}common/wpfc.conf;{{/wpfc}} {{#wpsc}}common/wpsc.conf;{{/wpsc}}{{#wpredis}}common/redis.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}}{{/php7}} {{#php7}}{{^hhvm}}{{#basic}}common/php7.conf;{{/basic}}{{#w3tc}}common/w3tc-php7.conf;{{/w3tc}}{{#wpfc}}common/wpfc-php7.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php7.conf;{{/wpsc}}{{#wpredis}}common/redis-php7.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}}{{/php7}} {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}} {{#wp}}include common/wpcommon.conf;{{/wp}} {{^proxy}}include common/locations.conf;{{/proxy}} From d551502f9e2072658fc6ab4e28dba5f842cbb54e Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 10 Feb 2016 18:52:58 +0530 Subject: [PATCH 050/115] Fix EEvariable php7 issue --- ee/cli/plugins/site_functions.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index 82b45554..377e3bb1 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -846,7 +846,7 @@ def site_package_check(self, stype): Log.debug(self, "Setting apt_packages variable for HHVM") if not EEAptGet.is_installed(self, 'php7.0-fpm'): - apt_packages = apt_packages + EEVariables.php7 + apt_packages = apt_packages + EEVariables.ee_php7_0 if os.path.isdir("/etc/nginx/common") and (not os.path.isfile("/etc/nginx/common/php7.conf")): @@ -1460,7 +1460,3 @@ def archivedCertificateHandle(self,domain,ee_wp_email): .format(domain)) return ssl - - - - From 7b43363ad30f3f0bbd2b2fd3376a0006f3633421 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 10 Feb 2016 20:20:55 +0530 Subject: [PATCH 051/115] Fix typo --- ee/cli/plugins/site_functions.py | 2 +- ee/cli/templates/upstream.mustache | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index 377e3bb1..b918e496 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -844,7 +844,7 @@ def site_package_check(self, stype): if EEVariables.ee_platform_codename != 'trusty': Log.error(self,"PHP 7.0 is not supported in your Platform") - Log.debug(self, "Setting apt_packages variable for HHVM") + Log.debug(self, "Setting apt_packages variable for PHP 7.0") if not EEAptGet.is_installed(self, 'php7.0-fpm'): apt_packages = apt_packages + EEVariables.ee_php7_0 diff --git a/ee/cli/templates/upstream.mustache b/ee/cli/templates/upstream.mustache index 0cd2ae3b..473fd1bc 100644 --- a/ee/cli/templates/upstream.mustache +++ b/ee/cli/templates/upstream.mustache @@ -9,7 +9,6 @@ server 127.0.0.1:{{debug}}; } {{#php7conf}} upstream php7 { -# server unix:/run/php5-fpm.sock; server 127.0.0.1:{{php7}}; } upstream debug7 { @@ -17,6 +16,7 @@ upstream debug7 { server 127.0.0.1:{{debug7}}; } {{/php7conf}} + {{#hhvmconf}} upstream hhvm { # HHVM Pool From 04cf6a1baefec4301d46010d40b1022051a6580d Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 15 Feb 2016 18:44:31 +0530 Subject: [PATCH 052/115] php7 in upgrade --- ee/cli/plugins/site.py | 41 +++++++++++++++++++++++++++++++++++++--- ee/cli/plugins/sitedb.py | 9 ++++++--- 2 files changed, 44 insertions(+), 6 deletions(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 9d0e3c08..1e55f549 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -832,7 +832,7 @@ class EESiteUpdateController(CementBaseController): (['--php'], dict(help="update to php site", action='store_true')), (['--php7'], - dict(help="update to php site", action='store_true')), + dict(help="update to php7 site", action='store_true')), (['--mysql'], dict(help="update to mysql site", action='store_true')), (['--wp'], @@ -957,9 +957,10 @@ class EESiteUpdateController(CementBaseController): old_hhvm = check_site.is_hhvm old_pagespeed = check_site.is_pagespeed check_ssl = check_site.is_ssl + check_php_version = check_site.php_version if (pargs.password and not (pargs.html or - pargs.php or pargs.mysql or pargs.wp or + pargs.php or pargs.php7 or pargs.mysql or pargs.wp or pargs.w3tc or pargs.wpfc or pargs.wpsc or pargs.wpsubdir or pargs.wpsubdomain)): try: @@ -1030,7 +1031,7 @@ class EESiteUpdateController(CementBaseController): if stype == 'wpsubdir': data['wpsubdir'] = True - if pargs.pagespeed or pargs.hhvm: + if pargs.pagespeed or pargs.hhvm or pargs.php7: if not data: data = dict(site_name=ee_domain, www_domain=ee_www_domain, currsitetype=oldsitetype, @@ -1110,6 +1111,14 @@ class EESiteUpdateController(CementBaseController): data['pagespeed'] = False pagespeed = False + if pargs.php7 != 'off': + data['php7'] = True + php7 = True + elif pargs.php7 == 'off': + data['php7'] = False + php7 = False + + if pargs.pagespeed: if pagespeed is old_pagespeed: @@ -1121,6 +1130,32 @@ class EESiteUpdateController(CementBaseController): "site") pargs.pagespeed = False + + + if pargs.php7: + old_php7 = None + if check_php_version == "7.0": + old_php7 == True + else: + old_php7 == False + + if php7 is old_php7: + if php7 is False: + Log.info(self, "PHP 7.0 is already disabled for given " + "site") + elif pagespeed is True: + Log.info(self, "PHP 7.0 is already enabled for given " + "site") + pargs.php7 = False + + if data and (not pargs.pagespeed): + if old_php7 is True: + data['php7'] = True + php7 = True + else: + data['php7'] = False + php7 = False + #--letsencrypt=renew code goes here if pargs.letsencrypt == "renew" and not pargs.all: expiry_days = SSL.getExpirationDays(self,ee_domain) diff --git a/ee/cli/plugins/sitedb.py b/ee/cli/plugins/sitedb.py index 4fc3fd35..67cd84d3 100644 --- a/ee/cli/plugins/sitedb.py +++ b/ee/cli/plugins/sitedb.py @@ -12,14 +12,14 @@ import glob def addNewSite(self, site, stype, cache, path, enabled=True, ssl=False, fs='ext4', db='mysql', db_name=None, db_user=None, db_password=None, - db_host='localhost', hhvm=0, pagespeed=0): + db_host='localhost', hhvm=0, pagespeed=0, php_version=''): """ Add New Site record information into ee database. """ try: newRec = SiteDB(site, stype, cache, path, enabled, ssl, fs, db, db_name, db_user, db_password, db_host, hhvm, - pagespeed) + pagespeed,php_version) db_session.add(newRec) db_session.commit() except Exception as e: @@ -42,7 +42,7 @@ def getSiteInfo(self, site): def updateSiteInfo(self, site, stype='', cache='', webroot='', enabled=True, ssl=False, fs='', db='', db_name=None, db_user=None, db_password=None, db_host=None, hhvm=None, - pagespeed=None): + pagespeed=None,php_version=''): """updates site record in database""" try: q = SiteDB.query.filter(SiteDB.sitename == site).first() @@ -87,6 +87,9 @@ def updateSiteInfo(self, site, stype='', cache='', webroot='', if (pagespeed is not None) and (q.is_pagespeed is not pagespeed): q.is_pagespeed = pagespeed + if php_version and q.php_version != php_version: + q.is_php7 = php_version + try: q.created_on = func.now() db_session.commit() From ceced1d37ba746cf8881dd8b4321cc72c83e1b6c Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 15 Feb 2016 19:27:44 +0530 Subject: [PATCH 053/115] Fix for travis build --- ee/cli/plugins/sitedb.py | 2 +- ee/cli/plugins/stack.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ee/cli/plugins/sitedb.py b/ee/cli/plugins/sitedb.py index 67cd84d3..eb5074d4 100644 --- a/ee/cli/plugins/sitedb.py +++ b/ee/cli/plugins/sitedb.py @@ -42,7 +42,7 @@ def getSiteInfo(self, site): def updateSiteInfo(self, site, stype='', cache='', webroot='', enabled=True, ssl=False, fs='', db='', db_name=None, db_user=None, db_password=None, db_host=None, hhvm=None, - pagespeed=None,php_version=''): + pagespeed=None,php_version='5.5'): """updates site record in database""" try: q = SiteDB.query.filter(SiteDB.sitename == site).first() diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 1c08c4f4..9bfb3e9c 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -382,7 +382,7 @@ class EEStackController(CementBaseController): #php7 conf if EEVariables.ee_platform_codename == 'trusty' and (not os.path.isfile("/etc/nginx/common/php7.conf")): - data = dict() + #data = dict() Log.debug(self, 'Writting the nginx configuration to ' 'file /etc/nginx/common/php7.conf') ee_nginx = open('/etc/nginx/common/php7.conf', From 3d71f5fa07533c19835f2eb8da53c38330a2ab6e Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 15 Feb 2016 20:12:37 +0530 Subject: [PATCH 054/115] fix travis build --- ee/cli/plugins/sitedb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/cli/plugins/sitedb.py b/ee/cli/plugins/sitedb.py index eb5074d4..692c9493 100644 --- a/ee/cli/plugins/sitedb.py +++ b/ee/cli/plugins/sitedb.py @@ -12,7 +12,7 @@ import glob def addNewSite(self, site, stype, cache, path, enabled=True, ssl=False, fs='ext4', db='mysql', db_name=None, db_user=None, db_password=None, - db_host='localhost', hhvm=0, pagespeed=0, php_version=''): + db_host='localhost', hhvm=0, pagespeed=0, php_version='5.5'): """ Add New Site record information into ee database. """ From ef5f283dfd858edd73ae558b1a8c6cc107200acf Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 16 Feb 2016 11:45:44 +0530 Subject: [PATCH 055/115] Fix sqlite query for php_version --- ee/cli/plugins/sitedb.py | 4 ++-- install | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ee/cli/plugins/sitedb.py b/ee/cli/plugins/sitedb.py index 692c9493..ab805579 100644 --- a/ee/cli/plugins/sitedb.py +++ b/ee/cli/plugins/sitedb.py @@ -19,7 +19,7 @@ def addNewSite(self, site, stype, cache, path, try: newRec = SiteDB(site, stype, cache, path, enabled, ssl, fs, db, db_name, db_user, db_password, db_host, hhvm, - pagespeed,php_version) + pagespeed, php_version) db_session.add(newRec) db_session.commit() except Exception as e: @@ -42,7 +42,7 @@ def getSiteInfo(self, site): def updateSiteInfo(self, site, stype='', cache='', webroot='', enabled=True, ssl=False, fs='', db='', db_name=None, db_user=None, db_password=None, db_host=None, hhvm=None, - pagespeed=None,php_version='5.5'): + pagespeed=None, php_version='5.5'): """updates site record in database""" try: q = SiteDB.query.filter(SiteDB.sitename == site).first() diff --git a/install b/install index 95194a5e..ec6bb121 100644 --- a/install +++ b/install @@ -121,7 +121,8 @@ function ee_sync_db() db_password VARCHAR, db_host VARCHAR, is_hhvm INT INT DEFAULT '0', - is_pagespeed INT INT DEFAULT '0' + is_pagespeed INT INT DEFAULT '0', + php_version VARCHAR );" | sqlite3 /var/lib/ee/ee.db # Check site is enable/live or disable @@ -213,6 +214,7 @@ function ee_sync_db() echo "ALTER TABLE sites ADD COLUMN db_host varchar;" | sqlite3 /var/lib/ee/ee.db echo "ALTER TABLE sites ADD COLUMN is_hhvm INT DEFAULT '0';" | sqlite3 /var/lib/ee/ee.db echo "ALTER TABLE sites ADD COLUMN is_pagespeed INT DEFAULT '0';" | sqlite3 /var/lib/ee/ee.db + echo "ALTER TABLE sites ADD COLUMN php_version varchar DEFAULT '5.5';" | sqlite3 /var/lib/ee/ee.db fi } From 8391766d3f6c96125e0ddf74911538eb247a9559 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 16 Feb 2016 12:28:59 +0530 Subject: [PATCH 056/115] update php_version in model.py --- ee/cli/plugins/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ee/cli/plugins/models.py b/ee/cli/plugins/models.py index 0593210b..0aa3ff9b 100644 --- a/ee/cli/plugins/models.py +++ b/ee/cli/plugins/models.py @@ -30,12 +30,13 @@ class SiteDB(Base): db_host = Column(String) is_hhvm = Column(Boolean, unique=False, default=False) is_pagespeed = Column(Boolean, unique=False, default=False) + php_version = Column(String) def __init__(self, sitename=None, site_type=None, cache_type=None, site_path=None, site_enabled=None, is_ssl=None, storage_fs=None, storage_db=None, db_name=None, db_user=None, db_password=None, db_host='localhost', - hhvm=None, pagespeed=None): + hhvm=None, pagespeed=None, php_version=None): self.sitename = sitename self.site_type = site_type self.cache_type = cache_type @@ -50,6 +51,7 @@ class SiteDB(Base): self.db_host = db_host self.is_hhvm = hhvm self.is_pagespeed = pagespeed + self.php_version = php_version # def __repr__(self): # return '' % (self.site_type) # From 5f772d0248e1cc7b71dc521bf118ee756d24b6c0 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 17 Feb 2016 14:23:55 +0530 Subject: [PATCH 057/115] php7 default value error fix --- ee/cli/plugins/site.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 1e55f549..fcdebc1d 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -832,7 +832,9 @@ class EESiteUpdateController(CementBaseController): (['--php'], dict(help="update to php site", action='store_true')), (['--php7'], - dict(help="update to php7 site", action='store_true')), + dict(help="update to php7 site", + action='store' or 'store_const', + choices=('on', 'off'), const='on', nargs='?')), (['--mysql'], dict(help="update to mysql site", action='store_true')), (['--wp'], @@ -1111,7 +1113,7 @@ class EESiteUpdateController(CementBaseController): data['pagespeed'] = False pagespeed = False - if pargs.php7 != 'off': + if pargs.php7 or pargs.php7 == 'on' : data['php7'] = True php7 = True elif pargs.php7 == 'off': @@ -1148,7 +1150,7 @@ class EESiteUpdateController(CementBaseController): "site") pargs.php7 = False - if data and (not pargs.pagespeed): + if data and (not pargs.php7): if old_php7 is True: data['php7'] = True php7 = True From 6a0031ba92ba800c274959a75d5e443980e10547 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 17 Feb 2016 15:39:44 +0530 Subject: [PATCH 058/115] Fix db --- ee/cli/plugins/site.py | 10 +++++++++- ee/cli/plugins/site_functions.py | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index fcdebc1d..55ad93ad 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -625,8 +625,16 @@ class EESiteCreateController(CementBaseController): if self.app.pargs.pagespeed: operateOnPagespeed(self, data) + if data['php7']: + php_version = "7.0" + else: + if EEVariables.ee_platform_codename == 'trusty': + php_version = "5.6" + else: + php_version = "5.5" + addNewSite(self, ee_domain, stype, cache, ee_site_webroot, - hhvm=hhvm, pagespeed=pagespeed) + hhvm=hhvm, pagespeed=pagespeed, php_version=php_version) # Setup database for MySQL site if 'ee_db_name' in data.keys() and not data['wp']: diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index b918e496..f7841112 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -718,9 +718,9 @@ def site_package_check(self, stype): apt_packages = apt_packages + EEVariables.ee_php7_0 else: Log.warn(self, "PHP 7.0 not available for your system.") - Log.info(self, "Setting apt_packages variable for PHP 5.0") - Log.debug(self, "Setting apt_packages variable for PHP 5.0") if not EEAptGet.is_installed(self, 'php5-fpm'): + Log.info(self, "Setting apt_packages variable for PHP 5.0") + Log.debug(self, "Setting apt_packages variable for PHP 5.0") apt_packages = apt_packages + EEVariables.ee_php5_6 if stype in ['mysql', 'wp', 'wpsubdir', 'wpsubdomain']: From 23cc3a21b3e8a2d41d3c68f2c6993badd7bc145a Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 17 Feb 2016 17:04:49 +0530 Subject: [PATCH 059/115] php7 on update --- ee/cli/plugins/site.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 55ad93ad..7892e648 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -1256,7 +1256,27 @@ class EESiteUpdateController(CementBaseController): data['pagespeed'] = False pagespeed = False - if pargs.pagespeed=="on" or pargs.hhvm=="on" or pargs.letsencrypt=="on": + if pargs.pagespeed=="on" or pargs.hhvm=="on" or pargs.letsencrypt=="on" or pargs.php7=="on": + if pargs.php7 == "on": + if (not pargs.experimental): + Log.info(self, "PHP7.0 is experimental feature and it may not" + " work with all plugins of your site.\nYou can " + "disable it by passing --php7=off later.\nDo you wish" + " to enable PHP now for {0}?".format(ee_domain)) + + # Check prompt + check_prompt = input("Type \"y\" to continue [n]:") + if check_prompt != "Y" and check_prompt != "y": + Log.info(self, "Not using PHP 7.0 for site") + data['php7'] = False + php7 = False + else: + data['php7'] = True + php7 = True + else: + data['php7'] = True + php7 = True + if pargs.hhvm == "on": if (not pargs.experimental): Log.info(self, "HHVM is experimental feature and it may not" From ebf8139136da0c3a63a725a2128b585f54dd1728 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 17 Feb 2016 18:58:26 +0530 Subject: [PATCH 060/115] local variable 'php7' referenced before assignment --- ee/cli/plugins/site.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 7892e648..e3181e9d 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -921,6 +921,7 @@ class EESiteUpdateController(CementBaseController): hhvm = None pagespeed = None letsencrypt = False + php7 = None data = dict() try: @@ -1358,7 +1359,7 @@ class EESiteUpdateController(CementBaseController): data['basic'] = True cache = 'basic' - if ((hhvm is old_hhvm) and (pagespeed is old_pagespeed) and + if ((hhvm is old_hhvm) and (pagespeed is old_pagespeed) and (php7 is old_php7) and (stype == oldsitetype and cache == oldcachetype)): return 1 From c1dbaa64f0cafcb9c399fd6a057a23389f8052df Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 17 Feb 2016 19:04:52 +0530 Subject: [PATCH 061/115] local variable 'php7' referenced before assignment --- ee/cli/plugins/site.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index e3181e9d..78c83c25 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -970,6 +970,11 @@ class EESiteUpdateController(CementBaseController): check_ssl = check_site.is_ssl check_php_version = check_site.php_version + if check_php_version == "7.0": + old_php7 = True + else: + old_php7 = False + if (pargs.password and not (pargs.html or pargs.php or pargs.php7 or pargs.mysql or pargs.wp or pargs.w3tc or pargs.wpfc or pargs.wpsc @@ -1144,11 +1149,6 @@ class EESiteUpdateController(CementBaseController): if pargs.php7: - old_php7 = None - if check_php_version == "7.0": - old_php7 == True - else: - old_php7 == False if php7 is old_php7: if php7 is False: From 2453faf9b30a993e3fd220817181bb9061955a60 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 17 Feb 2016 19:11:07 +0530 Subject: [PATCH 062/115] Fix old_php7 check --- ee/cli/plugins/site.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 78c83c25..a83f09da 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -1159,13 +1159,7 @@ class EESiteUpdateController(CementBaseController): "site") pargs.php7 = False - if data and (not pargs.php7): - if old_php7 is True: - data['php7'] = True - php7 = True - else: - data['php7'] = False - php7 = False + #--letsencrypt=renew code goes here if pargs.letsencrypt == "renew" and not pargs.all: @@ -1257,6 +1251,14 @@ class EESiteUpdateController(CementBaseController): data['pagespeed'] = False pagespeed = False + if data and (not pargs.php7): + if old_php7 is True: + data['php7'] = True + php7 = True + else: + data['php7'] = False + php7 = False + if pargs.pagespeed=="on" or pargs.hhvm=="on" or pargs.letsencrypt=="on" or pargs.php7=="on": if pargs.php7 == "on": if (not pargs.experimental): From b3eab3d24f70286302d35c940ab88e32ae559994 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 17 Feb 2016 19:37:02 +0530 Subject: [PATCH 063/115] fix typo --- ee/cli/plugins/site.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index a83f09da..c5ee6456 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -1149,18 +1149,15 @@ class EESiteUpdateController(CementBaseController): if pargs.php7: - if php7 is old_php7: if php7 is False: Log.info(self, "PHP 7.0 is already disabled for given " "site") - elif pagespeed is True: + elif php7 is True: Log.info(self, "PHP 7.0 is already enabled for given " "site") pargs.php7 = False - - #--letsencrypt=renew code goes here if pargs.letsencrypt == "renew" and not pargs.all: expiry_days = SSL.getExpirationDays(self,ee_domain) From 0c9bf577769f86fdcc6f89faf07acf2b4e9eda12 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 17 Feb 2016 19:42:28 +0530 Subject: [PATCH 064/115] fix try --- ee/cli/plugins/site.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index c5ee6456..e157cf47 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -1127,7 +1127,7 @@ class EESiteUpdateController(CementBaseController): data['pagespeed'] = False pagespeed = False - if pargs.php7 or pargs.php7 == 'on' : + if pargs.php7 != 'off' : data['php7'] = True php7 = True elif pargs.php7 == 'off': From 1614ed33a93ddc21686202276d456ef65c506e73 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 17 Feb 2016 19:49:31 +0530 Subject: [PATCH 065/115] update changelog --- CHANGELOG.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 63cbd36b..84c0abb1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,6 @@ +v3.5.0 - Feb 17, 2016 +- Added PHP 7.0 support for UBUNTU(Trusty) + v3.4.1 - Jan 20, 2016 - Fixed and update ee stack install --nginx/--nginxmainline - Fixed --letsencrypt minor issues From bec734f050132a2794afcc315bec00a9d92370e3 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 17 Feb 2016 19:49:52 +0530 Subject: [PATCH 066/115] Updated version --- ee/core/variables.py | 2 +- install | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ee/core/variables.py b/ee/core/variables.py index 73e2ec99..00819d2c 100644 --- a/ee/core/variables.py +++ b/ee/core/variables.py @@ -12,7 +12,7 @@ class EEVariables(): """Intialization of core variables""" # EasyEngine version - ee_version = "3.4.1" + ee_version = "3.5.0" # EasyEngine packages versions diff --git a/install b/install index ec6bb121..9aa2cf90 100644 --- a/install +++ b/install @@ -48,7 +48,7 @@ fi # Define variables for later use ee_branch=$1 readonly ee_version_old="2.2.3" -readonly ee_version_new="3.4.1" +readonly ee_version_new="3.5.0" readonly ee_log_dir=/var/log/ee/ readonly ee_install_log=/var/log/ee/install.log readonly ee_linux_distro=$(lsb_release -i | awk '{print $3}') diff --git a/setup.py b/setup.py index 0538bd92..bcd8e670 100644 --- a/setup.py +++ b/setup.py @@ -58,7 +58,7 @@ if not os.path.isfile('/root/.gitconfig'): shutil.copy2(os.path.expanduser("~")+'/.gitconfig', '/root/.gitconfig') setup(name='ee', - version='3.4.1', + version='3.5.0', description=long_description, long_description=long_description, classifiers=[], From 387f77e34066e984f1d7f9fe761e8792165cd020 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Thu, 18 Feb 2016 11:37:01 +0530 Subject: [PATCH 067/115] Fix purge/remove php7 --- ee/cli/plugins/stack.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 9bfb3e9c..d917890b 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -2373,7 +2373,7 @@ class EEStackController(CementBaseController): # Default action for stack remove if ((not self.app.pargs.web) and (not self.app.pargs.admin) and (not self.app.pargs.mail) and (not self.app.pargs.nginx) and - (not self.app.pargs.php) and (not self.app.pargs.mysql) and + (not self.app.pargs.php) and (not self.app.pargs.php7) and (not self.app.pargs.mysql) and (not self.app.pargs.postfix) 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 @@ -2387,6 +2387,7 @@ class EEStackController(CementBaseController): self.app.pargs.web = True self.app.pargs.admin = True self.app.pargs.mail = True + self.app.pargs.php7 = True if self.app.pargs.web: self.app.pargs.nginx = True @@ -2438,6 +2439,13 @@ class EEStackController(CementBaseController): else: apt_packages = apt_packages + EEVariables.ee_php + if self.app.pargs.php7: + if EEVariables.ee_platform_codename == 'trusty': + Log.debug(self, "Removing apt_packages variable of PHP 7.0") + apt_packages = apt_packages + EEVariables.ee_php7_0 + else: + Log.info(self,"PHP 7.0 not supported.") + if self.app.pargs.hhvm: if EEAptGet.is_installed(self, 'hhvm'): Log.debug(self, "Removing apt_packages varible of HHVM") @@ -2525,7 +2533,7 @@ class EEStackController(CementBaseController): # Default action for stack purge if ((not self.app.pargs.web) and (not self.app.pargs.admin) and (not self.app.pargs.mail) and (not self.app.pargs.nginx) and - (not self.app.pargs.php) and (not self.app.pargs.mysql) and + (not self.app.pargs.php) and (not self.app.pargs.php7) and (not self.app.pargs.mysql) and (not self.app.pargs.postfix) 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 @@ -2539,6 +2547,7 @@ class EEStackController(CementBaseController): self.app.pargs.web = True self.app.pargs.admin = True self.app.pargs.mail = True + self.app.pargs.php7 = True if self.app.pargs.web: self.app.pargs.nginx = True @@ -2589,6 +2598,12 @@ class EEStackController(CementBaseController): apt_packages = apt_packages + EEVariables.ee_php5_6 else: apt_packages = apt_packages + EEVariables.ee_php + if self.app.pargs.php7: + if EEVariables.ee_platform_codename == 'trusty': + Log.debug(self, "Removing apt_packages variable of PHP 7.0") + apt_packages = apt_packages + EEVariables.ee_php7_0 + else: + Log.info(self,"PHP 7.0 not supported.") if self.app.pargs.hhvm: if EEAptGet.is_installed(self, 'hhvm'): Log.debug(self, "Purge apt_packages varible of HHVM") From 0dfe2c2c6033374daba1b4574307449c32281283 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Thu, 18 Feb 2016 14:47:05 +0530 Subject: [PATCH 068/115] fix php 7.0 basic --- ee/cli/plugins/site.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index e157cf47..7deb194c 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -337,7 +337,7 @@ class EESiteCreateController(CementBaseController): (['--php'], dict(help="create php site", action='store_true')), (['--php7'], - dict(help="create php site", action='store_true')), + dict(help="create php 7.0 site", action='store_true')), (['--mysql'], dict(help="create mysql site", action='store_true')), (['--wp'], @@ -443,6 +443,13 @@ class EESiteCreateController(CementBaseController): data['port'] = port ee_site_webroot = "" + if stype in ['php7']: + data = dict(site_name=ee_domain, www_domain=ee_www_domain, + static=False, basic=False, php7=True, wp=False, w3tc=False, + wpfc=False, wpsc=False, multisite=False, + wpsubdir=False, webroot=ee_site_webroot) + data['basic'] = True + if stype in ['html', 'php' ]: data = dict(site_name=ee_domain, www_domain=ee_www_domain, static=True, basic=False, php7=False, wp=False, w3tc=False, From 7abb430465ca6dfaeb6fb281ef9eb590eb434c55 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Thu, 18 Feb 2016 14:51:51 +0530 Subject: [PATCH 069/115] fix php 7.0 basic --- ee/cli/plugins/site.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 7deb194c..e234687f 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -443,7 +443,7 @@ class EESiteCreateController(CementBaseController): data['port'] = port ee_site_webroot = "" - if stype in ['php7']: + if self.app.pargs.php7: data = dict(site_name=ee_domain, www_domain=ee_www_domain, static=False, basic=False, php7=True, wp=False, w3tc=False, wpfc=False, wpsc=False, multisite=False, From ee4fa975a90f3aefddaa0dc3b3cf4b700b027e1b Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Thu, 18 Feb 2016 16:12:05 +0530 Subject: [PATCH 070/115] update php debug --- ee/cli/plugins/debug.py | 208 ++++++++++++++++++++++++++++++++++------ 1 file changed, 180 insertions(+), 28 deletions(-) diff --git a/ee/cli/plugins/debug.py b/ee/cli/plugins/debug.py index 23bd6aa3..75965119 100644 --- a/ee/cli/plugins/debug.py +++ b/ee/cli/plugins/debug.py @@ -2,6 +2,7 @@ from cement.core.controller import CementBaseController, expose from cement.core import handler, hook +from ee.core.aptget import EEAptGet from ee.core.shellexec import * from ee.core.mysql import EEMysql from ee.core.services import EEService @@ -49,6 +50,14 @@ class EEDebugController(CementBaseController): dict(help='start/stop debugging fastcgi configuration', action='store' or 'store_const', choices=('on', 'off'), const='on', nargs='?')), + (['--php7'], + dict(help='start/stop debugging server php 7.0 configuration', + action='store' or 'store_const', + choices=('on', 'off'), const='on', nargs='?')), + (['--fpm7'], + dict(help='start/stop debugging fastcgi 7.0 configuration', + action='store' or 'store_const', + choices=('on', 'off'), const='on', nargs='?')), (['--mysql'], dict(help='start/stop debugging mysql server', action='store' or 'store_const', @@ -118,7 +127,7 @@ class EEDebugController(CementBaseController): Log.info(self, "Nginx debug connection already disabled") # start site specific debug - elif (self.app.pargs.nginx == 'on'and self.app.pargs.site_name): + elif (self.app.pargs.nginx == 'on' and self.app.pargs.site_name): config_path = ("/etc/nginx/sites-available/{0}" .format(self.app.pargs.site_name)) if os.path.isfile(config_path): @@ -167,6 +176,7 @@ class EEDebugController(CementBaseController): def debug_php(self): """Start/Stop PHP debug""" # PHP global debug start + if (self.app.pargs.php == 'on' and not self.app.pargs.site_name): if not (EEShellExec.cmd_exec(self, "sed -n \"/upstream php" "{/,/}/p \" /etc/nginx/" @@ -184,20 +194,20 @@ class EEDebugController(CementBaseController): nc.savef('/etc/nginx/conf.d/upstream.conf') # Enable xdebug - EEFileUtils.searchreplace(self, "/etc/php5/mods-available/" - "xdebug.ini", - ";zend_extension", - "zend_extension") + EEFileUtils.searchreplace(self, "/etc/{0}/mods-available/".format("php" if EEVariables.ee_platform_codename == 'trusty' else "php5") + + "xdebug.ini", + ";zend_extension", + "zend_extension") # Fix slow log is not enabled default in PHP5.6 config = configparser.ConfigParser() - config.read('/etc/php5/fpm/pool.d/debug.conf') - config['debug']['slowlog'] = '/var/log/php5/slow.log' + config.read('/etc/{0}/fpm/pool.d/debug.conf'.format("php/5.6" if EEVariables.ee_platform_codename == 'trusty' else "php5")) + config['debug']['slowlog'] = '/var/log/{0}/slow.log'.format("php/5.6" if EEVariables.ee_platform_codename == 'trusty' else "php5") config['debug']['request_slowlog_timeout'] = '10s' - with open('/etc/php5/fpm/pool.d/debug.conf', + with open('/etc/{0}/fpm/pool.d/debug.conf'.format("php/5.6" if EEVariables.ee_platform_codename == 'trusty' else "php5"), encoding='utf-8', mode='w') as confifile: Log.debug(self, "Writting debug.conf configuration into " - "/etc/php5/fpm/pool.d/debug.conf") + "/etc/{0}/fpm/pool.d/debug.conf".format("php/5.6" if EEVariables.ee_platform_codename == 'trusty' else "php5")) config.write(confifile) self.trigger_php = True @@ -205,7 +215,7 @@ class EEDebugController(CementBaseController): else: Log.info(self, "PHP debug is already enabled") - self.msg = self.msg + ['/var/log/php5/slow.log'] + self.msg = self.msg + ['/var/log/{0}/slow.log'.format("php/5.6" if EEVariables.ee_platform_codename == 'trusty' else "php5")] # PHP global debug stop elif (self.app.pargs.php == 'off' and not self.app.pargs.site_name): @@ -223,7 +233,7 @@ class EEDebugController(CementBaseController): nc.savef('/etc/nginx/conf.d/upstream.conf') # Disable xdebug - EEFileUtils.searchreplace(self, "/etc/php5/mods-available/" + EEFileUtils.searchreplace(self, "/etc/{0}/mods-available/".format("php" if EEVariables.ee_platform_codename == 'trusty' else "php5") + "xdebug.ini", "zend_extension", ";zend_extension") @@ -239,44 +249,160 @@ class EEDebugController(CementBaseController): # PHP5-FPM start global debug if (self.app.pargs.fpm == 'on' and not self.app.pargs.site_name): if not EEShellExec.cmd_exec(self, "grep \"log_level = debug\" " - "/etc/php5/fpm/php-fpm.conf"): + "/etc/{0}/fpm/php-fpm.conf".format("php/5.6" if EEVariables.ee_platform_codename == 'trusty' else "php5")): Log.info(self, "Setting up PHP5-FPM log_level = debug") config = configparser.ConfigParser() - config.read('/etc/php5/fpm/php-fpm.conf') + config.read('/etc/{0}/fpm/php-fpm.conf'.format("php/5.6" if EEVariables.ee_platform_codename == 'trusty' else "php5")) config.remove_option('global', 'include') config['global']['log_level'] = 'debug' - config['global']['include'] = '/etc/php5/fpm/pool.d/*.conf' - with open('/etc/php5/fpm/php-fpm.conf', + config['global']['include'] = '/etc/{0}/fpm/pool.d/*.conf'.format("php/5.6" if EEVariables.ee_platform_codename == 'trusty' else "php5") + with open('/etc/{0}/fpm/php-fpm.conf'.format("php/5.6" if EEVariables.ee_platform_codename == 'trusty' else "php5"), encoding='utf-8', mode='w') as configfile: Log.debug(self, "Writting php5-FPM configuration into " - "/etc/php5/fpm/php-fpm.conf") + "/etc/{0}/fpm/php-fpm.conf".format("php/5.6" if EEVariables.ee_platform_codename == 'trusty' 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/php5/fpm.log'] + self.msg = self.msg + ['/var/log/{0}/fpm.log'.format("php/5.6" if EEVariables.ee_platform_codename == 'trusty' else "php5")] # PHP5-FPM stop global debug elif (self.app.pargs.fpm == 'off' and not self.app.pargs.site_name): if EEShellExec.cmd_exec(self, "grep \"log_level = debug\" " - "/etc/php5/fpm/php-fpm.conf"): + "/etc/{0}/fpm/php-fpm.conf".format("php/5.6" if EEVariables.ee_platform_codename == 'trusty' else "php5")): Log.info(self, "Disabling PHP5-FPM log_level = debug") config = configparser.ConfigParser() - config.read('/etc/php5/fpm/php-fpm.conf') + config.read('/etc/{0}/fpm/php-fpm.conf'.format("php/5.6" if EEVariables.ee_platform_codename == 'trusty' else "php5")) config.remove_option('global', 'include') config['global']['log_level'] = 'notice' - config['global']['include'] = '/etc/php5/fpm/pool.d/*.conf' - with open('/etc/php5/fpm/php-fpm.conf', + config['global']['include'] = '/etc/{0}/fpm/pool.d/*.conf'.format("php/5.6" if EEVariables.ee_platform_codename == 'trusty' else "php5") + with open('/etc/{0}/fpm/php-fpm.conf'.format("php/5.6" if EEVariables.ee_platform_codename == 'trusty' else "php5"), encoding='utf-8', mode='w') as configfile: Log.debug(self, "writting php5 configuration into " - "/etc/php5/fpm/php-fpm.conf") + "/etc/{0}/fpm/php-fpm.conf".format("php/5.6" if EEVariables.ee_platform_codename == 'trusty' else "php5")) config.write(configfile) self.trigger_php = True else: Log.info(self, "PHP5-FPM log_level = debug already disabled") + @expose(hide=True) + def debug_php7(self): + """Start/Stop PHP debug""" + # PHP global debug start + + if (self.app.pargs.php7 == 'on' and not self.app.pargs.site_name): + if EEVariables.ee_platform_codename != 'trusty': + Log.error(self,"PHP 7.0 not supported.") + if not (EEShellExec.cmd_exec(self, "sed -n \"/upstream php7" + "{/,/}/p \" /etc/nginx/" + "conf.d/upstream.conf " + "| grep 9170")): + + Log.info(self, "Enabling PHP 7.0 debug") + + # Change upstream.conf + nc = NginxConfig() + nc.loadf('/etc/nginx/conf.d/upstream.conf') + nc.set([('upstream','php',), 'server'], '127.0.0.1:9170') + if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"): + nc.set([('upstream','hhvm',), 'server'], '127.0.0.1:9170') + nc.savef('/etc/nginx/conf.d/upstream.conf') + + # Enable xdebug + EEFileUtils.searchreplace(self, "/etc/php/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.0/fpm/pool.d/debug.conf') + config['debug']['slowlog'] = '/var/log/php/7.0/slow.log' + config['debug']['request_slowlog_timeout'] = '10s' + with open('/etc/php/7.0/fpm/pool.d/debug.conf', + encoding='utf-8', mode='w') as confifile: + Log.debug(self, "Writting debug.conf configuration into " + "/etc/php/7.0/fpm/pool.d/debug.conf") + config.write(confifile) + + self.trigger_php = True + self.trigger_nginx = True + else: + Log.info(self, "PHP debug is already enabled") + + self.msg = self.msg + ['/var/log/php/7.0/slow.log'] + + # PHP global debug stop + elif (self.app.pargs.php == 'off' and not self.app.pargs.site_name): + if EEShellExec.cmd_exec(self, " sed -n \"/upstream php {/,/}/p\" " + "/etc/nginx/conf.d/upstream.conf " + "| grep 9170"): + Log.info(self, "Disabling PHP 7.0 debug") + + # Change upstream.conf + nc = NginxConfig() + nc.loadf('/etc/nginx/conf.d/upstream.conf') + nc.set([('upstream','php',), 'server'], '127.0.0.1:9070') + 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 + EEFileUtils.searchreplace(self, "/etc/php/mods-available/" + "xdebug.ini", + "zend_extension", + ";zend_extension") + + self.trigger_php = True + self.trigger_nginx = True + else: + Log.info(self, "PHP 7.0 debug is already disabled") + + @expose(hide=True) + def debug_fpm7(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 not EEShellExec.cmd_exec(self, "grep \"log_level = debug\" " + "/etc/php/7.0/fpm/php-fpm.conf"): + Log.info(self, "Setting up PHP7.0-FPM log_level = debug") + config = configparser.ConfigParser() + config.read('/etc/php/7.0/fpm/php-fpm.conf') + config.remove_option('global', 'include') + config['global']['log_level'] = 'debug' + config['global']['include'] = '/etc/php/7.0/fpm/pool.d/*.conf' + with open('/etc/php/7.0/fpm/php-fpm.conf', + encoding='utf-8', mode='w') as configfile: + Log.debug(self, "Writting php7.0-FPM configuration into " + "/etc/php/7.0/fpm/php-fpm.conf") + config.write(configfile) + self.trigger_php = True + else: + Log.info(self, "PHP7.0-FPM log_level = debug already setup") + + self.msg = self.msg + ['/var/log/php/7.0/fpm.log'] + + # PHP5-FPM stop global debug + elif (self.app.pargs.fpm == 'off' and not self.app.pargs.site_name): + if EEShellExec.cmd_exec(self, "grep \"log_level = debug\" " + "/etc/php/7.0/fpm/php-fpm.conf"): + Log.info(self, "Disabling PHP7.0-FPM log_level = debug") + config = configparser.ConfigParser() + config.read('/etc/php/7.0/fpm/php-fpm.conf') + config.remove_option('global', 'include') + config['global']['log_level'] = 'notice' + config['global']['include'] = '/etc/php/7.0/fpm/pool.d/*.conf' + with open('/etc/php/7.0/fpm/php-fpm.conf', + encoding='utf-8', mode='w') as configfile: + Log.debug(self, "writting php7.0 configuration into " + "/etc/php/7.0/fpm/php-fpm.conf") + config.write(configfile) + self.trigger_php = True + else: + Log.info(self, "PHP7.0-FPM log_level = debug already disabled") + @expose(hide=True) def debug_mysql(self): """Start/Stop MySQL debug""" @@ -470,9 +596,15 @@ class EEDebugController(CementBaseController): if self.app.pargs.php: self.app.pargs.php = 'off' self.debug_php() + if self.app.pargs.php7: + self.app.pargs.php7 = 'off' + self.debug_php7() 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.mysql: # MySQL debug will not work for remote MySQL if EEVariables.ee_mysql_host is "localhost": @@ -494,7 +626,12 @@ class EEDebugController(CementBaseController): # Reload PHP if self.trigger_php: - EEService.reload_service(self, 'php5-fpm') + if EEVariables.ee_platform_codename == 'trusty': + EEService.reload_service(self, 'php5.6-fpm') + if EEAptGet.is_installed(self,'php7.0-fpm'): + EEService.reload_service(self, 'php7.0-fpm') + else: + EEService.reload_service(self, 'php5-fpm') self.app.close(0) @expose(hide=True) @@ -506,8 +643,8 @@ class EEDebugController(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.fpm) and (not self.app.pargs.mysql) + 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) 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) @@ -579,6 +716,9 @@ class EEDebugController(CementBaseController): self.app.pargs.nginx = 'on' self.app.pargs.php = 'on' self.app.pargs.fpm = 'on' + if EEVariables.ee_platform_codename == 'trusty' and EEAptGet.is_installed(self,'php7.0-fpm'): + self.app.pargs.php7 = 'on' + self.app.pargs.fpm7 = 'on' self.app.pargs.mysql = 'on' self.app.pargs.rewrite = 'on' @@ -588,11 +728,14 @@ class EEDebugController(CementBaseController): self.app.pargs.nginx = 'off' self.app.pargs.php = 'off' self.app.pargs.fpm = 'off' + if EEVariables.ee_platform_codename == 'trusty' and EEAptGet.is_installed(self,'php7.0-fpm'): + self.app.pargs.php7 = 'off' + self.app.pargs.fpm7 = '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.fpm) and (not self.app.pargs.mysql) + 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) and (not self.app.pargs.wp) and (not self.app.pargs.rewrite) and self.app.pargs.site_name): self.app.args.print_help() @@ -606,6 +749,10 @@ class EEDebugController(CementBaseController): self.debug_php() if self.app.pargs.fpm: self.debug_fpm() + if self.app.pargs.php7: + self.debug_php7() + if self.app.pargs.fpm7: + self.debug_fpm7() if self.app.pargs.mysql: # MySQL debug will not work for remote MySQL if EEVariables.ee_mysql_host is "localhost": @@ -626,7 +773,12 @@ class EEDebugController(CementBaseController): EEService.reload_service(self, 'nginx') # Reload PHP if self.trigger_php: - EEService.restart_service(self, 'php5-fpm') + if EEVariables.ee_platform_codename == 'trusty': + EEService.restart_service(self, 'php5.6-fpm') + if EEAptGet.is_installed(self,'php7.0-fpm'): + EEService.restart_service(self, 'php7.0-fpm') + else: + EEService.restart_service(self, 'php5-fpm') if len(self.msg) > 0: if not self.app.pargs.interactive: From f5072f622d1afcf664dfad6d2959728665474222 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Thu, 18 Feb 2016 16:52:26 +0530 Subject: [PATCH 071/115] Fix virtualconf.mustache --- ee/cli/plugins/site_functions.py | 7 +++- ee/cli/plugins/stack.py | 6 ++- ee/cli/templates/virtualconf-php7.mustache | 49 ++++++++++++++++++++++ ee/cli/templates/virtualconf.mustache | 2 +- ee/core/variables.py | 1 + 5 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 ee/cli/templates/virtualconf-php7.mustache diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index f7841112..b6b0e016 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -68,8 +68,11 @@ def setupdomain(self, data): ee_site_nginx_conf = open('/etc/nginx/sites-available/{0}' .format(ee_domain_name), encoding='utf-8', mode='w') - - self.app.render((data), 'virtualconf.mustache', + if not data['php7']: + self.app.render((data), 'virtualconf.mustache', + out=ee_site_nginx_conf) + else: + self.app.render((data), 'virtualconf-php7.mustache', out=ee_site_nginx_conf) ee_site_nginx_conf.close() except IOError as e: diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index d917890b..8566a6f7 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -2387,7 +2387,8 @@ class EEStackController(CementBaseController): self.app.pargs.web = True self.app.pargs.admin = True self.app.pargs.mail = True - self.app.pargs.php7 = True + if EEVariables.ee_platform_codename == 'trusty': + self.app.pargs.php7 = True if self.app.pargs.web: self.app.pargs.nginx = True @@ -2547,7 +2548,8 @@ class EEStackController(CementBaseController): self.app.pargs.web = True self.app.pargs.admin = True self.app.pargs.mail = True - self.app.pargs.php7 = True + if EEVariables.ee_platform_codename == 'trusty': + self.app.pargs.php7 = True if self.app.pargs.web: self.app.pargs.nginx = True diff --git a/ee/cli/templates/virtualconf-php7.mustache b/ee/cli/templates/virtualconf-php7.mustache new file mode 100644 index 00000000..4530e4fc --- /dev/null +++ b/ee/cli/templates/virtualconf-php7.mustache @@ -0,0 +1,49 @@ + +server { + + {{#multisite}} + # Uncomment the following line for domain mapping + # listen 80 default_server; + {{/multisite}} + + server_name {{^vma}}{{^rc}}{{site_name}}{{/rc}}{{/vma}} {{#vma}}vma.*{{/vma}} {{#rc}}webmail.*{{/rc}} {{^vma}}{{^rc}}{{#multisite}}*{{/multisite}}{{^multisite}}www{{/multisite}}.{{site_name}}{{/rc}}{{/vma}}; + + {{#multisite}} + # Uncomment the following line for domain mapping + #server_name_in_redirect off; + {{/multisite}} + + access_log /var/log/nginx/{{site_name}}.access.log {{^wpredis}}{{^static}}rt_cache{{/static}}{{/wpredis}}{{#wpredis}}rt_cache_redis{{/wpredis}}; + error_log /var/log/nginx/{{site_name}}.error.log; + + {{#proxy}} + add_header X-Proxy-Cache $upstream_cache_status; + location / { + proxy_pass http://{{host}}:{{port}}; + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + {{/proxy}} + + {{^proxy}} + {{^vma}}{{^rc}}root {{webroot}}/htdocs;{{/rc}}{{/vma}} + {{#vma}}root /var/www/22222/htdocs/vimbadmin/public;{{/vma}} + {{#rc}}root /var/www/roundcubemail/htdocs/;{{/rc}} + + {{^proxy}}index {{^static}}index.php{{/static}} index.html index.htm;{{/proxy}} + + {{#static}} + location / { + try_files $uri $uri/ =404; + } + {{/static}} + + {{^static}}include {{^hhvm}}{{#basic}}common/php7.conf;{{/basic}}{{#w3tc}}common/w3tc-php7.conf;{{/w3tc}}{{#wpfc}}common/wpfc-php7.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php7.conf;{{/wpsc}}{{#wpredis}}common/redis-php7.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}} + {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}} + {{#wp}}include common/wpcommon.conf;{{/wp}} + {{^proxy}}include common/locations.conf;{{/proxy}} + {{^vma}}{{^rc}}include {{webroot}}/conf/nginx/*.conf;{{/rc}}{{/vma}} + {{/proxy}} +} diff --git a/ee/cli/templates/virtualconf.mustache b/ee/cli/templates/virtualconf.mustache index 853fb79e..8f9b4746 100644 --- a/ee/cli/templates/virtualconf.mustache +++ b/ee/cli/templates/virtualconf.mustache @@ -40,7 +40,7 @@ server { } {{/static}} - {{^static}}include {{^php7}}{{^hhvm}}{{#basic}}common/php.conf;{{/basic}}{{#w3tc}}common/w3tc.conf;{{/w3tc}}{{#wpfc}}common/wpfc.conf;{{/wpfc}} {{#wpsc}}common/wpsc.conf;{{/wpsc}}{{#wpredis}}common/redis.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}}{{/php7}} {{#php7}}{{^hhvm}}{{#basic}}common/php7.conf;{{/basic}}{{#w3tc}}common/w3tc-php7.conf;{{/w3tc}}{{#wpfc}}common/wpfc-php7.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php7.conf;{{/wpsc}}{{#wpredis}}common/redis-php7.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}}{{/php7}} + {{^static}}include {{^hhvm}}{{#basic}}common/php.conf;{{/basic}}{{#w3tc}}common/w3tc.conf;{{/w3tc}}{{#wpfc}}common/wpfc.conf;{{/wpfc}} {{#wpsc}}common/wpsc.conf;{{/wpsc}}{{#wpredis}}common/redis.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}} {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}} {{#wp}}include common/wpcommon.conf;{{/wp}} {{^proxy}}include common/locations.conf;{{/proxy}} diff --git a/ee/core/variables.py b/ee/core/variables.py index 00819d2c..70a1d955 100644 --- a/ee/core/variables.py +++ b/ee/core/variables.py @@ -128,6 +128,7 @@ class EEVariables(): "php7.0-mcrypt", "php7.0-common", "php7.0-readline", "php7.0-mysql", "php7.0-cli", "php-memcached", "php-imagick", "memcached", "graphviz", "php-pear", "php-xdebug"] + ee_php_extra = [] elif ee_platform_distro == 'debian': if ee_platform_codename == 'wheezy': ee_php_repo = ("deb http://packages.dotdeb.org {codename}-php56 all" From 79ac4ef0bbc127b34007a8020d7843c65d3e0a63 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Thu, 18 Feb 2016 18:19:26 +0530 Subject: [PATCH 072/115] update debug.py --- ee/cli/plugins/debug.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ee/cli/plugins/debug.py b/ee/cli/plugins/debug.py index 75965119..dfc9ebe0 100644 --- a/ee/cli/plugins/debug.py +++ b/ee/cli/plugins/debug.py @@ -335,7 +335,7 @@ class EEDebugController(CementBaseController): self.msg = self.msg + ['/var/log/php/7.0/slow.log'] # PHP global debug stop - elif (self.app.pargs.php == 'off' and not self.app.pargs.site_name): + elif (self.app.pargs.php7 == 'off' and not self.app.pargs.site_name): if EEShellExec.cmd_exec(self, " sed -n \"/upstream php {/,/}/p\" " "/etc/nginx/conf.d/upstream.conf " "| grep 9170"): @@ -385,7 +385,7 @@ class EEDebugController(CementBaseController): self.msg = self.msg + ['/var/log/php/7.0/fpm.log'] # PHP5-FPM stop global debug - elif (self.app.pargs.fpm == 'off' and not self.app.pargs.site_name): + elif (self.app.pargs.fpm7 == 'off' and not self.app.pargs.site_name): if EEShellExec.cmd_exec(self, "grep \"log_level = debug\" " "/etc/php/7.0/fpm/php-fpm.conf"): Log.info(self, "Disabling PHP7.0-FPM log_level = debug") @@ -627,7 +627,8 @@ class EEDebugController(CementBaseController): # Reload PHP if self.trigger_php: if EEVariables.ee_platform_codename == 'trusty': - EEService.reload_service(self, 'php5.6-fpm') + if EEAptGet.is_installed(self,'php5.6-fpm'): + EEService.reload_service(self, 'php5.6-fpm') if EEAptGet.is_installed(self,'php7.0-fpm'): EEService.reload_service(self, 'php7.0-fpm') else: @@ -774,7 +775,8 @@ class EEDebugController(CementBaseController): # Reload PHP if self.trigger_php: if EEVariables.ee_platform_codename == 'trusty': - EEService.restart_service(self, 'php5.6-fpm') + if EEAptGet.is_installed(self,'php5.6-fpm'): + EEService.restart_service(self, 'php5.6-fpm') if EEAptGet.is_installed(self,'php7.0-fpm'): EEService.restart_service(self, 'php7.0-fpm') else: From 07d5c60ece1348d40ba922c32fad599f7f401837 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Thu, 18 Feb 2016 19:09:15 +0530 Subject: [PATCH 073/115] Fix static value true --- ee/cli/plugins/site.py | 6 +++--- ee/cli/plugins/site_functions.py | 2 +- ee/cli/plugins/stack.py | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index e234687f..f0d487f8 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -510,9 +510,9 @@ class EESiteCreateController(CementBaseController): data['php7'] = False php7 = 0 - if (self.app.pargs.php7) and (not self.app.pargs.w3tc) and\ - (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.w3tc) and\ + (not self.app.pargs.wpfc) and (not self.app.pargs.wpsc) and (not self.app.pargs.wpredis) \ + and (not self.app.pargs.hhvm): data['basic'] = True diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index b6b0e016..9f9621ac 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -1072,7 +1072,7 @@ def detSitePar(opts): cachelist = list() for key, val in opts.items(): if val and key in ['html', 'php', 'mysql', 'wp', - 'wpsubdir', 'wpsubdomain']: + 'wpsubdir', 'wpsubdomain','php7']: typelist.append(key) elif val and key in ['wpfc', 'wpsc', 'w3tc', 'wpredis']: cachelist.append(key) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 8566a6f7..68595967 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -2183,6 +2183,8 @@ class EEStackController(CementBaseController): Log.debug(self, "Setting apt_packages variable for PHP 7.0") if not EEAptGet.is_installed(self, 'php7.0-fpm') : apt_packages = apt_packages + EEVariables.ee_php7_0 + if not EEAptGet.is_installed(self, 'php5.6-fpm'): + apt_packages = apt_packages + EEVariables.ee_php5_6 else: Log.debug(self, "PHP 7.0 already installed") Log.info(self, "PHP 7.0 already installed") From 9669eff747c08e9704fadb55f64826a1952c1925 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Thu, 18 Feb 2016 19:49:23 +0530 Subject: [PATCH 074/115] fix wp php7 option --- ee/cli/plugins/site_functions.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index 9f9621ac..cf13529c 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -1116,6 +1116,12 @@ def detSitePar(opts): cachetype = 'basic' else: cachetype = cachelist[0] + elif False not in [x in ('wp','php7') for x in typelist]: + sitetype = 'wp' + if not cachelist: + cachetype = 'basic' + else: + cachetype = cachelist[0] else: raise RuntimeError("could not determine site and cache type") From 3f4270bd027ea43ba5a9053d75a353b319cde5cd Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Fri, 19 Feb 2016 11:24:26 +0530 Subject: [PATCH 075/115] Update virtualconf.mustache --- ee/cli/templates/virtualconf.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/cli/templates/virtualconf.mustache b/ee/cli/templates/virtualconf.mustache index 8f9b4746..93136ccb 100644 --- a/ee/cli/templates/virtualconf.mustache +++ b/ee/cli/templates/virtualconf.mustache @@ -40,7 +40,7 @@ server { } {{/static}} - {{^static}}include {{^hhvm}}{{#basic}}common/php.conf;{{/basic}}{{#w3tc}}common/w3tc.conf;{{/w3tc}}{{#wpfc}}common/wpfc.conf;{{/wpfc}} {{#wpsc}}common/wpsc.conf;{{/wpsc}}{{#wpredis}}common/redis.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}} + {{^static}}include {{^php7}}{{^hhvm}}{{#basic}}common/php.conf;{{/basic}}{{#w3tc}}common/w3tc.conf;{{/w3tc}}{{#wpfc}}common/wpfc.conf;{{/wpfc}}{{#wpsc}}common/wpsc.conf;{{/wpsc}}{{#wpredis}}common/redis.conf;{{/wpredis}}{{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}}{{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}}{{/hhvm}}{{/php7}}{{#php7}}{{^hhvm}}{{#basic}}common/php7.conf;{{/basic}}{{#w3tc}}common/w3tc-php7.conf;{{/w3tc}}{{#wpfc}}common/wpfc-php7.conf;{{/wpfc}}{{#wpsc}}common/wpsc-php7.conf;{{/wpsc}}{{#wpredis}}common/redis-php7.conf;{{/wpredis}}{{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}}{{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}}{{/hhvm}}{{/php7}} {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}} {{#wp}}include common/wpcommon.conf;{{/wp}} {{^proxy}}include common/locations.conf;{{/proxy}} From cfa6adc888324797638cee3b41ce69ddcd80a4c2 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Fri, 19 Feb 2016 11:25:33 +0530 Subject: [PATCH 076/115] update php packages variable --- ee/cli/plugins/site_functions.py | 11 ++++------- ee/cli/plugins/stack.py | 10 +++++++--- ee/core/variables.py | 13 ++++++------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index cf13529c..2dac1443 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -68,11 +68,8 @@ def setupdomain(self, data): ee_site_nginx_conf = open('/etc/nginx/sites-available/{0}' .format(ee_domain_name), encoding='utf-8', mode='w') - if not data['php7']: - self.app.render((data), 'virtualconf.mustache', - out=ee_site_nginx_conf) - else: - self.app.render((data), 'virtualconf-php7.mustache', + + self.app.render((data), 'virtualconf.mustache', out=ee_site_nginx_conf) ee_site_nginx_conf.close() except IOError as e: @@ -712,7 +709,7 @@ def site_package_check(self, stype): apt_packages = apt_packages + EEVariables.ee_php else: if not EEAptGet.is_installed(self, 'php5.6-fpm'): - apt_packages = apt_packages + EEVariables.ee_php5_6 + apt_packages = apt_packages + EEVariables.ee_php5_6 + EEVariables.ee_php_extra if self.app.pargs.php7 and stype in [ 'mysql', 'wp', 'wpsubdir', 'wpsubdomain']: if EEVariables.ee_platform_codename == 'trusty': @@ -724,7 +721,7 @@ def site_package_check(self, stype): if not EEAptGet.is_installed(self, 'php5-fpm'): Log.info(self, "Setting apt_packages variable for PHP 5.0") Log.debug(self, "Setting apt_packages variable for PHP 5.0") - apt_packages = apt_packages + EEVariables.ee_php5_6 + apt_packages = apt_packages + EEVariables.ee_php5_6 + EEVariables.ee_php_extra if stype in ['mysql', 'wp', 'wpsubdir', 'wpsubdomain']: Log.debug(self, "Setting apt_packages variable for MySQL") diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 68595967..d0c90a90 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -2170,7 +2170,7 @@ class EEStackController(CementBaseController): Log.debug(self, "Setting apt_packages variable for PHP") if not (EEAptGet.is_installed(self, 'php5-fpm') or EEAptGet.is_installed(self, 'php5.6-fpm')): if EEVariables.ee_platform_codename == 'trusty': - apt_packages = apt_packages + EEVariables.ee_php5_6 + apt_packages = apt_packages + EEVariables.ee_php5_6 + EEVariables.ee_php_extra else: apt_packages = apt_packages + EEVariables.ee_php else: @@ -2184,7 +2184,7 @@ class EEStackController(CementBaseController): if not EEAptGet.is_installed(self, 'php7.0-fpm') : apt_packages = apt_packages + EEVariables.ee_php7_0 if not EEAptGet.is_installed(self, 'php5.6-fpm'): - apt_packages = apt_packages + EEVariables.ee_php5_6 + apt_packages = apt_packages + EEVariables.ee_php5_6 + EEVariables.ee_php_extra else: Log.debug(self, "PHP 7.0 already installed") Log.info(self, "PHP 7.0 already installed") @@ -2439,6 +2439,8 @@ class EEStackController(CementBaseController): Log.debug(self, "Removing apt_packages variable of PHP") if EEVariables.ee_platform_codename == 'trusty': apt_packages = apt_packages + EEVariables.ee_php5_6 + if not EEAptGet.is_installed(self, 'php7.0-fpm'): + apt_packages = apt_packages + EEVariables.ee_php_extra else: apt_packages = apt_packages + EEVariables.ee_php @@ -2446,12 +2448,14 @@ class EEStackController(CementBaseController): if EEVariables.ee_platform_codename == 'trusty': Log.debug(self, "Removing apt_packages variable of PHP 7.0") apt_packages = apt_packages + EEVariables.ee_php7_0 + if not EEAptGet.is_installed(self, 'php5.6-fpm'): + apt_packages = apt_packages + EEVariables.ee_php_extra else: Log.info(self,"PHP 7.0 not supported.") if self.app.pargs.hhvm: if EEAptGet.is_installed(self, 'hhvm'): - Log.debug(self, "Removing apt_packages varible of HHVM") + Log.debug(self, "Removing apt_packages variable of HHVM") apt_packages = apt_packages + EEVariables.ee_hhvm if self.app.pargs.redis: Log.debug(self, "Remove apt_packages variable of Redis") diff --git a/ee/core/variables.py b/ee/core/variables.py index 70a1d955..cdc0093c 100644 --- a/ee/core/variables.py +++ b/ee/core/variables.py @@ -121,14 +121,13 @@ class EEVariables(): elif ee_platform_codename == 'trusty': ee_php_repo = "ppa:ondrej/php" ee_php5_6 = ["php5.6-fpm", "php5.6-curl", "php5.6-gd", "php5.6-imap", - "php5.6-mcrypt", "php5.6-common", "php5.6-readline", - "php5.6-mysql", "php5.6-cli", "php-memcached", "php-imagick", - "memcached", "graphviz", "php-pear", "php-xdebug"] + "php5.6-mcrypt", "php5.6-readline", + "php5.6-mysql", "php5.6-cli"] ee_php7_0 = ["php7.0-fpm", "php7.0-curl", "php7.0-gd", "php7.0-imap", - "php7.0-mcrypt", "php7.0-common", "php7.0-readline", - "php7.0-mysql", "php7.0-cli", "php-memcached", "php-imagick", - "memcached", "graphviz", "php-pear", "php-xdebug"] - ee_php_extra = [] + "php7.0-mcrypt", "php7.0-readline", + "php7.0-mysql", "php7.0-cli"] + ee_php_extra = ["php5.6-common", "php7.0-common", "php-memcached", "php-imagick", "memcached", + "graphviz", "php-pear", "php-xdebug"] elif ee_platform_distro == 'debian': if ee_platform_codename == 'wheezy': ee_php_repo = ("deb http://packages.dotdeb.org {codename}-php56 all" From a7fdf021857635ad3cc3c91f74234d003881cdbc Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Fri, 19 Feb 2016 11:36:51 +0530 Subject: [PATCH 077/115] update php packages variable --- ee/cli/plugins/site_functions.py | 6 +++--- ee/cli/plugins/stack.py | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index 2dac1443..add00d0f 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -715,13 +715,13 @@ def site_package_check(self, stype): if EEVariables.ee_platform_codename == 'trusty': Log.debug(self, "Setting apt_packages variable for PHP 7.0") if not EEAptGet.is_installed(self, 'php7.0-fpm'): - apt_packages = apt_packages + EEVariables.ee_php7_0 + apt_packages = apt_packages + EEVariables.ee_php7_0 + EEVariables.ee_php_extra else: Log.warn(self, "PHP 7.0 not available for your system.") if not EEAptGet.is_installed(self, 'php5-fpm'): Log.info(self, "Setting apt_packages variable for PHP 5.0") Log.debug(self, "Setting apt_packages variable for PHP 5.0") - apt_packages = apt_packages + EEVariables.ee_php5_6 + EEVariables.ee_php_extra + apt_packages = apt_packages + EEVariables.ee_php if stype in ['mysql', 'wp', 'wpsubdir', 'wpsubdomain']: Log.debug(self, "Setting apt_packages variable for MySQL") @@ -846,7 +846,7 @@ def site_package_check(self, stype): Log.debug(self, "Setting apt_packages variable for PHP 7.0") if not EEAptGet.is_installed(self, 'php7.0-fpm'): - apt_packages = apt_packages + EEVariables.ee_php7_0 + apt_packages = apt_packages + EEVariables.ee_php7_0 + EEVariables.ee_php_extra if os.path.isdir("/etc/nginx/common") and (not os.path.isfile("/etc/nginx/common/php7.conf")): diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index d0c90a90..7b7a81f8 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -2182,7 +2182,7 @@ class EEStackController(CementBaseController): if EEVariables.ee_platform_codename == 'trusty': Log.debug(self, "Setting apt_packages variable for PHP 7.0") if not EEAptGet.is_installed(self, 'php7.0-fpm') : - apt_packages = apt_packages + EEVariables.ee_php7_0 + apt_packages = apt_packages + EEVariables.ee_php7_0 + EEVariables.ee_php_extra if not EEAptGet.is_installed(self, 'php5.6-fpm'): apt_packages = apt_packages + EEVariables.ee_php5_6 + EEVariables.ee_php_extra else: @@ -2604,12 +2604,16 @@ class EEStackController(CementBaseController): Log.debug(self, "Purge apt_packages variable PHP") if EEVariables.ee_platform_codename == 'trusty': apt_packages = apt_packages + EEVariables.ee_php5_6 + if not EEAptGet.is_installed(self, 'php7.0-fpm'): + apt_packages = apt_packages + EEVariables.ee_php_extra else: apt_packages = apt_packages + EEVariables.ee_php if self.app.pargs.php7: if EEVariables.ee_platform_codename == 'trusty': Log.debug(self, "Removing apt_packages variable of PHP 7.0") apt_packages = apt_packages + EEVariables.ee_php7_0 + if not EEAptGet.is_installed(self, 'php5.6-fpm'): + apt_packages = apt_packages + EEVariables.ee_php_extra else: Log.info(self,"PHP 7.0 not supported.") if self.app.pargs.hhvm: From c41d826db09d1efa59f7d29f8fe0601aa016065f Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Fri, 19 Feb 2016 13:07:51 +0530 Subject: [PATCH 078/115] update siteinfo.py --- ee/cli/templates/siteinfo.mustache | 1 + 1 file changed, 1 insertion(+) diff --git a/ee/cli/templates/siteinfo.mustache b/ee/cli/templates/siteinfo.mustache index 3e8b1960..2f31a59f 100644 --- a/ee/cli/templates/siteinfo.mustache +++ b/ee/cli/templates/siteinfo.mustache @@ -1,6 +1,7 @@ Information about {{domain}}: Nginx configuration {{type}} {{enable}} +{{#php_version}}PHP Version {{php_version}}{{/php_version}} {{#pagespeed}}Pagespeed {{pagespeed}}{{/pagespeed}} {{#hhvm}}HHVM {{hhvm}}{{/hhvm}} {{#ssl}}SSL {{ssl}}{{/ssl}} From ec2505cc1ac3e9bfff0379cc35b13f154f85584c Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Fri, 19 Feb 2016 13:08:15 +0530 Subject: [PATCH 079/115] added php version in siteinfo --- ee/cli/plugins/site.py | 3 +- ee/cli/plugins/site_functions.py | 55 ++++++++++++++++++++++++-------- 2 files changed, 44 insertions(+), 14 deletions(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index f0d487f8..73949ad7 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -156,6 +156,7 @@ class EESiteController(CementBaseController): error_log = "/var/log/nginx/{0}.error.log".format(ee_domain) ee_site_webroot = '' + php_version = siteinfo.php_version pagespeed = ("enabled" if siteinfo.is_pagespeed else "disabled") ssl = ("enabled" if siteinfo.is_ssl else "disabled") if (ssl == "enabled"): @@ -166,7 +167,7 @@ class EESiteController(CementBaseController): sslexpiry = '' data = dict(domain=ee_domain, webroot=ee_site_webroot, accesslog=access_log, errorlog=error_log, - dbname=ee_db_name, dbuser=ee_db_user, + dbname=ee_db_name, dbuser=ee_db_user,php_version=php_version, dbpass=ee_db_pass, hhvm=hhvm, pagespeed=pagespeed, ssl=ssl, sslprovider=sslprovider, sslexpiry= sslexpiry, type=sitetype + " " + cachetype + " ({0})" diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index add00d0f..8d012839 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -674,7 +674,7 @@ def site_package_check(self, stype): stack = EEStackController() stack.app = self.app if stype in ['html', 'proxy', 'php', 'mysql', 'wp', 'wpsubdir', - 'wpsubdomain']: + 'wpsubdomain', 'php7']: Log.debug(self, "Setting apt_packages variable for Nginx") # Check if server has nginx-custom package @@ -1083,12 +1083,24 @@ def detSitePar(opts): cachetype = 'basic' else: cachetype = cachelist[0] + elif False not in [x in ('php7','mysql','html') for x in typelist]: + sitetype = 'mysql' + if not cachelist: + cachetype = 'basic' + else: + cachetype = cachelist[0] elif False not in [x in ('php','mysql') for x in typelist]: sitetype = 'mysql' if not cachelist: cachetype = 'basic' else: cachetype = cachelist[0] + elif False not in [x in ('php7','mysql') for x in typelist]: + sitetype = 'mysql' + if not cachelist: + cachetype = 'basic' + else: + cachetype = cachelist[0] elif False not in [x in ('html','mysql') for x in typelist]: sitetype = 'mysql' if not cachelist: @@ -1101,6 +1113,12 @@ def detSitePar(opts): cachetype = 'basic' else: cachetype = cachelist[0] + elif False not in [x in ('php7','html') for x in typelist]: + sitetype = 'php' + if not cachelist: + cachetype = 'basic' + else: + cachetype = cachelist[0] elif False not in [x in ('wp','wpsubdir') for x in typelist]: sitetype = 'wpsubdir' if not cachelist: @@ -1119,22 +1137,33 @@ def detSitePar(opts): cachetype = 'basic' else: cachetype = cachelist[0] + elif False not in [x in ('wpsubdir','php7') for x in typelist]: + sitetype = 'wpsubdir' + if not cachelist: + cachetype = 'basic' + else: + cachetype = cachelist[0] + elif False not in [x in ('wpsubdomain','php7') for x in typelist]: + sitetype = 'wpsubdomain' + if not cachelist: + cachetype = 'basic' + else: + cachetype = cachelist[0] else: raise RuntimeError("could not determine site and cache type") + if not typelist and not cachelist: + sitetype = None + cachetype = None + elif (not typelist) and cachelist: + sitetype = 'wp' + cachetype = cachelist[0] + elif typelist and (not cachelist): + sitetype = typelist[0] + cachetype = 'basic' else: - if not typelist and not cachelist: - sitetype = None - cachetype = None - elif (not typelist) and cachelist: - sitetype = 'wp' - cachetype = cachelist[0] - elif typelist and (not cachelist): - sitetype = typelist[0] - cachetype = 'basic' - else: - sitetype = typelist[0] - cachetype = cachelist[0] + sitetype = typelist[0] + cachetype = cachelist[0] return (sitetype, cachetype) From b597af06e417aff15ffe907d0e9deddd1210a98b Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Fri, 19 Feb 2016 14:23:32 +0530 Subject: [PATCH 080/115] update info.py --- ee/cli/plugins/info.py | 90 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 87 insertions(+), 3 deletions(-) diff --git a/ee/cli/plugins/info.py b/ee/cli/plugins/info.py index d79eb05b..5038c2b1 100644 --- a/ee/cli/plugins/info.py +++ b/ee/cli/plugins/info.py @@ -2,6 +2,7 @@ from cement.core.controller import CementBaseController, expose from cement.core import handler, hook +from ee.core.variables import EEVariables from pynginxconfig import NginxConfig from ee.core.aptget import EEAptGet from ee.core.shellexec import EEShellExec @@ -29,6 +30,9 @@ class EEInfoController(CementBaseController): (['--php'], dict(help='Get PHP configuration information', action='store_true')), + (['--php7'], + dict(help='Get PHP 7.0 configuration information', + action='store_true')), (['--nginx'], dict(help='Get Nginx configuration information', action='store_true')), @@ -66,14 +70,14 @@ class EEInfoController(CementBaseController): version = os.popen("php -v | head -n1 | cut -d' ' -f2 |" " cut -d'+' -f1 | tr -d '\n'").read config = configparser.ConfigParser() - config.read('/etc/php5/fpm/php.ini') + config.read('/etc/{0}/fpm/php.ini'.format("php/5.6" if EEVariables.ee_platform_codename == 'trusty' else "php5")) expose_php = config['PHP']['expose_php'] memory_limit = config['PHP']['memory_limit'] post_max_size = config['PHP']['post_max_size'] upload_max_filesize = config['PHP']['upload_max_filesize'] max_execution_time = config['PHP']['max_execution_time'] - config.read('/etc/php5/fpm/pool.d/www.conf') + config.read('/etc/{0}/fpm/pool.d/www.conf'.format("php/5.6" if EEVariables.ee_platform_codename == 'trusty' else "php5")) www_listen = config['www']['listen'] www_ping_path = config['www']['ping.path'] www_pm_status_path = config['www']['pm.status_path'] @@ -91,7 +95,81 @@ class EEInfoController(CementBaseController): except Exception as e: www_xdebug = 'off' - config.read('/etc/php5/fpm/pool.d/debug.conf') + config.read('/etc/{0}/fpm/pool.d/debug.conf'.format("php/5.6" if EEVariables.ee_platform_codename == 'trusty' else "php5")) + debug_listen = config['debug']['listen'] + debug_ping_path = config['debug']['ping.path'] + debug_pm_status_path = config['debug']['pm.status_path'] + debug_pm = config['debug']['pm'] + debug_pm_max_requests = config['debug']['pm.max_requests'] + debug_pm_max_children = config['debug']['pm.max_children'] + debug_pm_start_servers = config['debug']['pm.start_servers'] + debug_pm_min_spare_servers = config['debug']['pm.min_spare_servers'] + debug_pm_max_spare_servers = config['debug']['pm.max_spare_servers'] + debug_request_terminate = (config['debug'] + ['request_terminate_timeout']) + try: + debug_xdebug = (config['debug']['php_admin_flag[xdebug.profiler_' + 'enable_trigger]']) + except Exception as e: + debug_xdebug = 'off' + + data = dict(version=version, expose_php=expose_php, + memory_limit=memory_limit, post_max_size=post_max_size, + upload_max_filesize=upload_max_filesize, + max_execution_time=max_execution_time, + www_listen=www_listen, www_ping_path=www_ping_path, + www_pm_status_path=www_pm_status_path, www_pm=www_pm, + www_pm_max_requests=www_pm_max_requests, + www_pm_max_children=www_pm_max_children, + www_pm_start_servers=www_pm_start_servers, + www_pm_min_spare_servers=www_pm_min_spare_servers, + www_pm_max_spare_servers=www_pm_max_spare_servers, + www_request_terminate_timeout=www_request_terminate_time, + www_xdebug_profiler_enable_trigger=www_xdebug, + debug_listen=debug_listen, debug_ping_path=debug_ping_path, + debug_pm_status_path=debug_pm_status_path, + debug_pm=debug_pm, + debug_pm_max_requests=debug_pm_max_requests, + debug_pm_max_children=debug_pm_max_children, + debug_pm_start_servers=debug_pm_start_servers, + debug_pm_min_spare_servers=debug_pm_min_spare_servers, + debug_pm_max_spare_servers=debug_pm_max_spare_servers, + debug_request_terminate_timeout=debug_request_terminate, + debug_xdebug_profiler_enable_trigger=debug_xdebug) + self.app.render((data), 'info_php.mustache') + + @expose(hide=True) + def info_php7(self): + """Display PHP information""" + version = os.popen("php -v | head -n1 | cut -d' ' -f2 |" + " cut -d'+' -f1 | tr -d '\n'").read + config = configparser.ConfigParser() + config.read('/etc/php/7.0/fpm/php.ini') + expose_php = config['PHP']['expose_php'] + memory_limit = config['PHP']['memory_limit'] + post_max_size = config['PHP']['post_max_size'] + upload_max_filesize = config['PHP']['upload_max_filesize'] + max_execution_time = config['PHP']['max_execution_time'] + + config.read('/etc/php/7.0/fpm/pool.d/www.conf') + www_listen = config['www']['listen'] + www_ping_path = config['www']['ping.path'] + www_pm_status_path = config['www']['pm.status_path'] + www_pm = config['www']['pm'] + www_pm_max_requests = config['www']['pm.max_requests'] + www_pm_max_children = config['www']['pm.max_children'] + www_pm_start_servers = config['www']['pm.start_servers'] + www_pm_min_spare_servers = config['www']['pm.min_spare_servers'] + www_pm_max_spare_servers = config['www']['pm.max_spare_servers'] + www_request_terminate_time = (config['www'] + ['request_terminate_timeout']) + try: + www_xdebug = (config['www']['php_admin_flag[xdebug.profiler_enable' + '_trigger]']) + except Exception as e: + www_xdebug = 'off' + + config.read('/etc/php/7.0/fpm/pool.d/debug.conf') debug_listen = config['debug']['listen'] debug_ping_path = config['debug']['ping.path'] debug_pm_status_path = config['debug']['pm.status_path'] @@ -183,6 +261,12 @@ class EEInfoController(CementBaseController): else: Log.error(self, "PHP5 is not installed") + if self.app.pargs.php7: + if EEAptGet.is_installed(self, 'php7.0-fpm'): + self.info_php7() + else: + Log.error(self, "PHP 7.0 is not installed") + if self.app.pargs.mysql: if EEShellExec.cmd_exec(self, "mysqladmin ping"): self.info_mysql() From 90d34c1af242d1ffc064854d1f3b550a5c1e6ec5 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Fri, 19 Feb 2016 14:53:37 +0530 Subject: [PATCH 081/115] Fix db issue --- ee/cli/plugins/info.py | 14 ++++++++++---- ee/cli/plugins/sitedb.py | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ee/cli/plugins/info.py b/ee/cli/plugins/info.py index 5038c2b1..cd0d9ed8 100644 --- a/ee/cli/plugins/info.py +++ b/ee/cli/plugins/info.py @@ -244,7 +244,7 @@ class EEInfoController(CementBaseController): def default(self): """default function for info""" if (not self.app.pargs.nginx and not self.app.pargs.php - and not self.app.pargs.mysql): + and not self.app.pargs.mysql and not self.app.pargs.php7): self.app.pargs.nginx = True self.app.pargs.php = True self.app.pargs.mysql = True @@ -256,10 +256,16 @@ class EEInfoController(CementBaseController): Log.error(self, "Nginx is not installed") if self.app.pargs.php: - if EEAptGet.is_installed(self, 'php5-fpm'): - self.info_php() + if EEVariables.ee_platform_codename != 'trusty': + if EEAptGet.is_installed(self, 'php5-fpm'): + self.info_php() + else: + Log.error(self, "PHP5 is not installed") else: - Log.error(self, "PHP5 is not installed") + if EEAptGet.is_installed(self, 'php5.6-fpm'): + self.info_php() + else: + Log.error(self, "PHP5.6 is not installed") if self.app.pargs.php7: if EEAptGet.is_installed(self, 'php7.0-fpm'): diff --git a/ee/cli/plugins/sitedb.py b/ee/cli/plugins/sitedb.py index ab805579..575e1fd3 100644 --- a/ee/cli/plugins/sitedb.py +++ b/ee/cli/plugins/sitedb.py @@ -42,7 +42,7 @@ def getSiteInfo(self, site): def updateSiteInfo(self, site, stype='', cache='', webroot='', enabled=True, ssl=False, fs='', db='', db_name=None, db_user=None, db_password=None, db_host=None, hhvm=None, - pagespeed=None, php_version='5.5'): + pagespeed=None, php_version=''): """updates site record in database""" try: q = SiteDB.query.filter(SiteDB.sitename == site).first() From f1c6af90d5af489878911ac7b127c0e417a21d0b Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Fri, 19 Feb 2016 16:10:21 +0530 Subject: [PATCH 082/115] update info --- ee/cli/plugins/info.py | 6 ++- ee/cli/plugins/site.py | 12 +++--- ee/cli/templates/virtualconf-php7.mustache | 49 ---------------------- 3 files changed, 11 insertions(+), 56 deletions(-) delete mode 100644 ee/cli/templates/virtualconf-php7.mustache diff --git a/ee/cli/plugins/info.py b/ee/cli/plugins/info.py index cd0d9ed8..60801ca0 100644 --- a/ee/cli/plugins/info.py +++ b/ee/cli/plugins/info.py @@ -67,7 +67,7 @@ class EEInfoController(CementBaseController): @expose(hide=True) def info_php(self): """Display PHP information""" - version = os.popen("php -v | head -n1 | cut -d' ' -f2 |" + version = os.popen("{0} -v 2>/dev/null | head -n1 | cut -d' ' -f2 |".format("php5.6" if EEVariables.ee_platform_codename == 'trusty' else "php") + " cut -d'+' -f1 | tr -d '\n'").read config = configparser.ConfigParser() config.read('/etc/{0}/fpm/php.ini'.format("php/5.6" if EEVariables.ee_platform_codename == 'trusty' else "php5")) @@ -141,7 +141,7 @@ class EEInfoController(CementBaseController): @expose(hide=True) def info_php7(self): """Display PHP information""" - version = os.popen("php -v | head -n1 | cut -d' ' -f2 |" + version = os.popen("php7.0 -v 2>/dev/null | head -n1 | cut -d' ' -f2 |" " cut -d'+' -f1 | tr -d '\n'").read config = configparser.ConfigParser() config.read('/etc/php/7.0/fpm/php.ini') @@ -248,6 +248,8 @@ class EEInfoController(CementBaseController): self.app.pargs.nginx = True self.app.pargs.php = True self.app.pargs.mysql = True + if EEAptGet.is_installed(self, 'php7.0-fpm'): + self.app.pargs.php = True if self.app.pargs.nginx: if EEAptGet.is_installed(self, 'nginx-common'): diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 73949ad7..1f36e6ad 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -931,6 +931,7 @@ class EESiteUpdateController(CementBaseController): letsencrypt = False php7 = None + data = dict() try: stype, cache = detSitePar(vars(pargs)) @@ -1061,7 +1062,6 @@ class EESiteUpdateController(CementBaseController): currsitetype=oldsitetype, currcachetype=oldcachetype, webroot=ee_site_webroot) - stype = oldsitetype cache = oldcachetype if oldsitetype == 'html' or oldsitetype == 'proxy': @@ -1135,12 +1135,14 @@ class EESiteUpdateController(CementBaseController): data['pagespeed'] = False pagespeed = False - if pargs.php7 != 'off' : + if pargs.php7 == 'on' : data['php7'] = True php7 = True + check_php_version= '7.0' elif pargs.php7 == 'off': data['php7'] = False php7 = False + check_php_version = '5.6' @@ -1479,7 +1481,7 @@ class EESiteUpdateController(CementBaseController): "check issues with `nginx -t` command") updateSiteInfo(self, ee_domain, stype=stype, cache=cache, - hhvm=hhvm, pagespeed=pagespeed,ssl=True if check_site.is_ssl else False) + hhvm=hhvm, pagespeed=pagespeed,ssl=True if check_site.is_ssl else False, php_version=check_php_version) Log.info(self, "Successfully updated site" " http://{0}".format(ee_domain)) @@ -1697,10 +1699,10 @@ class EESiteUpdateController(CementBaseController): db_user=data['ee_db_user'], db_password=data['ee_db_pass'], db_host=data['ee_db_host'], hhvm=hhvm, - pagespeed=pagespeed,ssl=True if check_site.is_ssl else False) + pagespeed=pagespeed,ssl=True if check_site.is_ssl else False,php_version=check_php_version) else: updateSiteInfo(self, ee_domain, stype=stype, cache=cache, - hhvm=hhvm, pagespeed=pagespeed,ssl=True if check_site.is_ssl else False) + hhvm=hhvm, pagespeed=pagespeed,ssl=True if check_site.is_ssl else False,php_version=check_php_version) Log.info(self, "Successfully updated site" " http://{0}".format(ee_domain)) return 0 diff --git a/ee/cli/templates/virtualconf-php7.mustache b/ee/cli/templates/virtualconf-php7.mustache deleted file mode 100644 index 4530e4fc..00000000 --- a/ee/cli/templates/virtualconf-php7.mustache +++ /dev/null @@ -1,49 +0,0 @@ - -server { - - {{#multisite}} - # Uncomment the following line for domain mapping - # listen 80 default_server; - {{/multisite}} - - server_name {{^vma}}{{^rc}}{{site_name}}{{/rc}}{{/vma}} {{#vma}}vma.*{{/vma}} {{#rc}}webmail.*{{/rc}} {{^vma}}{{^rc}}{{#multisite}}*{{/multisite}}{{^multisite}}www{{/multisite}}.{{site_name}}{{/rc}}{{/vma}}; - - {{#multisite}} - # Uncomment the following line for domain mapping - #server_name_in_redirect off; - {{/multisite}} - - access_log /var/log/nginx/{{site_name}}.access.log {{^wpredis}}{{^static}}rt_cache{{/static}}{{/wpredis}}{{#wpredis}}rt_cache_redis{{/wpredis}}; - error_log /var/log/nginx/{{site_name}}.error.log; - - {{#proxy}} - add_header X-Proxy-Cache $upstream_cache_status; - location / { - proxy_pass http://{{host}}:{{port}}; - proxy_redirect off; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } - {{/proxy}} - - {{^proxy}} - {{^vma}}{{^rc}}root {{webroot}}/htdocs;{{/rc}}{{/vma}} - {{#vma}}root /var/www/22222/htdocs/vimbadmin/public;{{/vma}} - {{#rc}}root /var/www/roundcubemail/htdocs/;{{/rc}} - - {{^proxy}}index {{^static}}index.php{{/static}} index.html index.htm;{{/proxy}} - - {{#static}} - location / { - try_files $uri $uri/ =404; - } - {{/static}} - - {{^static}}include {{^hhvm}}{{#basic}}common/php7.conf;{{/basic}}{{#w3tc}}common/w3tc-php7.conf;{{/w3tc}}{{#wpfc}}common/wpfc-php7.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php7.conf;{{/wpsc}}{{#wpredis}}common/redis-php7.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}} - {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}} - {{#wp}}include common/wpcommon.conf;{{/wp}} - {{^proxy}}include common/locations.conf;{{/proxy}} - {{^vma}}{{^rc}}include {{webroot}}/conf/nginx/*.conf;{{/rc}}{{/vma}} - {{/proxy}} -} From ece5eca068ad323f43aa89b1e450e45569f2af9e Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Fri, 19 Feb 2016 16:43:12 +0530 Subject: [PATCH 083/115] Fix php7 basic to wp basic --- ee/cli/plugins/site.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 1f36e6ad..abe82e22 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -1005,11 +1005,11 @@ class EESiteUpdateController(CementBaseController): Log.info(self, Log.FAIL + "Can not update HTML site to HHVM") return 1 - if ((stype == 'php' and oldsitetype not in ['html', 'proxy']) or + if ((stype == 'php' and oldsitetype not in ['html', 'proxy', 'php7']) or (stype == 'mysql' and oldsitetype not in ['html', 'php', - 'proxy']) or + 'proxy','php7']) or (stype == 'wp' and oldsitetype not in ['html', 'php', 'mysql', - 'proxy', 'wp']) or + 'proxy', 'wp', 'php7']) or (stype == 'wpsubdir' and oldsitetype in ['wpsubdomain']) or (stype == 'wpsubdomain' and oldsitetype in ['wpsubdir']) or (stype == oldsitetype and cache == oldcachetype) and From e82aad206964310046de5c3b2ff123a615744245 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 22 Feb 2016 11:25:50 +0530 Subject: [PATCH 084/115] Fix wpcommon-php7.conf --- ee/cli/plugins/stack.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 7b7a81f8..d6ca3fe2 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -398,6 +398,14 @@ class EEStackController(CementBaseController): self.app.render((data), 'w3tc-php7.mustache', out=ee_nginx) ee_nginx.close() + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/wpcommon.conf') + ee_nginx = open('/etc/nginx/common/wpcommon-php7.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'wpcommon-php7.mustache', + out=ee_nginx) + ee_nginx.close() + Log.debug(self, 'Writting the nginx configuration to ' 'file /etc/nginx/common/wpfc-php7.conf') ee_nginx = open('/etc/nginx/common/wpfc-php7.conf', @@ -642,6 +650,14 @@ class EEStackController(CementBaseController): self.app.render((data), 'w3tc-php7.mustache', out=ee_nginx) ee_nginx.close() + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/wpcommon.conf') + ee_nginx = open('/etc/nginx/common/wpcommon-php7.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'wpcommon-php7.mustache', + out=ee_nginx) + ee_nginx.close() + Log.debug(self, 'Writting the nginx configuration to ' 'file /etc/nginx/common/wpfc-php7.conf') ee_nginx = open('/etc/nginx/common/wpfc-php7.conf', From ac3ace42898a25daba96a0b7ede816df7b68bb8f Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 22 Feb 2016 11:34:10 +0530 Subject: [PATCH 085/115] php7 --- ee/cli/plugins/site.py | 10 ++----- ee/cli/plugins/site_functions.py | 27 ++++++++++--------- ee/cli/templates/virtualconf.mustache | 3 ++- ee/cli/templates/wpcommon-php7.mustache | 35 +++++++++++++++++++++++++ install | 2 +- 5 files changed, 54 insertions(+), 23 deletions(-) create mode 100644 ee/cli/templates/wpcommon-php7.mustache diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index abe82e22..1cb2a86d 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -636,10 +636,8 @@ class EESiteCreateController(CementBaseController): if data['php7']: php_version = "7.0" else: - if EEVariables.ee_platform_codename == 'trusty': - php_version = "5.6" - else: - php_version = "5.5" + php_version = "5.6" + addNewSite(self, ee_domain, stype, cache, ee_site_webroot, hhvm=hhvm, pagespeed=pagespeed, php_version=php_version) @@ -1144,8 +1142,6 @@ class EESiteUpdateController(CementBaseController): php7 = False check_php_version = '5.6' - - if pargs.pagespeed: if pagespeed is old_pagespeed: if pagespeed is False: @@ -1156,8 +1152,6 @@ class EESiteUpdateController(CementBaseController): "site") pargs.pagespeed = False - - if pargs.php7: if php7 is old_php7: if php7 is False: diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index 8d012839..caaba0c9 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -1114,7 +1114,7 @@ def detSitePar(opts): else: cachetype = cachelist[0] elif False not in [x in ('php7','html') for x in typelist]: - sitetype = 'php' + sitetype = 'php7' if not cachelist: cachetype = 'basic' else: @@ -1151,19 +1151,20 @@ def detSitePar(opts): cachetype = cachelist[0] else: raise RuntimeError("could not determine site and cache type") - - if not typelist and not cachelist: - sitetype = None - cachetype = None - elif (not typelist) and cachelist: - sitetype = 'wp' - cachetype = cachelist[0] - elif typelist and (not cachelist): - sitetype = typelist[0] - cachetype = 'basic' else: - sitetype = typelist[0] - cachetype = cachelist[0] + if not typelist and not cachelist: + sitetype = None + cachetype = None + elif (not typelist) and cachelist: + sitetype = 'wp' + cachetype = cachelist[0] + elif typelist and (not cachelist): + sitetype = typelist[0] + cachetype = 'basic' + else: + sitetype = typelist[0] + cachetype = cachelist[0] + return (sitetype, cachetype) diff --git a/ee/cli/templates/virtualconf.mustache b/ee/cli/templates/virtualconf.mustache index 93136ccb..a77d9fb5 100644 --- a/ee/cli/templates/virtualconf.mustache +++ b/ee/cli/templates/virtualconf.mustache @@ -42,7 +42,8 @@ server { {{^static}}include {{^php7}}{{^hhvm}}{{#basic}}common/php.conf;{{/basic}}{{#w3tc}}common/w3tc.conf;{{/w3tc}}{{#wpfc}}common/wpfc.conf;{{/wpfc}}{{#wpsc}}common/wpsc.conf;{{/wpsc}}{{#wpredis}}common/redis.conf;{{/wpredis}}{{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}}{{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}}{{/hhvm}}{{/php7}}{{#php7}}{{^hhvm}}{{#basic}}common/php7.conf;{{/basic}}{{#w3tc}}common/w3tc-php7.conf;{{/w3tc}}{{#wpfc}}common/wpfc-php7.conf;{{/wpfc}}{{#wpsc}}common/wpsc-php7.conf;{{/wpsc}}{{#wpredis}}common/redis-php7.conf;{{/wpredis}}{{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}}{{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}}{{/hhvm}}{{/php7}} {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}} - {{#wp}}include common/wpcommon.conf;{{/wp}} + {{^php7}}{{#wp}}include common/wpcommon.conf;{{/wp}}{{/php7}} + {{php7}}{{#wp}}include common/wpcommon-php7.conf;{{/wp}}{{/php7}} {{^proxy}}include common/locations.conf;{{/proxy}} {{^vma}}{{^rc}}include {{webroot}}/conf/nginx/*.conf;{{/rc}}{{/vma}} {{/proxy}} diff --git a/ee/cli/templates/wpcommon-php7.mustache b/ee/cli/templates/wpcommon-php7.mustache new file mode 100644 index 00000000..f323fb33 --- /dev/null +++ b/ee/cli/templates/wpcommon-php7.mustache @@ -0,0 +1,35 @@ +# WordPress COMMON SETTINGS +# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) +# Limit access to avoid brute force attack +location = /wp-login.php { + limit_req zone=one burst=1 nodelay; + include fastcgi_params; + fastcgi_pass php7; +} +# Disable wp-config.txt +location = /wp-config.txt { + deny all; + access_log off; + log_not_found off; +} +# Disallow php in upload folder +location /wp-content/uploads/ { + location ~ \.php$ { + #Prevent Direct Access Of PHP Files From Web Browsers + deny all; + } +} +# Yoast sitemap +location ~ ([^/]*)sitemap(.*)\.x(m|s)l$ { + rewrite ^/sitemap\.xml$ /sitemap_index.xml permanent; + rewrite ^/([a-z]+)?-?sitemap\.xsl$ /index.php?xsl=$1 last; + # Rules for yoast sitemap with wp|wpsubdir|wpsubdomain + rewrite ^.*/sitemap_index\.xml$ /index.php?sitemap=1 last; + rewrite ^.*/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last; + # Following lines are options. Needed for WordPress seo addons + rewrite ^/news_sitemap\.xml$ /index.php?sitemap=wpseo_news last; + rewrite ^/locations\.kml$ /index.php?sitemap=wpseo_local_kml last; + rewrite ^/geo_sitemap\.xml$ /index.php?sitemap=wpseo_local last; + rewrite ^/video-sitemap\.xsl$ /index.php?xsl=video last; + access_log off; +} diff --git a/install b/install index 9aa2cf90..048556ce 100644 --- a/install +++ b/install @@ -214,7 +214,7 @@ function ee_sync_db() echo "ALTER TABLE sites ADD COLUMN db_host varchar;" | sqlite3 /var/lib/ee/ee.db echo "ALTER TABLE sites ADD COLUMN is_hhvm INT DEFAULT '0';" | sqlite3 /var/lib/ee/ee.db echo "ALTER TABLE sites ADD COLUMN is_pagespeed INT DEFAULT '0';" | sqlite3 /var/lib/ee/ee.db - echo "ALTER TABLE sites ADD COLUMN php_version varchar DEFAULT '5.5';" | sqlite3 /var/lib/ee/ee.db + echo "ALTER TABLE sites ADD COLUMN php_version varchar DEFAULT '5.6';" | sqlite3 /var/lib/ee/ee.db fi } From 0f5007e6a47833f577e3ebe29174c9099b5f5e7f Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 22 Feb 2016 11:36:51 +0530 Subject: [PATCH 086/115] debug commit --- ee/cli/plugins/site.py | 4 ++++ ee/cli/plugins/site_functions.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 1cb2a86d..46125e22 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -516,6 +516,10 @@ class EESiteCreateController(CementBaseController): and (not self.app.pargs.hhvm): data['basic'] = True + for key, value in data.items() : + print("in site.py") + print (key, value) + if data and self.app.pargs.hhvm: if (not self.app.pargs.experimental): diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index caaba0c9..05ac8c0a 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -54,6 +54,9 @@ def check_domain_exists(self, domain): def setupdomain(self, data): + for key, value in data.items() : + print (key, value) + ee_domain_name = data['site_name'] ee_site_webroot = data['webroot'] if 'webroot' in data.keys() else '' From 5bbd732abdfd056fde02942d1545fbe9933417ba Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 22 Feb 2016 11:51:39 +0530 Subject: [PATCH 087/115] spliting virtualconf --- ee/cli/plugins/site.py | 2 +- ee/cli/plugins/site_functions.py | 9 ++-- ee/cli/templates/virtualconf-php7.mustache | 49 ++++++++++++++++++++++ ee/cli/templates/virtualconf.mustache | 6 +-- 4 files changed, 58 insertions(+), 8 deletions(-) create mode 100644 ee/cli/templates/virtualconf-php7.mustache diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 46125e22..e419386f 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -516,8 +516,8 @@ class EESiteCreateController(CementBaseController): and (not self.app.pargs.hhvm): data['basic'] = True + print("in site.py") for key, value in data.items() : - print("in site.py") print (key, value) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index 05ac8c0a..c3e78e7b 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -71,9 +71,12 @@ def setupdomain(self, data): ee_site_nginx_conf = open('/etc/nginx/sites-available/{0}' .format(ee_domain_name), encoding='utf-8', mode='w') - - self.app.render((data), 'virtualconf.mustache', - out=ee_site_nginx_conf) + if not data['php7']: + self.app.render((data), 'virtualconf.mustache', + out=ee_site_nginx_conf) + else: + self.app.render((data), 'virtualconf-php7.mustache', + out=ee_site_nginx_conf) ee_site_nginx_conf.close() except IOError as e: Log.debug(self, "{0}".format(e)) diff --git a/ee/cli/templates/virtualconf-php7.mustache b/ee/cli/templates/virtualconf-php7.mustache new file mode 100644 index 00000000..c5012f9c --- /dev/null +++ b/ee/cli/templates/virtualconf-php7.mustache @@ -0,0 +1,49 @@ + +server { + + {{#multisite}} + # Uncomment the following line for domain mapping + # listen 80 default_server; + {{/multisite}} + + server_name {{^vma}}{{^rc}}{{site_name}}{{/rc}}{{/vma}} {{#vma}}vma.*{{/vma}} {{#rc}}webmail.*{{/rc}} {{^vma}}{{^rc}}{{#multisite}}*{{/multisite}}{{^multisite}}www{{/multisite}}.{{site_name}}{{/rc}}{{/vma}}; + + {{#multisite}} + # Uncomment the following line for domain mapping + #server_name_in_redirect off; + {{/multisite}} + + access_log /var/log/nginx/{{site_name}}.access.log {{^wpredis}}{{^static}}rt_cache{{/static}}{{/wpredis}}{{#wpredis}}rt_cache_redis{{/wpredis}}; + error_log /var/log/nginx/{{site_name}}.error.log; + + {{#proxy}} + add_header X-Proxy-Cache $upstream_cache_status; + location / { + proxy_pass http://{{host}}:{{port}}; + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + {{/proxy}} + + {{^proxy}} + {{^vma}}{{^rc}}root {{webroot}}/htdocs;{{/rc}}{{/vma}} + {{#vma}}root /var/www/22222/htdocs/vimbadmin/public;{{/vma}} + {{#rc}}root /var/www/roundcubemail/htdocs/;{{/rc}} + + {{^proxy}}index {{^static}}index.php{{/static}} index.html index.htm;{{/proxy}} + + {{#static}} + location / { + try_files $uri $uri/ =404; + } + {{/static}} + + {{^static}}include {{^hhvm}}{{#basic}}common/php7.conf;{{/basic}}{{#w3tc}}common/w3tc-php7.conf;{{/w3tc}}{{#wpfc}}common/wpfc-php7.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php7.conf;{{/wpsc}}{{#wpredis}}common/redis-php7.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}} + {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}} + {{#wp}}include common/wpcommon-php7.conf;{{/wp}} + {{^proxy}}include common/locations.conf;{{/proxy}} + {{^vma}}{{^rc}}include {{webroot}}/conf/nginx/*.conf;{{/rc}}{{/vma}} + {{/proxy}} +} diff --git a/ee/cli/templates/virtualconf.mustache b/ee/cli/templates/virtualconf.mustache index a77d9fb5..c7d3ac43 100644 --- a/ee/cli/templates/virtualconf.mustache +++ b/ee/cli/templates/virtualconf.mustache @@ -40,10 +40,8 @@ server { } {{/static}} - {{^static}}include {{^php7}}{{^hhvm}}{{#basic}}common/php.conf;{{/basic}}{{#w3tc}}common/w3tc.conf;{{/w3tc}}{{#wpfc}}common/wpfc.conf;{{/wpfc}}{{#wpsc}}common/wpsc.conf;{{/wpsc}}{{#wpredis}}common/redis.conf;{{/wpredis}}{{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}}{{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}}{{/hhvm}}{{/php7}}{{#php7}}{{^hhvm}}{{#basic}}common/php7.conf;{{/basic}}{{#w3tc}}common/w3tc-php7.conf;{{/w3tc}}{{#wpfc}}common/wpfc-php7.conf;{{/wpfc}}{{#wpsc}}common/wpsc-php7.conf;{{/wpsc}}{{#wpredis}}common/redis-php7.conf;{{/wpredis}}{{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}}{{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}}{{/hhvm}}{{/php7}} - {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}} - {{^php7}}{{#wp}}include common/wpcommon.conf;{{/wp}}{{/php7}} - {{php7}}{{#wp}}include common/wpcommon-php7.conf;{{/wp}}{{/php7}} + {{^static}}include {{^hhvm}}{{#basic}}common/php.conf;{{/basic}}{{#w3tc}}common/w3tc.conf;{{/w3tc}}{{#wpfc}}common/wpfc.conf;{{/wpfc}} {{#wpsc}}common/wpsc.conf;{{/wpsc}}{{#wpredis}}common/redis.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}} {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}} + {{#wp}}include common/wpcommon.conf;{{/wp}} {{^proxy}}include common/locations.conf;{{/proxy}} {{^vma}}{{^rc}}include {{webroot}}/conf/nginx/*.conf;{{/rc}}{{/vma}} {{/proxy}} From ef816eeeb71131c722cddb440db6c3f9078e4368 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 22 Feb 2016 12:43:20 +0530 Subject: [PATCH 088/115] Fix --php7 major issue --- ee/cli/plugins/site_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index c3e78e7b..370b2b14 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -1161,7 +1161,7 @@ def detSitePar(opts): if not typelist and not cachelist: sitetype = None cachetype = None - elif (not typelist) and cachelist: + elif (not typelist or "php7" in typelist) and cachelist: sitetype = 'wp' cachetype = cachelist[0] elif typelist and (not cachelist): From 29698daa6e41455d5e29fa2ea516cdbf13159b47 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 22 Feb 2016 14:02:39 +0530 Subject: [PATCH 089/115] update locations.conf --- ee/cli/plugins/stack.py | 16 +++++ ee/cli/templates/locations-php7.mustache | 68 ++++++++++++++++++++++ ee/cli/templates/virtualconf-php7.mustache | 2 +- 3 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 ee/cli/templates/locations-php7.mustache diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index d6ca3fe2..9a52e830 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -383,6 +383,14 @@ class EEStackController(CementBaseController): if EEVariables.ee_platform_codename == 'trusty' and (not os.path.isfile("/etc/nginx/common/php7.conf")): #data = dict() + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/locations.conf') + ee_nginx = open('/etc/nginx/common/locations.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'locations-php7.mustache', + out=ee_nginx) + ee_nginx.close() + Log.debug(self, 'Writting the nginx configuration to ' 'file /etc/nginx/common/php7.conf') ee_nginx = open('/etc/nginx/common/php7.conf', @@ -635,6 +643,14 @@ class EEStackController(CementBaseController): if os.path.isdir("/etc/nginx/common") and (not os.path.isfile("/etc/nginx/common/php7.conf")): data = dict() + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/locations.conf') + ee_nginx = open('/etc/nginx/common/locations.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'locations-php7.mustache', + out=ee_nginx) + ee_nginx.close() + Log.debug(self, 'Writting the nginx configuration to ' 'file /etc/nginx/common/php7.conf') ee_nginx = open('/etc/nginx/common/php7.conf', diff --git a/ee/cli/templates/locations-php7.mustache b/ee/cli/templates/locations-php7.mustache new file mode 100644 index 00000000..7c437e18 --- /dev/null +++ b/ee/cli/templates/locations-php7.mustache @@ -0,0 +1,68 @@ +# NGINX CONFIGURATION FOR COMMON LOCATION +# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee) +# Basic locations files +location = /favicon.ico { + access_log off; + log_not_found off; + expires max; +} +location = /robots.txt { + # Some WordPress plugin gererate robots.txt file + # Refer #340 issue + try_files $uri $uri/ /index.php?$args; + access_log off; + log_not_found off; +} +# Cache static files +location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|swf)$ { + add_header "Access-Control-Allow-Origin" "*"; + access_log off; + log_not_found off; + expires max; +} +# Security settings for better privacy +# Deny hidden files +location ~ /\.well-known { + allow all; +} +location ~ /\. { + deny all; + access_log off; + log_not_found off; +} +# Deny backup extensions & log files +location ~* ^.+\.(bak|log|old|orig|original|php#|php~|php_bak|save|swo|swp|sql)$ { + deny all; + access_log off; + log_not_found off; +} +# Return 403 forbidden for readme.(txt|html) or license.(txt|html) or example.(txt|html) +if ($uri ~* "^.+(readme|license|example)\.(txt|html)$") { + return 403; +} +# Status pages +location /nginx_status { + stub_status on; + access_log off; + include common/acl.conf; +} +location ~ ^/(status|ping) { + include fastcgi_params; + fastcgi_pass php7; + include common/acl.conf; +} +# EasyEngine (ee) utilities +# phpMyAdmin settings +location /pma { + return 301 https://$host:22222/db/pma; +} +location /phpMyAdmin { + return 301 https://$host:22222/db/pma; +} +location /phpmyadmin { + return 301 https://$host:22222/db/pma; +} +# Adminer settings +location /adminer { + return 301 https://$host:22222/db/adminer; +} diff --git a/ee/cli/templates/virtualconf-php7.mustache b/ee/cli/templates/virtualconf-php7.mustache index c5012f9c..681eb35b 100644 --- a/ee/cli/templates/virtualconf-php7.mustache +++ b/ee/cli/templates/virtualconf-php7.mustache @@ -43,7 +43,7 @@ server { {{^static}}include {{^hhvm}}{{#basic}}common/php7.conf;{{/basic}}{{#w3tc}}common/w3tc-php7.conf;{{/w3tc}}{{#wpfc}}common/wpfc-php7.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php7.conf;{{/wpsc}}{{#wpredis}}common/redis-php7.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}} {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}} {{#wp}}include common/wpcommon-php7.conf;{{/wp}} - {{^proxy}}include common/locations.conf;{{/proxy}} + {{^proxy}}include common/locations-php7.conf;{{/proxy}} {{^vma}}{{^rc}}include {{webroot}}/conf/nginx/*.conf;{{/rc}}{{/vma}} {{/proxy}} } From 653c21e07664d0bcba6c6c416e98dd4896d8ea90 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 22 Feb 2016 14:23:18 +0530 Subject: [PATCH 090/115] Fix php version issue --- ee/cli/plugins/sitedb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/cli/plugins/sitedb.py b/ee/cli/plugins/sitedb.py index 575e1fd3..b3cca14e 100644 --- a/ee/cli/plugins/sitedb.py +++ b/ee/cli/plugins/sitedb.py @@ -88,7 +88,7 @@ def updateSiteInfo(self, site, stype='', cache='', webroot='', q.is_pagespeed = pagespeed if php_version and q.php_version != php_version: - q.is_php7 = php_version + q.php_version = php_version try: q.created_on = func.now() From 0b478883c772e7d889df409eb6f45af16371ab12 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 22 Feb 2016 14:35:45 +0530 Subject: [PATCH 091/115] Fix php7 basic to php basic update --- ee/cli/plugins/site.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index e419386f..8f0a7606 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -1008,6 +1008,7 @@ class EESiteUpdateController(CementBaseController): return 1 if ((stype == 'php' and oldsitetype not in ['html', 'proxy', 'php7']) or + # (stype == 'php7' and oldsitetype not in ['html', 'mysql', 'php', 'php7', 'wp', 'wpsubdir', 'wpsubdomain', ]) or (stype == 'mysql' and oldsitetype not in ['html', 'php', 'proxy','php7']) or (stype == 'wp' and oldsitetype not in ['html', 'php', 'mysql', @@ -1015,7 +1016,7 @@ class EESiteUpdateController(CementBaseController): (stype == 'wpsubdir' and oldsitetype in ['wpsubdomain']) or (stype == 'wpsubdomain' and oldsitetype in ['wpsubdir']) or (stype == oldsitetype and cache == oldcachetype) and - not pargs.pagespeed): + not (pargs.pagespeed or pargs.php7)): Log.info(self, Log.FAIL + "can not update {0} {1} to {2} {3}". format(oldsitetype, oldcachetype, stype, cache)) return 1 From 6a910ea552e6fc1d727714d7c64a7c2bebf1b700 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 22 Feb 2016 14:52:09 +0530 Subject: [PATCH 092/115] Fix nginx config error --- ee/cli/plugins/site_functions.py | 16 ++++++++++++++++ ee/cli/plugins/stack.py | 12 ++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index 370b2b14..509e35be 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -857,6 +857,14 @@ def site_package_check(self, stype): if os.path.isdir("/etc/nginx/common") and (not os.path.isfile("/etc/nginx/common/php7.conf")): data = dict() + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/locations-php7.conf') + ee_nginx = open('/etc/nginx/common/locations-php7.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'locations-php7.mustache', + out=ee_nginx) + ee_nginx.close() + Log.debug(self, 'Writting the nginx configuration to ' 'file /etc/nginx/common/php7.conf') ee_nginx = open('/etc/nginx/common/php7.conf', @@ -872,6 +880,14 @@ def site_package_check(self, stype): self.app.render((data), 'w3tc-php7.mustache', out=ee_nginx) ee_nginx.close() + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/wpcommon-php7.conf') + ee_nginx = open('/etc/nginx/common/wpcommon-php7.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'wpcommon-php7.mustache', + out=ee_nginx) + ee_nginx.close() + Log.debug(self, 'Writting the nginx configuration to ' 'file /etc/nginx/common/wpfc-php7.conf') ee_nginx = open('/etc/nginx/common/wpfc-php7.conf', diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 9a52e830..fdf85b45 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -384,8 +384,8 @@ class EEStackController(CementBaseController): os.path.isfile("/etc/nginx/common/php7.conf")): #data = dict() Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/locations.conf') - ee_nginx = open('/etc/nginx/common/locations.conf', + 'file /etc/nginx/common/locations-php7.conf') + ee_nginx = open('/etc/nginx/common/locations-php7.conf', encoding='utf-8', mode='w') self.app.render((data), 'locations-php7.mustache', out=ee_nginx) @@ -407,7 +407,7 @@ class EEStackController(CementBaseController): ee_nginx.close() Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/wpcommon.conf') + 'file /etc/nginx/common/wpcommon-php7.conf') ee_nginx = open('/etc/nginx/common/wpcommon-php7.conf', encoding='utf-8', mode='w') self.app.render((data), 'wpcommon-php7.mustache', @@ -644,8 +644,8 @@ class EEStackController(CementBaseController): os.path.isfile("/etc/nginx/common/php7.conf")): data = dict() Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/locations.conf') - ee_nginx = open('/etc/nginx/common/locations.conf', + 'file /etc/nginx/common/locations-php7.conf') + ee_nginx = open('/etc/nginx/common/locations-php7.conf', encoding='utf-8', mode='w') self.app.render((data), 'locations-php7.mustache', out=ee_nginx) @@ -667,7 +667,7 @@ class EEStackController(CementBaseController): ee_nginx.close() Log.debug(self, 'Writting the nginx configuration to ' - 'file /etc/nginx/common/wpcommon.conf') + 'file /etc/nginx/common/wpcommon-php7.conf') ee_nginx = open('/etc/nginx/common/wpcommon-php7.conf', encoding='utf-8', mode='w') self.app.render((data), 'wpcommon-php7.mustache', From 6b83d3db87e6207c1cf39fecd98a8bb331b165a9 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 22 Feb 2016 15:27:09 +0530 Subject: [PATCH 093/115] removed debug code --- ee/cli/plugins/site.py | 6 +++--- ee/cli/plugins/site_functions.py | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 8f0a7606..0f326dbf 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -516,9 +516,9 @@ class EESiteCreateController(CementBaseController): and (not self.app.pargs.hhvm): data['basic'] = True - print("in site.py") - for key, value in data.items() : - print (key, value) + #for debug purpose + #for key, value in data.items() : + # print (key, value) if data and self.app.pargs.hhvm: diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index 509e35be..9d9d0a3a 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -54,8 +54,9 @@ def check_domain_exists(self, domain): def setupdomain(self, data): - for key, value in data.items() : - print (key, value) + #for debug purpose + # for key, value in data.items() : + # print (key, value) ee_domain_name = data['site_name'] ee_site_webroot = data['webroot'] if 'webroot' in data.keys() else '' From 4ecce3a20793906452b8571536e8d08773bd12ed Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 22 Feb 2016 18:58:00 +0530 Subject: [PATCH 094/115] install script --- install | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/install b/install index 048556ce..0475260f 100644 --- a/install +++ b/install @@ -207,6 +207,7 @@ function ee_sync_db() done else + ee_php_version=$(php -v | head -n1 | cut -d' ' -f2 |cut -c1-3) ee_lib_echo "Updating EasyEngine Database" echo "ALTER TABLE sites ADD COLUMN db_name varchar;" | sqlite3 /var/lib/ee/ee.db echo "ALTER TABLE sites ADD COLUMN db_user varchar; " | sqlite3 /var/lib/ee/ee.db @@ -214,7 +215,7 @@ function ee_sync_db() echo "ALTER TABLE sites ADD COLUMN db_host varchar;" | sqlite3 /var/lib/ee/ee.db echo "ALTER TABLE sites ADD COLUMN is_hhvm INT DEFAULT '0';" | sqlite3 /var/lib/ee/ee.db echo "ALTER TABLE sites ADD COLUMN is_pagespeed INT DEFAULT '0';" | sqlite3 /var/lib/ee/ee.db - echo "ALTER TABLE sites ADD COLUMN php_version varchar DEFAULT '5.6';" | sqlite3 /var/lib/ee/ee.db + echo "ALTER TABLE sites ADD COLUMN php_version varchar DEFAULT \"$ee_php_version\";" | sqlite3 /var/lib/ee/ee.db fi } @@ -323,6 +324,20 @@ function ee_update_latest() fi fi + if [ "$ee_distro_version" == "trusty" ]; then + + if [ -f /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list ]; then + add-apt-repository -y -remove 'ppa:ondrej/php5-5.6' + add-apt-repository -y 'ppa:ondrej/php' + mv /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list.old &>> /dev/null + apt-get update + apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install php5.6-fpm php5.6-curl php5.6-gd php5.6-imap php5.6-mcrypt php5.6-readline php5.6-mysql php5.6-cli php5.6-common php7.0-common php-memcached php-imagick memcached graphviz php-pear php-xdebug + service php5-fpm stop &>> /dev/null + service php5.6-fpm restart &>> /dev/null + apt-get -y remove php5-fpm php5-curl php5-gd php5-imap php5-mcrypt php5-common php5-readline php5-mysql php5-cli php5-memcache php5-imagick memcached graphviz php-pear + fi + fi + if [ -f /etc/nginx/nginx.conf ]; then ee_lib_echo "Updating Nginx configuration, please wait..." # From version 3.1.10 we are using Suse builder for repository @@ -604,7 +619,11 @@ else ee_update_latest | tee -ai $ee_install_log ee_git_init | tee -ai $ee_install_log service nginx reload &>> /dev/null - service php5-fpm restart &>> /dev/null + if [ "$ee_distro_version" == "trusty" ]; then + service php5.6-fpm restart &>> /dev/null + else + service php5-fpm restart &>> /dev/null + fi ee_update_wp_cli | tee -ai $ee_install_log else ee_lib_error "Not updating EasyEngine to $ee_version_new, exit status = " 1 From 12906ffa44230078ad6688f027713937b6184027 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 23 Feb 2016 11:52:41 +0530 Subject: [PATCH 095/115] Fix php install script --- ee/cli/plugins/stack.py | 4 ++-- install | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index fdf85b45..cb3934cf 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -1145,7 +1145,7 @@ class EEStackController(CementBaseController): EEVariables.ee_php_user, EEVariables.ee_php_user, recursive=True) - EEGit.add(self, ["/etc/php5.6"], msg="Adding PHP into Git") + EEGit.add(self, ["/etc/php"], msg="Adding PHP into Git") EEService.restart_service(self, 'php5.6-fpm') #preconfiguration for php7.0 @@ -1284,7 +1284,7 @@ class EEStackController(CementBaseController): EEVariables.ee_php_user, EEVariables.ee_php_user, recursive=True) - EEGit.add(self, ["/etc/php7.0"], msg="Adding PHP into Git") + EEGit.add(self, ["/etc/php"], msg="Adding PHP into Git") EEService.restart_service(self, 'php7.0-fpm') diff --git a/install b/install index 0475260f..5060b7be 100644 --- a/install +++ b/install @@ -329,12 +329,16 @@ function ee_update_latest() if [ -f /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list ]; then add-apt-repository -y -remove 'ppa:ondrej/php5-5.6' add-apt-repository -y 'ppa:ondrej/php' - mv /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list.old &>> /dev/null + rm /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list &>> /dev/null apt-get update apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install php5.6-fpm php5.6-curl php5.6-gd php5.6-imap php5.6-mcrypt php5.6-readline php5.6-mysql php5.6-cli php5.6-common php7.0-common php-memcached php-imagick memcached graphviz php-pear php-xdebug + cp -f /etc/php5/fpm/pool.d/www.conf /etc/php/5.6/fpm/pool.d/www.conf + cp -f /etc/php5/fpm/pool.d/debug.conf /etc/php/5.6/fpm/pool.d/debug.conf + cp -f /etc/php5/fpm/php.ini /etc/php/5.6/fpm/php.ini + cp -f /etc/php5/fpm/php-fpm.conf /etc/php5/fpm/php-fpm.conf service php5-fpm stop &>> /dev/null service php5.6-fpm restart &>> /dev/null - apt-get -y remove php5-fpm php5-curl php5-gd php5-imap php5-mcrypt php5-common php5-readline php5-mysql php5-cli php5-memcache php5-imagick memcached graphviz php-pear + apt-get remove -y php5-fpm php5-curl php5-gd php5-imap php5-mcrypt php5-common php5-readline php5-mysql php5-cli php5-memcache php5-imagick memcached graphviz php-pear fi fi @@ -574,6 +578,16 @@ function ee_git_init() git add -A . git commit -am "Installed/Updated to EasyEngine 3.x" &>> /dev/null + #PHP under git version control + if [ -d /etc/php ];then + cd /etc/php + if [ ! -d /etc/php/.git ]; then + git init &>> /dev/null + fi + git add -A . + git commit -am "Updated PHP" > /dev/null + fi + } # Update EasyEngine From 66cdad35edf0aef496267107d4a47b04b52eafcb Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 23 Feb 2016 12:34:37 +0530 Subject: [PATCH 096/115] Fix --remove --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index 5060b7be..46c2ed94 100644 --- a/install +++ b/install @@ -327,7 +327,7 @@ function ee_update_latest() if [ "$ee_distro_version" == "trusty" ]; then if [ -f /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list ]; then - add-apt-repository -y -remove 'ppa:ondrej/php5-5.6' + add-apt-repository -y --remove 'ppa:ondrej/php5-5.6' add-apt-repository -y 'ppa:ondrej/php' rm /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list &>> /dev/null apt-get update From 075ef1f0a26401ebf132bc509441ba9ef221a7b6 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 23 Feb 2016 13:13:34 +0530 Subject: [PATCH 097/115] Update install --- install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install b/install index 46c2ed94..a3f67fa9 100644 --- a/install +++ b/install @@ -329,13 +329,13 @@ function ee_update_latest() if [ -f /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list ]; then add-apt-repository -y --remove 'ppa:ondrej/php5-5.6' add-apt-repository -y 'ppa:ondrej/php' - rm /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list &>> /dev/null + rm -f /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list &>> /dev/null apt-get update - apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install php5.6-fpm php5.6-curl php5.6-gd php5.6-imap php5.6-mcrypt php5.6-readline php5.6-mysql php5.6-cli php5.6-common php7.0-common php-memcached php-imagick memcached graphviz php-pear php-xdebug + apt-get -y install php5.6-fpm php5.6-curl php5.6-gd php5.6-imap php5.6-mcrypt php5.6-readline php5.6-mysql php5.6-cli php5.6-common php7.0-common php-memcached php-imagick memcached graphviz php-pear php-xdebug cp -f /etc/php5/fpm/pool.d/www.conf /etc/php/5.6/fpm/pool.d/www.conf cp -f /etc/php5/fpm/pool.d/debug.conf /etc/php/5.6/fpm/pool.d/debug.conf cp -f /etc/php5/fpm/php.ini /etc/php/5.6/fpm/php.ini - cp -f /etc/php5/fpm/php-fpm.conf /etc/php5/fpm/php-fpm.conf + cp -f /etc/php5/fpm/php-fpm.conf /etc/php/5.6/fpm/php-fpm.conf service php5-fpm stop &>> /dev/null service php5.6-fpm restart &>> /dev/null apt-get remove -y php5-fpm php5-curl php5-gd php5-imap php5-mcrypt php5-common php5-readline php5-mysql php5-cli php5-memcache php5-imagick memcached graphviz php-pear From eac12573abbe111acb98e47c523e551d7fb49f40 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 23 Feb 2016 15:13:51 +0530 Subject: [PATCH 098/115] install --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index a3f67fa9..65f81c21 100644 --- a/install +++ b/install @@ -327,7 +327,7 @@ function ee_update_latest() if [ "$ee_distro_version" == "trusty" ]; then if [ -f /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list ]; then - add-apt-repository -y --remove 'ppa:ondrej/php5-5.6' + # add-apt-repository -y --remove 'ppa:ondrej/php5-5.6' add-apt-repository -y 'ppa:ondrej/php' rm -f /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list &>> /dev/null apt-get update From c190896db7da7a5555afc978d3bcf8b139e07a2b Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 23 Feb 2016 16:07:06 +0530 Subject: [PATCH 099/115] Fix service_status --- ee/core/services.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ee/core/services.py b/ee/core/services.py index 0e4e8758..b0c52766 100644 --- a/ee/core/services.py +++ b/ee/core/services.py @@ -112,10 +112,12 @@ class EEService(): .format(service_name)) def get_service_status(self, service_name): + + try: is_exist = subprocess.getstatusoutput('which {0}' .format(service_name)) - if is_exist[0] == 0: + if is_exist[0] == 0 or service_name in ['php7.0-fpm', 'php5.6-fpm']: retcode = subprocess.getstatusoutput('service {0} status' .format(service_name)) if retcode[0] == 0: From b65208660f563f9272c1d9e26d47957ab1ab21cd Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 23 Feb 2016 16:25:52 +0530 Subject: [PATCH 100/115] error handling --- install | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/install b/install index 65f81c21..44ce0818 100644 --- a/install +++ b/install @@ -325,19 +325,22 @@ function ee_update_latest() fi if [ "$ee_distro_version" == "trusty" ]; then - if [ -f /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list ]; then # add-apt-repository -y --remove 'ppa:ondrej/php5-5.6' add-apt-repository -y 'ppa:ondrej/php' - rm -f /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list &>> /dev/null - apt-get update - apt-get -y install php5.6-fpm php5.6-curl php5.6-gd php5.6-imap php5.6-mcrypt php5.6-readline php5.6-mysql php5.6-cli php5.6-common php7.0-common php-memcached php-imagick memcached graphviz php-pear php-xdebug - cp -f /etc/php5/fpm/pool.d/www.conf /etc/php/5.6/fpm/pool.d/www.conf - cp -f /etc/php5/fpm/pool.d/debug.conf /etc/php/5.6/fpm/pool.d/debug.conf - cp -f /etc/php5/fpm/php.ini /etc/php/5.6/fpm/php.ini - cp -f /etc/php5/fpm/php-fpm.conf /etc/php/5.6/fpm/php-fpm.conf + apt-get update 2&>>1 $EE_INSTALL_LOG + apt-get -y install php5.6-fpm php5.6-curl php5.6-gd php5.6-imap php5.6-mcrypt php5.6-readline php5.6-mysql php5.6-cli php5.6-common php7.0-common php-memcached php-imagick memcached graphviz php-pear php-xdebug || ee_lib_error "Unable to install depedencies, exit status " 1 + if [ -e /etc/php5/fpm/pool.d/www.conf -a -e /etc/php5/fpm/pool.d/debug.conf -a -e /etc/php5/fpm/php.ini -a -e /etc/php5/fpm/php-fpm.conf ]; then + cp -f /etc/php5/fpm/pool.d/www.conf /etc/php/5.6/fpm/pool.d/www.conf &>> /dev/null + cp -f /etc/php5/fpm/pool.d/debug.conf /etc/php/5.6/fpm/pool.d/debug.conf &>> /dev/null + cp -f /etc/php5/fpm/php.ini /etc/php/5.6/fpm/php.ini &>> /dev/null + cp -f /etc/php5/fpm/php-fpm.conf /etc/php/5.6/fpm/php-fpm.conf &>> /dev/null + else + echo "Some files are missing." || ee_lib_error "Unable to configure PHP5.6 packages, exit status " 1 + fi service php5-fpm stop &>> /dev/null service php5.6-fpm restart &>> /dev/null + rm -f /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list &>> /dev/null apt-get remove -y php5-fpm php5-curl php5-gd php5-imap php5-mcrypt php5-common php5-readline php5-mysql php5-cli php5-memcache php5-imagick memcached graphviz php-pear fi fi From ffc5f8df5774c020b524c8bdc32964e9c3b21296 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 23 Feb 2016 18:07:58 +0530 Subject: [PATCH 101/115] Fix install and stack_upgrade --- ee/cli/plugins/stack_upgrade.py | 17 +++++++++--- install | 47 +++++++++++++++++++-------------- 2 files changed, 41 insertions(+), 23 deletions(-) diff --git a/ee/cli/plugins/stack_upgrade.py b/ee/cli/plugins/stack_upgrade.py index 4801b7b1..f2627a2e 100644 --- a/ee/cli/plugins/stack_upgrade.py +++ b/ee/cli/plugins/stack_upgrade.py @@ -159,10 +159,21 @@ class EEStackUpgradeController(CementBaseController): Log.info(self, "Nginx Mainline is not already installed") if self.app.pargs.php: - if EEAptGet.is_installed(self, 'php5-fpm'): - apt_packages = apt_packages + EEVariables.ee_php + if EEVariables.ee_platform_codename != 'trusty': + if EEAptGet.is_installed(self, 'php5-fpm'): + apt_packages = apt_packages + EEVariables.ee_php + else: + Log.info(self, "PHP is not installed") else: - Log.info(self, "PHP is not installed") + if EEAptGet.is_installed(self, 'php5.6-fpm'): + apt_packages = apt_packages + EEVariables.ee_php5_6 + EEVariables.ee_php_extra + else: + Log.info(self, "PHP 5.6 is not installed") + + if EEAptGet.is_installed(self, 'php7.0-fpm'): + apt_packages = apt_packages + EEVariables.ee_php7_0 + EEVariables.ee_php_extra + else: + Log.info(self, "PHP 7.0 is not installed") if self.app.pargs.hhvm: if EEAptGet.is_installed(self, 'hhvm'): diff --git a/install b/install index 44ce0818..78821c33 100644 --- a/install +++ b/install @@ -296,6 +296,31 @@ function ee_update() ln -s /usr/local/bin/ee /usr/local/sbin/ee || ee_lib_error "Unable to create softlink to old EasyEngine, exit status " $? } +function ee_upgrade_php(){ + #Upgrade PHP5.6 to a new repo supporting PHP 7.0 + if [ "$ee_distro_version" == "trusty" ]; then + if [ -f /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list ]; then + # add-apt-repository -y --remove 'ppa:ondrej/php5-5.6' + add-apt-repository -y 'ppa:ondrej/php' + apt-get update 2&>>1 $EE_INSTALL_LOG + apt-get -y install php5.6-fpm php5.6-curl php5.6-gd php5.6-imap php5.6-mcrypt php5.6-readline php5.6-mysql php5.6-cli php5.6-common php7.0-common php-memcached php-imagick memcached graphviz php-pear php-xdebug || ee_lib_error "Unable to install PHP 5.6 packages, exit status " 1 + if [ -e /etc/php5/fpm/pool.d/www.conf -a -e /etc/php5/fpm/pool.d/debug.conf -a -e /etc/php5/fpm/php.ini -a -e /etc/php5/fpm/php-fpm.conf ]; then + cp -f /etc/php5/fpm/pool.d/www.conf /etc/php/5.6/fpm/pool.d/www.conf &>> /dev/null + cp -f /etc/php5/fpm/pool.d/debug.conf /etc/php/5.6/fpm/pool.d/debug.conf &>> /dev/null + cp -f /etc/php5/fpm/php.ini /etc/php/5.6/fpm/php.ini &>> /dev/null + cp -f /etc/php5/fpm/php-fpm.conf /etc/php/5.6/fpm/php-fpm.conf &>> /dev/null + else + echo "Some files are missing." || ee_lib_error "Unable to configure PHP5.6 packages, exit status " 1 + fi + service php5-fpm stop &>> /dev/null + service php5.6-fpm restart &>> /dev/null + rm -f /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list &>> /dev/null + apt-get remove -y php5-fpm php5-curl php5-gd php5-imap php5-mcrypt php5-common php5-readline php5-mysql php5-cli php5-memcache php5-imagick memcached graphviz php-pear + fi + fi + +} + function ee_update_latest() { #Move ~/.my.cnf to /etc/mysql/conf.d/my.cnf @@ -324,26 +349,6 @@ function ee_update_latest() fi fi - if [ "$ee_distro_version" == "trusty" ]; then - if [ -f /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list ]; then - # add-apt-repository -y --remove 'ppa:ondrej/php5-5.6' - add-apt-repository -y 'ppa:ondrej/php' - apt-get update 2&>>1 $EE_INSTALL_LOG - apt-get -y install php5.6-fpm php5.6-curl php5.6-gd php5.6-imap php5.6-mcrypt php5.6-readline php5.6-mysql php5.6-cli php5.6-common php7.0-common php-memcached php-imagick memcached graphviz php-pear php-xdebug || ee_lib_error "Unable to install depedencies, exit status " 1 - if [ -e /etc/php5/fpm/pool.d/www.conf -a -e /etc/php5/fpm/pool.d/debug.conf -a -e /etc/php5/fpm/php.ini -a -e /etc/php5/fpm/php-fpm.conf ]; then - cp -f /etc/php5/fpm/pool.d/www.conf /etc/php/5.6/fpm/pool.d/www.conf &>> /dev/null - cp -f /etc/php5/fpm/pool.d/debug.conf /etc/php/5.6/fpm/pool.d/debug.conf &>> /dev/null - cp -f /etc/php5/fpm/php.ini /etc/php/5.6/fpm/php.ini &>> /dev/null - cp -f /etc/php5/fpm/php-fpm.conf /etc/php/5.6/fpm/php-fpm.conf &>> /dev/null - else - echo "Some files are missing." || ee_lib_error "Unable to configure PHP5.6 packages, exit status " 1 - fi - service php5-fpm stop &>> /dev/null - service php5.6-fpm restart &>> /dev/null - rm -f /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list &>> /dev/null - apt-get remove -y php5-fpm php5-curl php5-gd php5-imap php5-mcrypt php5-common php5-readline php5-mysql php5-cli php5-memcache php5-imagick memcached graphviz php-pear - fi - fi if [ -f /etc/nginx/nginx.conf ]; then ee_lib_echo "Updating Nginx configuration, please wait..." @@ -611,6 +616,7 @@ if [ -f /usr/local/sbin/easyengine ]; then ee_install_dep | tee -ai $ee_install_log ee_sync_db 2&>>1 $EE_INSTALL_LOG secure_ee_db | tee -ai $EE_INSTALL_LOG + ee_upgrade_php | tee -ai $ee_install_log ee_install | tee -ai $ee_install_log ee_update | tee -ai $ee_install_log ee_update_latest | tee -ai $ee_install_log @@ -632,6 +638,7 @@ else ee_install_dep | tee -ai $ee_install_log ee_sync_db 2&>>1 $EE_INSTALL_LOG secure_ee_db | tee -ai $EE_INSTALL_LOG + ee_upgrade_php | tee -ai $ee_install_log ee_install | tee -ai $ee_install_log ee_update_latest | tee -ai $ee_install_log ee_git_init | tee -ai $ee_install_log From 6554cd5fccc60f912b533f4bf3d25939eaa5beb5 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 23 Feb 2016 18:17:48 +0530 Subject: [PATCH 102/115] &>> /dev/null --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index 78821c33..52f75afc 100644 --- a/install +++ b/install @@ -302,7 +302,7 @@ function ee_upgrade_php(){ if [ -f /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list ]; then # add-apt-repository -y --remove 'ppa:ondrej/php5-5.6' add-apt-repository -y 'ppa:ondrej/php' - apt-get update 2&>>1 $EE_INSTALL_LOG + apt-get update &>> /dev/null apt-get -y install php5.6-fpm php5.6-curl php5.6-gd php5.6-imap php5.6-mcrypt php5.6-readline php5.6-mysql php5.6-cli php5.6-common php7.0-common php-memcached php-imagick memcached graphviz php-pear php-xdebug || ee_lib_error "Unable to install PHP 5.6 packages, exit status " 1 if [ -e /etc/php5/fpm/pool.d/www.conf -a -e /etc/php5/fpm/pool.d/debug.conf -a -e /etc/php5/fpm/php.ini -a -e /etc/php5/fpm/php-fpm.conf ]; then cp -f /etc/php5/fpm/pool.d/www.conf /etc/php/5.6/fpm/pool.d/www.conf &>> /dev/null From b46e3b9fb2220b8546190a4c4edb98b080b99e45 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Tue, 23 Feb 2016 19:42:32 +0530 Subject: [PATCH 103/115] Fix --debug for php5.6 trusty --- install | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/install b/install index 52f75afc..3e0fd019 100644 --- a/install +++ b/install @@ -302,6 +302,7 @@ function ee_upgrade_php(){ if [ -f /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list ]; then # add-apt-repository -y --remove 'ppa:ondrej/php5-5.6' add-apt-repository -y 'ppa:ondrej/php' + ee_lib_echo "Updating required packages, please wait..." apt-get update &>> /dev/null apt-get -y install php5.6-fpm php5.6-curl php5.6-gd php5.6-imap php5.6-mcrypt php5.6-readline php5.6-mysql php5.6-cli php5.6-common php7.0-common php-memcached php-imagick memcached graphviz php-pear php-xdebug || ee_lib_error "Unable to install PHP 5.6 packages, exit status " 1 if [ -e /etc/php5/fpm/pool.d/www.conf -a -e /etc/php5/fpm/pool.d/debug.conf -a -e /etc/php5/fpm/php.ini -a -e /etc/php5/fpm/php-fpm.conf ]; then @@ -312,6 +313,13 @@ function ee_upgrade_php(){ else echo "Some files are missing." || ee_lib_error "Unable to configure PHP5.6 packages, exit status " 1 fi + sed -i "s/pid.*/pid = \/run\/php\/php5.6-fpm.pid/" /etc/php/5.6/fpm/php-fpm.conf && \ + sed -i "s/error_log.*/error_log = \/var\/log\/php\/5.6\/fpm.log/" /etc/php/5.6/fpm/php-fpm.conf && \ + sed -i "s/log_level.*/log_level = notice/" /etc/php/5.6/fpm/php-fpm.conf && \ + sed -i "s/include.*/include = \/etc\/php\/5.6\/fpm\/pool.d\/*.conf/" /etc/php/5.6/fpm/php-fpm.conf && \ + sed -i "s/slowlog.*/slowlog = \/var\/log\/php\/5.6\/slow.log" /etc/php/5.6/fpm/pool.d/debug.conf || ee_lib_error "Unable to update configuration, exit status " $? + mkdir -p /var/log/php/5.6/ + touch /var/log/php/5.6/slow.log /var/log/php/5.6/fpm.log service php5-fpm stop &>> /dev/null service php5.6-fpm restart &>> /dev/null rm -f /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list &>> /dev/null From 4c53c0776ce5d3ec6c8af9f7679ca0afac41e2d9 Mon Sep 17 00:00:00 2001 From: prabuddha Date: Tue, 23 Feb 2016 21:13:15 +0530 Subject: [PATCH 104/115] Fix typo --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index 3e0fd019..65575a02 100644 --- a/install +++ b/install @@ -317,7 +317,7 @@ function ee_upgrade_php(){ sed -i "s/error_log.*/error_log = \/var\/log\/php\/5.6\/fpm.log/" /etc/php/5.6/fpm/php-fpm.conf && \ sed -i "s/log_level.*/log_level = notice/" /etc/php/5.6/fpm/php-fpm.conf && \ sed -i "s/include.*/include = \/etc\/php\/5.6\/fpm\/pool.d\/*.conf/" /etc/php/5.6/fpm/php-fpm.conf && \ - sed -i "s/slowlog.*/slowlog = \/var\/log\/php\/5.6\/slow.log" /etc/php/5.6/fpm/pool.d/debug.conf || ee_lib_error "Unable to update configuration, exit status " $? + sed -i "s/slowlog.*/slowlog = \/var\/log\/php\/5.6\/slow.log/" /etc/php/5.6/fpm/pool.d/debug.conf || ee_lib_error "Unable to update configuration, exit status " $? mkdir -p /var/log/php/5.6/ touch /var/log/php/5.6/slow.log /var/log/php/5.6/fpm.log service php5-fpm stop &>> /dev/null From 17cd9076d12cd20f8ce6c3897a15737feade6d0d Mon Sep 17 00:00:00 2001 From: prabuddha Date: Tue, 23 Feb 2016 21:41:03 +0530 Subject: [PATCH 105/115] Fix typo --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index 65575a02..982850fc 100644 --- a/install +++ b/install @@ -317,7 +317,7 @@ function ee_upgrade_php(){ sed -i "s/error_log.*/error_log = \/var\/log\/php\/5.6\/fpm.log/" /etc/php/5.6/fpm/php-fpm.conf && \ sed -i "s/log_level.*/log_level = notice/" /etc/php/5.6/fpm/php-fpm.conf && \ sed -i "s/include.*/include = \/etc\/php\/5.6\/fpm\/pool.d\/*.conf/" /etc/php/5.6/fpm/php-fpm.conf && \ - sed -i "s/slowlog.*/slowlog = \/var\/log\/php\/5.6\/slow.log/" /etc/php/5.6/fpm/pool.d/debug.conf || ee_lib_error "Unable to update configuration, exit status " $? + sed -i "s/slowlog /slowlog = \/var\/log\/php\/5.6\/slow.log/" /etc/php/5.6/fpm/pool.d/debug.conf || ee_lib_error "Unable to update configuration, exit status " $? mkdir -p /var/log/php/5.6/ touch /var/log/php/5.6/slow.log /var/log/php/5.6/fpm.log service php5-fpm stop &>> /dev/null From 807c552eedb69ec2d71e74d9d929f32e403f1b61 Mon Sep 17 00:00:00 2001 From: prabuddha Date: Wed, 24 Feb 2016 02:28:41 +0530 Subject: [PATCH 106/115] Fix zlib issue --- ee/core/variables.py | 4 ++-- install | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ee/core/variables.py b/ee/core/variables.py index cdc0093c..45c1e8d4 100644 --- a/ee/core/variables.py +++ b/ee/core/variables.py @@ -121,10 +121,10 @@ class EEVariables(): elif ee_platform_codename == 'trusty': ee_php_repo = "ppa:ondrej/php" ee_php5_6 = ["php5.6-fpm", "php5.6-curl", "php5.6-gd", "php5.6-imap", - "php5.6-mcrypt", "php5.6-readline", + "php5.6-mcrypt", "php5.6-readline", "php5.6-zlib", "php5.6-zip", "php5.6-mysql", "php5.6-cli"] ee_php7_0 = ["php7.0-fpm", "php7.0-curl", "php7.0-gd", "php7.0-imap", - "php7.0-mcrypt", "php7.0-readline", + "php7.0-mcrypt", "php7.0-readline", "php7.0-zlib", "php7.0-zip", "php7.0-mysql", "php7.0-cli"] ee_php_extra = ["php5.6-common", "php7.0-common", "php-memcached", "php-imagick", "memcached", "graphviz", "php-pear", "php-xdebug"] diff --git a/install b/install index 982850fc..8fbac2d2 100644 --- a/install +++ b/install @@ -304,7 +304,7 @@ function ee_upgrade_php(){ add-apt-repository -y 'ppa:ondrej/php' ee_lib_echo "Updating required packages, please wait..." apt-get update &>> /dev/null - apt-get -y install php5.6-fpm php5.6-curl php5.6-gd php5.6-imap php5.6-mcrypt php5.6-readline php5.6-mysql php5.6-cli php5.6-common php7.0-common php-memcached php-imagick memcached graphviz php-pear php-xdebug || ee_lib_error "Unable to install PHP 5.6 packages, exit status " 1 + apt-get -y install php5.6-fpm php5.6-curl php5.6-gd php5.6-imap php5.6-mcrypt php5.6-readline php5.6-mysql php5.6-cli php5.6-common php5.6-zlib php7.0-common php-memcached php-imagick memcached graphviz php-pear php-xdebug || ee_lib_error "Unable to install PHP 5.6 packages, exit status " 1 if [ -e /etc/php5/fpm/pool.d/www.conf -a -e /etc/php5/fpm/pool.d/debug.conf -a -e /etc/php5/fpm/php.ini -a -e /etc/php5/fpm/php-fpm.conf ]; then cp -f /etc/php5/fpm/pool.d/www.conf /etc/php/5.6/fpm/pool.d/www.conf &>> /dev/null cp -f /etc/php5/fpm/pool.d/debug.conf /etc/php/5.6/fpm/pool.d/debug.conf &>> /dev/null From 02f06835ddac826e7187774aa50583ec17bd0c26 Mon Sep 17 00:00:00 2001 From: prabuddha Date: Wed, 24 Feb 2016 02:40:21 +0530 Subject: [PATCH 107/115] removed zib --- ee/core/variables.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ee/core/variables.py b/ee/core/variables.py index 45c1e8d4..4b8ba5d1 100644 --- a/ee/core/variables.py +++ b/ee/core/variables.py @@ -121,10 +121,10 @@ class EEVariables(): elif ee_platform_codename == 'trusty': ee_php_repo = "ppa:ondrej/php" ee_php5_6 = ["php5.6-fpm", "php5.6-curl", "php5.6-gd", "php5.6-imap", - "php5.6-mcrypt", "php5.6-readline", "php5.6-zlib", "php5.6-zip", + "php5.6-mcrypt", "php5.6-readline", "php5.6-zlib", "php5.6-mysql", "php5.6-cli"] ee_php7_0 = ["php7.0-fpm", "php7.0-curl", "php7.0-gd", "php7.0-imap", - "php7.0-mcrypt", "php7.0-readline", "php7.0-zlib", "php7.0-zip", + "php7.0-mcrypt", "php7.0-readline", "php7.0-zlib", "php7.0-mysql", "php7.0-cli"] ee_php_extra = ["php5.6-common", "php7.0-common", "php-memcached", "php-imagick", "memcached", "graphviz", "php-pear", "php-xdebug"] From ac9eccc3554242fb622516b9d649f27432ed062f Mon Sep 17 00:00:00 2001 From: prabuddha Date: Wed, 24 Feb 2016 03:00:27 +0530 Subject: [PATCH 108/115] php-common --- ee/core/variables.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ee/core/variables.py b/ee/core/variables.py index 4b8ba5d1..ff76b6c5 100644 --- a/ee/core/variables.py +++ b/ee/core/variables.py @@ -121,12 +121,12 @@ class EEVariables(): elif ee_platform_codename == 'trusty': ee_php_repo = "ppa:ondrej/php" ee_php5_6 = ["php5.6-fpm", "php5.6-curl", "php5.6-gd", "php5.6-imap", - "php5.6-mcrypt", "php5.6-readline", "php5.6-zlib", + "php5.6-mcrypt", "php5.6-readline", "php5.6-common", "php5.6-mysql", "php5.6-cli"] ee_php7_0 = ["php7.0-fpm", "php7.0-curl", "php7.0-gd", "php7.0-imap", - "php7.0-mcrypt", "php7.0-readline", "php7.0-zlib", + "php7.0-mcrypt", "php7.0-readline", "php7.0-common", "php7.0-mysql", "php7.0-cli"] - ee_php_extra = ["php5.6-common", "php7.0-common", "php-memcached", "php-imagick", "memcached", + ee_php_extra = ["php-memcached", "php-imagick", "memcached", "graphviz", "php-pear", "php-xdebug"] elif ee_platform_distro == 'debian': if ee_platform_codename == 'wheezy': From f23027296cd629ec2f48f6090e585222c769a33a Mon Sep 17 00:00:00 2001 From: prabuddha Date: Wed, 24 Feb 2016 03:12:16 +0530 Subject: [PATCH 109/115] removed php7.0-common --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index 8fbac2d2..9a2f1762 100644 --- a/install +++ b/install @@ -304,7 +304,7 @@ function ee_upgrade_php(){ add-apt-repository -y 'ppa:ondrej/php' ee_lib_echo "Updating required packages, please wait..." apt-get update &>> /dev/null - apt-get -y install php5.6-fpm php5.6-curl php5.6-gd php5.6-imap php5.6-mcrypt php5.6-readline php5.6-mysql php5.6-cli php5.6-common php5.6-zlib php7.0-common php-memcached php-imagick memcached graphviz php-pear php-xdebug || ee_lib_error "Unable to install PHP 5.6 packages, exit status " 1 + apt-get -y install php5.6-fpm php5.6-curl php5.6-gd php5.6-imap php5.6-mcrypt php5.6-readline php5.6-mysql php5.6-cli php5.6-common php-memcached php-imagick memcached graphviz php-pear php-xdebug || ee_lib_error "Unable to install PHP 5.6 packages, exit status " 1 if [ -e /etc/php5/fpm/pool.d/www.conf -a -e /etc/php5/fpm/pool.d/debug.conf -a -e /etc/php5/fpm/php.ini -a -e /etc/php5/fpm/php-fpm.conf ]; then cp -f /etc/php5/fpm/pool.d/www.conf /etc/php/5.6/fpm/pool.d/www.conf &>> /dev/null cp -f /etc/php5/fpm/pool.d/debug.conf /etc/php/5.6/fpm/pool.d/debug.conf &>> /dev/null From 692d0e1d73381e9ba4c6f795fbd5f3a9a9101f15 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 24 Feb 2016 12:38:06 +0530 Subject: [PATCH 110/115] Fix minor issue and dep --- config/bash_completion.d/ee_auto.rc | 40 ++++++++++++++--------------- docs/ee.8 | 24 +++++++++-------- ee/core/variables.py | 2 +- install | 4 +-- 4 files changed, 37 insertions(+), 33 deletions(-) diff --git a/config/bash_completion.d/ee_auto.rc b/config/bash_completion.d/ee_auto.rc index 14b62d95..70229210 100644 --- a/config/bash_completion.d/ee_auto.rc +++ b/config/bash_completion.d/ee_auto.rc @@ -29,7 +29,7 @@ _ee_complete() # IF YOU HAD ANOTHER CONTROLLER, YOU'D HANDLE THAT HERE "debug") COMPREPLY=( $(compgen \ - -W "$(command find /etc/nginx/sites-enabled/ -type l -printf "%P " 2> /dev/null) --nginx --php --fpm --mysql -i --interactive --all --import-slow-log --import-slow-log-interval= --nginx=off --php=off --fpm=off --mysql=off --all=off " \ + -W "$(command find /etc/nginx/sites-enabled/ -type l -printf "%P " 2> /dev/null) --nginx --php --php7 --fpm --fpm7 --mysql -i --interactive --all --import-slow-log --import-slow-log-interval= --nginx=off --php=off --php7=off --fpm=off --fpm7=off --mysql=off --all=off " \ -- $cur) ) ;; @@ -53,7 +53,7 @@ _ee_complete() "info") COMPREPLY=( $(compgen \ - -W "--mysql --php --nginx" \ + -W "--mysql --php --php7 --nginx" \ -- $cur) ) ;; @@ -74,17 +74,17 @@ _ee_complete() # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE "install" | "purge" | "remove" ) COMPREPLY=( $(compgen \ - -W "--pagespeed --web --admin --mail --nginx --nginxmainline --php --mysql --postfix --wpcli --phpmyadmin --adminer --utils --all --mailscanner --hhvm --redis --phpredisadmin" \ + -W "--pagespeed --web --admin --mail --nginx --nginxmainline --php --php7 --mysql --postfix --wpcli --phpmyadmin --adminer --utils --all --mailscanner --hhvm --redis --phpredisadmin" \ -- $cur) ) ;; "upgrade" ) COMPREPLY=( $(compgen \ - -W "--web --mail --nginx --php --mysql --postfix --all --hhvm --php56 --no-prompt --wpcli" \ + -W "--web --mail --nginx --php --php7 --mysql --postfix --all --hhvm --php56 --no-prompt --wpcli" \ -- $cur) ) ;; "start" | "stop" | "reload" | "restart" | "status") COMPREPLY=( $(compgen \ - -W "--nginx --php --mysql --postfix --memcache --dovecot --redis" \ + -W "--nginx --php --php7 --mysql --postfix --memcache --dovecot --redis" \ -- $cur) ) ;; "migrate") @@ -142,7 +142,7 @@ _ee_complete() ;; esac - if [ ${COMP_WORDS[1]} == "debug" ] && ([ "$prev" != "--start" ] && [ "$prev" != "--nginx" ] && [ "$prev" != "--php" ] && [ "$prev" != "--fpm" ] && [ "$prev" != "--mysql" ] && [ "$prev" != "-i" ] && [ "$prev" != "--interactive" ] && [ "$prev" != "--import-slow-log" ] && [ "$prev" != "--stop" ]); then + if [ ${COMP_WORDS[1]} == "debug" ] && ([ "$prev" != "--start" ] && [ "$prev" != "--nginx" ] && [ "$prev" != "--php" ] && [ "$prev" != "--php7" ] && [ "$prev" != "--fpm" ] && [ "$prev" != "--fpm7" ] && [ "$prev" != "--mysql" ] && [ "$prev" != "-i" ] && [ "$prev" != "--interactive" ] && [ "$prev" != "--import-slow-log" ] && [ "$prev" != "--stop" ]); then retlist="--all --wp --rewrite -i --all=off --wp=off --rewrite=off" ret="${retlist[@]/$prev}" COMPREPLY=( $(compgen \ @@ -165,13 +165,13 @@ _ee_complete() "create") COMPREPLY=( $(compgen \ - -W "--user --pass --email --html --php --mysql --wp --wpsubdir --wpsubdomain --w3tc --wpfc --wpsc --hhvm --proxy= --pagespeed --wpredis --letsencrypt -le" \ + -W "--user --pass --email --html --php --php7 --mysql --wp --wpsubdir --wpsubdomain --w3tc --wpfc --wpsc --hhvm --proxy= --pagespeed --wpredis --letsencrypt -le" \ -- $cur) ) ;; "update") COMPREPLY=( $(compgen \ - -W "--password --php --mysql --wp --wpsubdir --wpsubdomain --w3tc --wpfc --wpsc --hhvm --hhvm=off --pagespeed --pagespeed=off --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew" \ + -W "--password --php --php7 --mysql --wp --wpsubdir --wpsubdomain --w3tc --wpfc --wpsc --hhvm --hhvm=off --pagespeed --pagespeed=off --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew" \ -- $cur) ) ;; "delete") @@ -217,9 +217,9 @@ _ee_complete() "--wp") if [ ${COMP_WORDS[1]} != "debug" ]; then if [ ${COMP_WORDS[2]} == "create" ]; then - retlist="--wp --wpsc --w3tc --wpfc --pagespeed --hhvm --user --email --pass --wpredis --letsencrypt" + retlist="--wp --wpsc --w3tc --wpfc --pagespeed --hhvm --user --email --pass --wpredis --letsencrypt --php7" elif [ ${COMP_WORDS[2]} == "update" ]; then - retlist="--wp --w3tc --wpfc --wpsc --pagespeed --hhvm --pagespeed=off --hhvm=off --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew" + retlist="--wp --w3tc --wpfc --wpsc --php7 --php7=off --pagespeed --hhvm --pagespeed=off --hhvm=off --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew" else retlist="" fi @@ -236,9 +236,9 @@ _ee_complete() "--wpsubdir" | "--wpsubdomain") if [ ${COMP_WORDS[1]} != "debug" ]; then if [ ${COMP_WORDS[2]} == "create" ]; then - retlist="--wpsc --w3tc --wpfc --pagespeed --hhvm --user --email --pass --wpredis --letsencrypt" + retlist="--wpsc --w3tc --wpfc --pagespeed --hhvm --user --email --pass --wpredis --letsencrypt --php7" elif [ ${COMP_WORDS[2]} == "update" ]; then - retlist="--w3tc --wpfc --wpsc --pagespeed --hhvm --pagespeed=off --hhvm=off --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew" + retlist="--w3tc --wpfc --wpsc --php7 --php7=off --pagespeed --hhvm --pagespeed=off --hhvm=off --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew" else retlist="" fi @@ -254,7 +254,7 @@ _ee_complete() "--pagespeed" | "--hhvm" | "--wpredis" | "--w3tc" | "--wpfc" | "--wpsc" | "--wpsubdir" | "--wpsubdomain" | "--user" | "--pass" | "--email" | "--wp") if [ ${COMP_WORDS[2]} == "create" ]; then - retlist="--user --pass --email --wp --wpsubdir --wpsubdomain --w3tc --wpfc --wpsc --hhvm --pagespeed --experimenal --wpredis --letsencrypt" + retlist="--user --pass --email --wp --wpsubdir --wpsubdomain --w3tc --wpfc --wpsc --hhvm --pagespeed --experimenal --wpredis --php7 --letsencrypt " else retlist="" fi @@ -267,7 +267,7 @@ _ee_complete() "--pagespeed" | "--hhvm" | "--wpredis" | "--w3tc" | "--wpfc") if [ ${COMP_WORDS[2]} == "update" ]; then - retlist="--password --php --mysql --wp --wpsubdir --wpsubdomain --w3tc --wpfc --wpsc --hhvm --hhvm=off --pagespeed --pagespeed=off --experimenal --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew" + retlist="--password --php --php7 --mysql --wp --wpsubdir --wpsubdomain --w3tc --wpfc --wpsc --hhvm --hhvm=off --pagespeed --pagespeed=off --experimenal --wpredis --letsencrypt --letsencrypt=off --letsencrypt=renew" else retlist="" fi @@ -278,15 +278,15 @@ _ee_complete() -- $cur) ) ;; - "--web" | "--admin" | "--mail" | "--nginx" | "--php" | "--mysql" | "--postfix" | "--wpcli" | "--phpmyadmin" | "--adminer" | "--utils" | "--memcache" | "--dovecot" | "--redis | --phpredisadmin") + "--web" | "--admin" | "--mail" | "--nginx" | "--php" | "--php7" | "--mysql" | "--postfix" | "--wpcli" | "--phpmyadmin" | "--adminer" | "--utils" | "--memcache" | "--dovecot" | "--redis | --phpredisadmin") if [[ ${COMP_WORDS[2]} == "install" || ${COMP_WORDS[2]} == "purge" || ${COMP_WORDS[2]} == "remove" ]]; then - retlist="--web --admin --mail --nginx --php --mysql --postfix --wpcli --phpmyadmin --adminer --utils --memcache --dovecot --redis --phpredisadmin" + retlist="--web --admin --mail --nginx --php --php7 --mysql --postfix --wpcli --phpmyadmin --adminer --utils --memcache --dovecot --redis --phpredisadmin" elif [[ ${COMP_WORDS[2]} == "start" || ${COMP_WORDS[2]} == "reload" || ${COMP_WORDS[2]} == "restart" || ${COMP_WORDS[2]} == "stop" ]]; then - retlist="--nginx --php --mysql --postfix --memcache --dovecot --redis" + retlist="--nginx --php --php7 --mysql --postfix --memcache --dovecot --redis" elif [[ ${COMP_WORDS[1]} == "debug" ]]; then - retlist="--start --nginx --php --fpm --mysql -i --interactive -stop --import-slow-log --import-slow-log-interval= -" + retlist="--start --nginx --php --php7 --fpm --fpm7 --mysql -i --interactive -stop --import-slow-log --import-slow-log-interval= -" if [[ $prev == '--mysql' ]]; then - retlist="--start --nginx --php --fpm --mysql -i --interactive --stop --import-slow-log" + retlist="--start --nginx --php --php7 --fpm --fpm7 --mysql -i --interactive --stop --import-slow-log" fi elif [[ ${COMP_WORDS[1]} == "log" ]]; then if [ ${COMP_WORDS[2]} == "show" ]; then @@ -369,7 +369,7 @@ _ee_complete() case "$mprev" in "--user" | "--email" | "--pass") if [ ${COMP_WORDS[2]} == "create" ]; then - retlist="--user --pass --email --html --php --mysql --wp --wpsubdir --wpsubdomain --w3tc --wpfc --wpsc --hhvm --pagespeed --wpredis --letsencrypt" + retlist="--user --pass --email --html --php --php7 --mysql --wp --wpsubdir --wpsubdomain --w3tc --wpfc --wpsc --hhvm --pagespeed --wpredis --letsencrypt" fi ret="${retlist[@]/$prev}" COMPREPLY=( $(compgen \ diff --git a/docs/ee.8 b/docs/ee.8 index e6a46a0c..cf794179 100644 --- a/docs/ee.8 +++ b/docs/ee.8 @@ -5,15 +5,15 @@ .SH SYNOPSIS ee [ --version | --help | info | stack | site | debug | update | clean | import_slow_log | log | secure | sync] .TP -ee stack [ install | remove | purge | migrate | upgrade] [ --web | --mail | --all | --nginx | --nginxmainline | --php | --mysql | --admin | --postfix | --mailscanner | --adminer | --redis | --hhvm | --phpmyadmin | --phpredisadmin | --wpcli | --utils ] +ee stack [ install | remove | purge | migrate | upgrade] [ --web | --mail | --all | --nginx | --nginxmainline | --php | --php7 | --mysql | --admin | --postfix | --mailscanner | --adminer | --redis | --hhvm | --phpmyadmin | --phpredisadmin | --wpcli | --utils ] .TP -ee stack [ status | start | stop | reload | restart ] [--all | --nginx | --php | --mysql | --devcot | --web | --postfix | --memcache | --redis] +ee stack [ status | start | stop | reload | restart ] [--all | --nginx | --php | --php7 |--mysql | --devcot | --web | --postfix | --memcache | --redis] .TP ee site [ list | info | show | enable | disable | edit | cd | show ] [ example.com ] .TP -ee site create example.com [ --html | --php | --mysql] [[--wp | --wpsubdir | --wpsubdomain ] [--wpsc | --w3tc | --wpfc | --wpredis | --hhvm | --pagespeed | --letsencrypt/-le]] +ee site create example.com [ --html | --php | --php7 | --mysql] [[--wp | --wpsubdir | --wpsubdomain ] [--wpsc | --w3tc | --wpfc | --wpredis | --hhvm | --pagespeed | --letsencrypt/-le]] .TP -ee site update example.com [ --php | --mysql] [[--wp | --wpsubdir | --wpsubdomain ] [--wpsc | --w3tc | --wpfc | --wpredis | --hhvm | --pagespeed ] [--password] [--letsencrypt=on/off/renew]] +ee site update example.com [ --php | --php7 |--mysql] [[--wp | --wpsubdir | --wpsubdomain ] [--wpsc | --w3tc | --wpfc | --wpredis | --hhvm | --pagespeed ] [--password] [--letsencrypt=on/off/renew]] .TP ee site delete example.com [--db | --files | --all | --no-prompt | --force/-f ] .TP @@ -46,19 +46,19 @@ Display easyengine (ee) help. .TP .B stack .TP -.B install [ --all | --web | --mail | --nginx | --php | --mysql | --redis | --postfix | --adminer | --phpmyadmin | --phpredismyadmin | --wpcli | --utils ] +.B install [ --all | --web | --mail | --nginx | --php | --php7 |--mysql | --redis | --postfix | --adminer | --phpmyadmin | --phpredismyadmin | --wpcli | --utils ] .br Install Nginx PHP5 MySQL Postfix stack Packages if not used with .br any options.Installs specific package if used with option. .TP -.B remove [ --all | --web | --mail | --nginx | --php | --mysql | --redis | --postfix | --adminer | --phpmyadmin | --phpredismyadmin | --wpcli | --utils ] +.B remove [ --all | --web | --mail | --nginx | --php | --php7 |--mysql | --redis | --postfix | --adminer | --phpmyadmin | --phpredismyadmin | --wpcli | --utils ] .br Remove Nginx PHP5 MySQL Postfix stack Packages if not used with .br any options. Remove specific package if used with option. .TP -.B purge [ --all | --web | --mail | --nginx | --php | --mysql | --redis | --postfix | --adminer | --phpmyadmin | --phpredismyadmin | --wpcli | --utils ] +.B purge [ --all | --web | --mail | --nginx | --php | --php7 |--mysql | --redis | --postfix | --adminer | --phpmyadmin | --phpredismyadmin | --wpcli | --utils ] .br Purge Nginx PHP5 MySQL Postfix stack Packages if not used with any .br @@ -129,13 +129,13 @@ Disable site by Destroying softlink with site file in .br Edit NGINX configuration of site. .TP -.B create [ example.com ] [ --html | --php | --mysql] [[--wp | --wpsubdir | --wpsubdomain ] [--wpsc | --w3tc | --wpfc | --wpredis | --hhvm | --pagespeed ]] +.B create [ example.com ] [ --html | --php | --php7 |--mysql] [[--wp | --wpsubdir | --wpsubdomain ] [--wpsc | --w3tc | --wpfc | --wpredis | --hhvm | --pagespeed ]] .br Create new site according to given options. If no options provided .br create static site with html only. .TP -.B update [ example.com ] [ --html | --php | --mysql] [[--wp | --wpsubdir | --wpsubdomain ] [ --wpsc | --w3tc | --wpfc | --wpredis | --hhvm | --pagespeed ] [--password]] +.B update [ example.com ] [ --html | --php | --php7 |--mysql] [[--wp | --wpsubdir | --wpsubdomain ] [ --wpsc | --w3tc | --wpfc | --wpredis | --hhvm | --pagespeed ] [--password]] .br Update site configuration according to specified options. .TP @@ -143,7 +143,7 @@ Update site configuration according to specified options. .br Delete site i.e webroot, database, ad configuration permanently. .TP -.B debug [ -i | --nginx=on/off | --php=on/off | --mysql=on/off | --rewrite=on/off | --fpm=on/off ] +.B debug [ -i | --nginx=on/off | --php=on/off | --php7=on/off | --mysql=on/off | --rewrite=on/off | --fpm=on/off | --fpm7=on/off ] .br Starts server level debugging. If this is used without arguments it will start debugging .br @@ -182,6 +182,10 @@ used with ee debug command. used to start or stop nginx debugging. .br used with ee debug command. used to start or stop php debugging. .TP +.B --php7=on/off +.br +used with ee debug command. used to start or stop php7 debugging. +.TP .B --mysql=on/off .br used with ee debug command. used to start or stop mysql debugging. diff --git a/ee/core/variables.py b/ee/core/variables.py index ff76b6c5..6ac5df1e 100644 --- a/ee/core/variables.py +++ b/ee/core/variables.py @@ -127,7 +127,7 @@ class EEVariables(): "php7.0-mcrypt", "php7.0-readline", "php7.0-common", "php7.0-mysql", "php7.0-cli"] ee_php_extra = ["php-memcached", "php-imagick", "memcached", - "graphviz", "php-pear", "php-xdebug"] + "graphviz", "php-pear", "php-xdebug", "php-msgpack"] elif ee_platform_distro == 'debian': if ee_platform_codename == 'wheezy': ee_php_repo = ("deb http://packages.dotdeb.org {codename}-php56 all" diff --git a/install b/install index 9a2f1762..ab4818af 100644 --- a/install +++ b/install @@ -304,7 +304,7 @@ function ee_upgrade_php(){ add-apt-repository -y 'ppa:ondrej/php' ee_lib_echo "Updating required packages, please wait..." apt-get update &>> /dev/null - apt-get -y install php5.6-fpm php5.6-curl php5.6-gd php5.6-imap php5.6-mcrypt php5.6-readline php5.6-mysql php5.6-cli php5.6-common php-memcached php-imagick memcached graphviz php-pear php-xdebug || ee_lib_error "Unable to install PHP 5.6 packages, exit status " 1 + apt-get -y install php5.6-fpm php5.6-curl php5.6-gd php5.6-imap php5.6-mcrypt php5.6-readline php5.6-mysql php5.6-cli php5.6-common php-memcached php-imagick memcached graphviz php-pear php-xdebug php-msgpack || ee_lib_error "Unable to install PHP 5.6 packages, exit status " 1 if [ -e /etc/php5/fpm/pool.d/www.conf -a -e /etc/php5/fpm/pool.d/debug.conf -a -e /etc/php5/fpm/php.ini -a -e /etc/php5/fpm/php-fpm.conf ]; then cp -f /etc/php5/fpm/pool.d/www.conf /etc/php/5.6/fpm/pool.d/www.conf &>> /dev/null cp -f /etc/php5/fpm/pool.d/debug.conf /etc/php/5.6/fpm/pool.d/debug.conf &>> /dev/null @@ -317,7 +317,7 @@ function ee_upgrade_php(){ sed -i "s/error_log.*/error_log = \/var\/log\/php\/5.6\/fpm.log/" /etc/php/5.6/fpm/php-fpm.conf && \ sed -i "s/log_level.*/log_level = notice/" /etc/php/5.6/fpm/php-fpm.conf && \ sed -i "s/include.*/include = \/etc\/php\/5.6\/fpm\/pool.d\/*.conf/" /etc/php/5.6/fpm/php-fpm.conf && \ - sed -i "s/slowlog /slowlog = \/var\/log\/php\/5.6\/slow.log/" /etc/php/5.6/fpm/pool.d/debug.conf || ee_lib_error "Unable to update configuration, exit status " $? + sed -i "s/slowlog =.*/slowlog = \/var\/log\/php\/5.6\/slow.log/" /etc/php/5.6/fpm/pool.d/debug.conf || ee_lib_error "Unable to update configuration, exit status " $? mkdir -p /var/log/php/5.6/ touch /var/log/php/5.6/slow.log /var/log/php/5.6/fpm.log service php5-fpm stop &>> /dev/null From 78655b0abc28cf211c9601dcc4177529effbd5a2 Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Wed, 24 Feb 2016 13:34:55 +0530 Subject: [PATCH 111/115] Create ISSUE_TEMPLATE.md --- .github/ISSUE_TEMPLATE.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..20c97962 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,6 @@ +Please attach the output of following command when open a new support request. + +- [ ] lsb_release -a +- [ ] ee -v +- [ ] ee info +- [ ] wp --allow-root --info From 8bd6f4c66f4aecd932399674bd7bc4ee15417377 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 24 Feb 2016 14:12:42 +0530 Subject: [PATCH 112/115] Fix stack_upgrade --- ee/cli/plugins/stack_upgrade.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ee/cli/plugins/stack_upgrade.py b/ee/cli/plugins/stack_upgrade.py index f2627a2e..78bce4eb 100644 --- a/ee/cli/plugins/stack_upgrade.py +++ b/ee/cli/plugins/stack_upgrade.py @@ -67,7 +67,7 @@ class EEStackUpgradeController(CementBaseController): Log.error(self, "Unable to find PHP 5.5") Log.info(self, "During PHP update process non nginx-cached" - " parts of your site may remain down") + " parts of your site may remain down.") # Check prompt if (not self.app.pargs.no_prompt): @@ -86,7 +86,10 @@ class EEStackUpgradeController(CementBaseController): Log.info(self, "Updating apt-cache, please wait...") EEAptGet.update(self) Log.info(self, "Installing packages, please wait ...") - EEAptGet.install(self, EEVariables.ee_php) + if EEVariables.ee_platform_codename == 'trusty': + EEAptGet.install(self, EEVariables.ee_php5_6 + EEVariables.ee_php_extra) + else: + EEAptGet.install(self, EEVariables.ee_php) if EEVariables.ee_platform_distro == "debian": EEShellExec.cmd_exec(self, "pecl install xdebug") @@ -239,6 +242,10 @@ class EEStackUpgradeController(CementBaseController): EEService.restart_service(self, 'nginx') if set(EEVariables.ee_php).issubset(set(apt_packages)): EEService.restart_service(self, 'php5-fpm') + if set(EEVariables.ee_php5_6).issubset(set(apt_packages)): + EEService.restart_service(self, 'php5.6-fpm') + if set(EEVariables.ee_php7_0).issubset(set(apt_packages)): + EEService.restart_service(self, 'php7.0-fpm') if set(EEVariables.ee_hhvm).issubset(set(apt_packages)): EEService.restart_service(self, 'hhvm') if set(EEVariables.ee_postfix).issubset(set(apt_packages)): From bddb8cc10123084263ed5f69182c4bd9f67fbb34 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 24 Feb 2016 14:22:04 +0530 Subject: [PATCH 113/115] Fix minor issue --- CHANGELOG.txt | 5 ++++- ee/cli/plugins/stack_upgrade.py | 14 ++++++++------ install | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 84c0abb1..bdc72016 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,8 @@ v3.5.0 - Feb 17, 2016 -- Added PHP 7.0 support for UBUNTU(Trusty) +- Added PHP 7.0 support for Ubuntu(Trusty) +- Dual support for PHP 5.6 + PHP 7.0 +- Removed old repository for PHP +- Fixed minor issues v3.4.1 - Jan 20, 2016 - Fixed and update ee stack install --nginx/--nginxmainline diff --git a/ee/cli/plugins/stack_upgrade.py b/ee/cli/plugins/stack_upgrade.py index 78bce4eb..24560dc6 100644 --- a/ee/cli/plugins/stack_upgrade.py +++ b/ee/cli/plugins/stack_upgrade.py @@ -240,12 +240,14 @@ class EEStackUpgradeController(CementBaseController): if (set(EEVariables.ee_nginx).issubset(set(apt_packages)) or set(EEVariables.ee_nginx_dev).issubset(set(apt_packages))): EEService.restart_service(self, 'nginx') - if set(EEVariables.ee_php).issubset(set(apt_packages)): - EEService.restart_service(self, 'php5-fpm') - if set(EEVariables.ee_php5_6).issubset(set(apt_packages)): - EEService.restart_service(self, 'php5.6-fpm') - if set(EEVariables.ee_php7_0).issubset(set(apt_packages)): - EEService.restart_service(self, 'php7.0-fpm') + if EEVariables.ee_platform_codename != 'trusty': + if set(EEVariables.ee_php).issubset(set(apt_packages)): + EEService.restart_service(self, 'php5-fpm') + else: + if set(EEVariables.ee_php5_6).issubset(set(apt_packages)): + EEService.restart_service(self, 'php5.6-fpm') + if set(EEVariables.ee_php7_0).issubset(set(apt_packages)): + EEService.restart_service(self, 'php7.0-fpm') if set(EEVariables.ee_hhvm).issubset(set(apt_packages)): EEService.restart_service(self, 'hhvm') if set(EEVariables.ee_postfix).issubset(set(apt_packages)): diff --git a/install b/install index ab4818af..f95be037 100644 --- a/install +++ b/install @@ -302,7 +302,7 @@ function ee_upgrade_php(){ if [ -f /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list ]; then # add-apt-repository -y --remove 'ppa:ondrej/php5-5.6' add-apt-repository -y 'ppa:ondrej/php' - ee_lib_echo "Updating required packages, please wait..." + ee_lib_echo "Upgrading required packages, please wait..." apt-get update &>> /dev/null apt-get -y install php5.6-fpm php5.6-curl php5.6-gd php5.6-imap php5.6-mcrypt php5.6-readline php5.6-mysql php5.6-cli php5.6-common php-memcached php-imagick memcached graphviz php-pear php-xdebug php-msgpack || ee_lib_error "Unable to install PHP 5.6 packages, exit status " 1 if [ -e /etc/php5/fpm/pool.d/www.conf -a -e /etc/php5/fpm/pool.d/debug.conf -a -e /etc/php5/fpm/php.ini -a -e /etc/php5/fpm/php-fpm.conf ]; then From 2d93667a3690662754c587c50b9ee51113aa8b86 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 24 Feb 2016 14:36:10 +0530 Subject: [PATCH 114/115] Update CHANGELOG --- CHANGELOG.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index bdc72016..ad4ccd76 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,7 +1,6 @@ -v3.5.0 - Feb 17, 2016 +v3.5.0 - Feb 24, 2016 - Added PHP 7.0 support for Ubuntu(Trusty) - Dual support for PHP 5.6 + PHP 7.0 -- Removed old repository for PHP - Fixed minor issues v3.4.1 - Jan 20, 2016 From e3cdb6b5db6a7b1ca1ad6295afe7ca35bf9b5b9a Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Wed, 24 Feb 2016 14:48:59 +0530 Subject: [PATCH 115/115] Move Github related files to .github --- CONTRIBUTING.md => .github/CONTRIBUTING.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename CONTRIBUTING.md => .github/CONTRIBUTING.md (100%) diff --git a/CONTRIBUTING.md b/.github/CONTRIBUTING.md similarity index 100% rename from CONTRIBUTING.md rename to .github/CONTRIBUTING.md