Browse Source

php7

master
Prabuddha Chakraborty 9 years ago
parent
commit
ac3ace4289
  1. 10
      ee/cli/plugins/site.py
  2. 27
      ee/cli/plugins/site_functions.py
  3. 3
      ee/cli/templates/virtualconf.mustache
  4. 35
      ee/cli/templates/wpcommon-php7.mustache
  5. 2
      install

10
ee/cli/plugins/site.py

@ -636,10 +636,8 @@ class EESiteCreateController(CementBaseController):
if data['php7']: if data['php7']:
php_version = "7.0" php_version = "7.0"
else: else:
if EEVariables.ee_platform_codename == 'trusty': php_version = "5.6"
php_version = "5.6"
else:
php_version = "5.5"
addNewSite(self, ee_domain, stype, cache, ee_site_webroot, addNewSite(self, ee_domain, stype, cache, ee_site_webroot,
hhvm=hhvm, pagespeed=pagespeed, php_version=php_version) hhvm=hhvm, pagespeed=pagespeed, php_version=php_version)
@ -1144,8 +1142,6 @@ class EESiteUpdateController(CementBaseController):
php7 = False php7 = False
check_php_version = '5.6' check_php_version = '5.6'
if pargs.pagespeed: if pargs.pagespeed:
if pagespeed is old_pagespeed: if pagespeed is old_pagespeed:
if pagespeed is False: if pagespeed is False:
@ -1156,8 +1152,6 @@ class EESiteUpdateController(CementBaseController):
"site") "site")
pargs.pagespeed = False pargs.pagespeed = False
if pargs.php7: if pargs.php7:
if php7 is old_php7: if php7 is old_php7:
if php7 is False: if php7 is False:

27
ee/cli/plugins/site_functions.py

@ -1114,7 +1114,7 @@ def detSitePar(opts):
else: else:
cachetype = cachelist[0] cachetype = cachelist[0]
elif False not in [x in ('php7','html') for x in typelist]: elif False not in [x in ('php7','html') for x in typelist]:
sitetype = 'php' sitetype = 'php7'
if not cachelist: if not cachelist:
cachetype = 'basic' cachetype = 'basic'
else: else:
@ -1151,19 +1151,20 @@ def detSitePar(opts):
cachetype = cachelist[0] cachetype = cachelist[0]
else: else:
raise RuntimeError("could not determine site and cache type") 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: else:
sitetype = typelist[0] if not typelist and not cachelist:
cachetype = cachelist[0] 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) return (sitetype, cachetype)

3
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}} {{^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}} {{#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}} {{^proxy}}include common/locations.conf;{{/proxy}}
{{^vma}}{{^rc}}include {{webroot}}/conf/nginx/*.conf;{{/rc}}{{/vma}} {{^vma}}{{^rc}}include {{webroot}}/conf/nginx/*.conf;{{/rc}}{{/vma}}
{{/proxy}} {{/proxy}}

35
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;
}

2
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 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_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 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 fi
} }

Loading…
Cancel
Save