From 6a910ea552e6fc1d727714d7c64a7c2bebf1b700 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Mon, 22 Feb 2016 14:52:09 +0530 Subject: [PATCH] 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',