Update nginx stack install
This commit is contained in:
@@ -8,8 +8,6 @@ from wo.core.git import WOGit
|
||||
from wo.core.services import WOService
|
||||
import string
|
||||
import random
|
||||
import sys
|
||||
import hashlib
|
||||
import getpass
|
||||
|
||||
|
||||
|
||||
@@ -892,7 +892,7 @@ def site_package_check(self, stype):
|
||||
|
||||
if stype in ['mysql', 'wp', 'wpsubdir', 'wpsubdomain']:
|
||||
Log.debug(self, "Setting apt_packages variable for MySQL")
|
||||
if not WOShellExec.cmd_exec(self, "mysqladmin ping"):
|
||||
if not WOShellExec.cmd_exec(self, "/usr/bin/mysqladmin ping"):
|
||||
apt_packages = apt_packages + WOVariables.wo_mysql
|
||||
packages = packages + [["https://raw.githubusercontent.com/"
|
||||
"major/MySQLTuner-perl/master/"
|
||||
|
||||
@@ -245,14 +245,24 @@ class WOStackController(CementBaseController):
|
||||
|
||||
# Nginx configuration
|
||||
if set(WOVariables.wo_nginx).issubset(set(apt_packages)):
|
||||
if set(["nginx"]).issubset(set(apt_packages)):
|
||||
# Fix for white screen death with NGINX PLUS
|
||||
if not WOFileUtils.grep(self, '/etc/nginx/fastcgi_params',
|
||||
'SCRIPT_FILENAME'):
|
||||
with open('/etc/nginx/fastcgi_params',
|
||||
encoding='utf-8', mode='a') as wo_nginx:
|
||||
wo_nginx.write('fastcgi_param \tSCRIPT_FILENAME '
|
||||
'\t$request_filename;\n')
|
||||
# Nginx main configuration
|
||||
if os.path.isfile('/etc/nginx/nginx.conf'):
|
||||
data = dict()
|
||||
Log.debug(self, 'Writting the nginx configuration to '
|
||||
'file /etc/nginx/nginx.conf')
|
||||
wo_nginx = open('/etc/nginx/nginx.conf',
|
||||
encoding='utf-8', mode='w')
|
||||
self.app.render(
|
||||
(data), 'nginx-core.mustache', out=wo_nginx)
|
||||
wo_nginx.close()
|
||||
|
||||
# Fix for white screen death with NGINX PLUS
|
||||
if not WOFileUtils.grep(self, '/etc/nginx/fastcgi_params',
|
||||
'SCRIPT_FILENAME'):
|
||||
with open('/etc/nginx/fastcgi_params',
|
||||
encoding='utf-8', mode='a') as wo_nginx:
|
||||
wo_nginx.write('fastcgi_param \tSCRIPT_FILENAME '
|
||||
'\t$request_filename;\n')
|
||||
|
||||
if os.path.isfile('/etc/nginx/nginx.conf'):
|
||||
data = dict(php="9000", debug="9001",
|
||||
|
||||
Reference in New Issue
Block a user