Browse Source

Merge branch 'master' into stable

stable v3.1.6
gau1991 10 years ago
parent
commit
0f28a6da45
  1. 5
      CHANGELOG.txt
  2. 15
      README.md
  3. 164
      ee/cli/plugins/stack.py
  4. 38
      ee/core/addswap.py
  5. 7
      ee/core/variables.py
  6. 11
      install
  7. 2
      setup.py

5
CHANGELOG.txt

@ -1,3 +1,8 @@
v 3.1.6 - May 19, 2015
- Added Debian 8 support, see #524
- EasyEngine now uses dphys-swapfile for swap creation, see #359
- Minor bug fixes and improvements.
v 3.1.5 - May 14, 2015 v 3.1.5 - May 14, 2015
- Fixed Debain 7 stack issues. see #538 #539 #540 #435 #546 - Fixed Debain 7 stack issues. see #538 #539 #540 #435 #546
- Updated MySQLTuner see #484 - Updated MySQLTuner see #484

15
README.md

@ -28,7 +28,7 @@ Update procedure for EasyEngine to latest version
wget -qO ee rt.cx/ee && sudo bash ee wget -qO ee rt.cx/ee && sudo bash ee
``` ```
#### If Current version is after than 3.0.6 #### If current version is after than 3.0.6
``` ```
ee update ee update
``` ```
@ -69,6 +69,18 @@ ee site create example.com --php # create example.com with php support
ee site create example.com --mysql # create example.com with php & mysql support ee site create example.com --mysql # create example.com with php & mysql support
``` ```
### HHVM Enabled Sites
```bash
ee site create example.com --wp --hhvm # create example.com WordPress site with HHVM support
ee site create example.com --php --hhvm # create example.com php site with HHVM support
```
### PageSpeed Enabled Sites
```bash
ee site create example.com --wp --pagespeed # create example.com WordPress site with PageSpeed support
ee site create example.com --php --pagespeed # create example.com php site with PageSpeed support
```
## Cheatsheet - Site creation ## Cheatsheet - Site creation
@ -84,6 +96,7 @@ ee site create example.com --mysql # create example.com with php & mysql supp
- [Documentation] (http://docs.rtcamp.com/easyengine/) - [Documentation] (http://docs.rtcamp.com/easyengine/)
- [FAQ] (http://docs.rtcamp.com/easyengine/faq.html) - [FAQ] (http://docs.rtcamp.com/easyengine/faq.html)
- [Conventions used] (http://rtcamp.com/wordpress-nginx/tutorials/conventions/) - [Conventions used] (http://rtcamp.com/wordpress-nginx/tutorials/conventions/)
- [EasyEngine Premium Support] (https://rtcamp.com/products/easyengine-premium-support/)
## Donations ## Donations

164
ee/cli/plugins/stack.py

@ -483,6 +483,87 @@ class EEStackController(CementBaseController):
self.msg = (self.msg + ["HTTP Auth User Name: easyengine"] self.msg = (self.msg + ["HTTP Auth User Name: easyengine"]
+ ["HTTP Auth Password : {0}".format(passwd)]) + ["HTTP Auth Password : {0}".format(passwd)])
if set(EEVariables.ee_hhvm).issubset(set(apt_packages)):
EEShellExec.cmd_exec(self, "update-rc.d hhvm defaults")
EEFileUtils.searchreplace(self, "/etc/hhvm/server.ini",
"9000", "8000")
EEFileUtils.searchreplace(self, "/etc/nginx/hhvm.conf",
"9000", "8000")
with open("/etc/hhvm/php.ini", "a") as hhvm_file:
hhvm_file.write("hhvm.log.header = true\n"
"hhvm.log.natives_stack_trace = true\n"
"hhvm.mysql.socket = "
"/var/run/mysqld/mysqld.sock\n"
"hhvm.pdo_mysql.socket = "
"/var/run/mysqld/mysqld.sock\n"
"hhvm.mysqli.socket = "
"/var/run/mysqld/mysqld.sock\n")
if os.path.isfile("/etc/nginx/conf.d/fastcgi.conf"):
if not EEFileUtils.grep(self, "/etc/nginx/conf.d/"
"fastcgi.conf",
"fastcgi_keep_conn"):
with open("/etc/nginx/conf.d/fastcgi.conf",
"a") as hhvm_file:
hhvm_file.write("fastcgi_keep_conn on;\n")
if os.path.isfile("/etc/nginx/conf.d/upstream.conf"):
if not EEFileUtils.grep(self, "/etc/nginx/conf.d/"
"upstream.conf",
"hhvm"):
with open("/etc/nginx/conf.d/upstream.conf",
"a") as hhvm_file:
hhvm_file.write("upstream hhvm {\nserver "
"127.0.0.1:8000;\n"
"server 127.0.0.1:9000 backup;\n}"
"\n")
EEGit.add(self, ["/etc/hhvm"], msg="Adding HHVM into Git")
EEService.restart_service(self, 'hhvm')
if os.path.isfile("/etc/nginx/nginx.conf") and (not
os.path.isfile("/etc/nginx/common/php-hhvm.conf")):
data = dict()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/php-hhvm.conf')
ee_nginx = open('/etc/nginx/common/php-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'php-hhvm.mustache',
out=ee_nginx)
ee_nginx.close()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/w3tc-hhvm.conf')
ee_nginx = open('/etc/nginx/common/w3tc-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'w3tc-hhvm.mustache',
out=ee_nginx)
ee_nginx.close()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/wpfc-hhvm.conf')
ee_nginx = open('/etc/nginx/common/wpfc-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'wpfc-hhvm.mustache',
out=ee_nginx)
ee_nginx.close()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/wpsc-hhvm.conf')
ee_nginx = open('/etc/nginx/common/wpsc-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'wpsc-hhvm.mustache',
out=ee_nginx)
ee_nginx.close()
if not EEService.reload_service(self, 'nginx'):
Log.error(self, "Failed to reload Nginx, please check "
"output of `nginx -t`")
if set(EEVariables.ee_php).issubset(set(apt_packages)): if set(EEVariables.ee_php).issubset(set(apt_packages)):
# Create log directories # Create log directories
if not os.path.exists('/var/log/php5/'): if not os.path.exists('/var/log/php5/'):
@ -623,88 +704,7 @@ class EEStackController(CementBaseController):
EEVariables.ee_php_user, recursive=True) EEVariables.ee_php_user, recursive=True)
EEGit.add(self, ["/etc/php5"], msg="Adding PHP into Git") EEGit.add(self, ["/etc/php5"], msg="Adding PHP into Git")
EEService.reload_service(self, 'php5-fpm') EEService.restart_service(self, 'php5-fpm')
if set(EEVariables.ee_hhvm).issubset(set(apt_packages)):
EEShellExec.cmd_exec(self, "update-rc.d hhvm defaults")
EEFileUtils.searchreplace(self, "/etc/hhvm/server.ini",
"9000", "8000")
EEFileUtils.searchreplace(self, "/etc/nginx/hhvm.conf",
"9000", "8000")
with open("/etc/hhvm/php.ini", "a") as hhvm_file:
hhvm_file.write("hhvm.log.header = true\n"
"hhvm.log.natives_stack_trace = true\n"
"hhvm.mysql.socket = "
"/var/run/mysqld/mysqld.sock\n"
"hhvm.pdo_mysql.socket = "
"/var/run/mysqld/mysqld.sock\n"
"hhvm.mysqli.socket = "
"/var/run/mysqld/mysqld.sock\n")
if os.path.isfile("/etc/nginx/conf.d/fastcgi.conf"):
if not EEFileUtils.grep(self, "/etc/nginx/conf.d/"
"fastcgi.conf",
"fastcgi_keep_conn"):
with open("/etc/nginx/conf.d/fastcgi.conf",
"a") as hhvm_file:
hhvm_file.write("fastcgi_keep_conn on;\n")
if os.path.isfile("/etc/nginx/conf.d/upstream.conf"):
if not EEFileUtils.grep(self, "/etc/nginx/conf.d/"
"upstream.conf",
"hhvm"):
with open("/etc/nginx/conf.d/upstream.conf",
"a") as hhvm_file:
hhvm_file.write("upstream hhvm {\nserver "
"127.0.0.1:8000;\n"
"server 127.0.0.1:9000 backup;\n}"
"\n")
EEGit.add(self, ["/etc/hhvm"], msg="Adding HHVM into Git")
EEService.restart_service(self, 'hhvm')
if os.path.isfile("/etc/nginx/nginx.conf") and (not
os.path.isfile("/etc/nginx/common/php-hhvm.conf")):
data = dict()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/php-hhvm.conf')
ee_nginx = open('/etc/nginx/common/php-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'php-hhvm.mustache',
out=ee_nginx)
ee_nginx.close()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/w3tc-hhvm.conf')
ee_nginx = open('/etc/nginx/common/w3tc-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'w3tc-hhvm.mustache',
out=ee_nginx)
ee_nginx.close()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/wpfc-hhvm.conf')
ee_nginx = open('/etc/nginx/common/wpfc-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'wpfc-hhvm.mustache',
out=ee_nginx)
ee_nginx.close()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/wpsc-hhvm.conf')
ee_nginx = open('/etc/nginx/common/wpsc-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'wpsc-hhvm.mustache',
out=ee_nginx)
ee_nginx.close()
if not EEService.reload_service(self, 'nginx'):
Log.error(self, "Failed to reload Nginx, please check "
"output of `nginx -t`")
if set(EEVariables.ee_mysql).issubset(set(apt_packages)): if set(EEVariables.ee_mysql).issubset(set(apt_packages)):
# TODO: Currently we are using, we need to remove it in future # TODO: Currently we are using, we need to remove it in future

38
ee/core/addswap.py

@ -2,7 +2,9 @@
from ee.core.variables import EEVariables from ee.core.variables import EEVariables
from ee.core.shellexec import EEShellExec from ee.core.shellexec import EEShellExec
from ee.core.fileutils import EEFileUtils from ee.core.fileutils import EEFileUtils
from ee.core.aptget import EEAptGet
from ee.core.logging import Log from ee.core.logging import Log
import os
class EESwap(): class EESwap():
@ -17,12 +19,30 @@ class EESwap():
if EEVariables.ee_ram < 512: if EEVariables.ee_ram < 512:
if EEVariables.ee_swap < 1000: if EEVariables.ee_swap < 1000:
Log.info(self, "Adding SWAP") Log.info(self, "Adding SWAP")
EEShellExec.cmd_exec(self, "dd if=/dev/zero of=/ee-swapfile "
"bs=1024 count=1048k") # Install dphys-swapfile
EEShellExec.cmd_exec(self, "mkswap /ee-swapfile") EEAptGet.update(self)
EEFileUtils.chown(self, "/ee-swapfile", "root", "root") EEAptGet.install(self, ["dphys-swapfile"])
EEFileUtils.chmod(self, "/ee-swapfile", 0o600) # Stop service
EEShellExec.cmd_exec(self, "swapon /ee-swapfile") EEShellExec.cmd_exec(self, "service dphys-swapfile stop")
with open("/etc/fstab", # Remove Default swap created
encoding='utf-8', mode='a') as swap_file: EEShellExec.cmd_exec(self, "/sbin/dphys-swapfile uninstall")
swap_file.write("/ee-swapfile\tnone\tswap\tsw\t0 0")
# Modify Swap configuration
if os.path.isfile("/etc/dphys-swapfile"):
EEFileUtils.searchreplace(self, "/etc/dphys-swapfile",
"#CONF_SWAPFILE=/var/swap",
"CONF_SWAPFILE=/ee-swapfile")
EEFileUtils.searchreplace(self, "/etc/dphys-swapfile",
"#CONF_MAXSWAP=2048",
"CONF_MAXSWAP=1024")
EEFileUtils.searchreplace(self, "/etc/dphys-swapfile",
"#CONF_SWAPSIZE=",
"CONF_SWAPSIZE=1024")
else:
with open("/etc/dphys-swapfile", 'w') as conffile:
conffile.write("CONF_SWAPFILE=/ee-swapfile\n"
"CONF_SWAPSIZE=1024\n"
"CONF_MAXSWAP=1024\n")
# Create swap file
EEShellExec.cmd_exec(self, "service dphys-swapfile start")

7
ee/core/variables.py

@ -12,7 +12,7 @@ class EEVariables():
"""Intialization of core variables""" """Intialization of core variables"""
# EasyEngine version # EasyEngine version
ee_version = "3.1.5" ee_version = "3.1.6"
# EasyEngine packages versions # EasyEngine packages versions
ee_wp_cli = "0.19.1" ee_wp_cli = "0.19.1"
@ -93,7 +93,10 @@ class EEVariables():
ee_php = ["php5-fpm", "php5-curl", "php5-gd", "php5-imap", ee_php = ["php5-fpm", "php5-curl", "php5-gd", "php5-imap",
"php5-mcrypt", "php5-common", "php5-readline", "php5-mcrypt", "php5-common", "php5-readline",
"php5-mysql", "php5-cli", "php5-memcache", "php5-imagick", "php5-mysql", "php5-cli", "php5-memcache", "php5-imagick",
"memcached", "graphviz", "php-pear", "php5-dev"] "memcached", "graphviz", "php-pear"]
if ee_platform_codename == 'wheezy':
ee_php = ee_php + ["php5-dev"]
if ee_platform_distro == 'ubuntu' or ee_platform_codename == 'jessie': if ee_platform_distro == 'ubuntu' or ee_platform_codename == 'jessie':
ee_php = ee_php + ["php5-xdebug"] ee_php = ee_php + ["php5-xdebug"]

11
install

@ -48,7 +48,7 @@ fi
# Define variables for later use # Define variables for later use
ee_branch=$1 ee_branch=$1
readonly ee_version_old="2.2.3" readonly ee_version_old="2.2.3"
readonly ee_version_new="3.1.5" readonly ee_version_new="3.1.6"
readonly ee_log_dir=/var/log/ee/ readonly ee_log_dir=/var/log/ee/
readonly ee_install_log=/var/log/ee/install.log readonly ee_install_log=/var/log/ee/install.log
readonly ee_linux_distro=$(lsb_release -i | awk '{print $3}') readonly ee_linux_distro=$(lsb_release -i | awk '{print $3}')
@ -63,7 +63,7 @@ if [ "$ee_linux_distro" != "Ubuntu" ] && [ "$ee_linux_distro" != "Debian" ]; the
fi fi
# EasyEngine (ee) only support all Ubuntu/Debian distro except the distro reached EOL # EasyEngine (ee) only support all Ubuntu/Debian distro except the distro reached EOL
lsb_release -d | egrep -e "12.04|14.04|wheezy" &>> /dev/null lsb_release -d | egrep -e "12.04|14.04|wheezy|jessie" &>> /dev/null
if [ "$?" -ne "0" ]; then if [ "$?" -ne "0" ]; then
ee_lib_echo_fail "EasyEngine (ee) only support Ubuntu 12.04/14.04 and Debian 7.x" ee_lib_echo_fail "EasyEngine (ee) only support Ubuntu 12.04/14.04 and Debian 7.x"
exit 100 exit 100
@ -313,6 +313,13 @@ function ee_update_latest()
cp /usr/lib/ee/templates/locations.mustache /etc/nginx/common/locations.conf &>> /dev/null cp /usr/lib/ee/templates/locations.mustache /etc/nginx/common/locations.conf &>> /dev/null
fi fi
# Fix HHVM upstream issue that was preventing from using EasyEngine for site operations
if [ -f /etc/nginx/conf.d/upstream.conf ]; then
grep -Hr hhvm /etc/nginx/conf.d/upstream.conf &>> /dev/null
if [ $? -ne 0 ]; then
echo -e "upstream hhvm {\n# HHVM Pool\nserver 127.0.0.1:8000;\nserver 127.0.0.1:9000 backup;\n}\n" >> /etc/nginx/conf.d/upstream.conf
fi
fi
} }
# Do git intialisation # Do git intialisation

2
setup.py

@ -54,7 +54,7 @@ except Exception as e:
os.system("git config --global user.email {0}".format(ee_email)) os.system("git config --global user.email {0}".format(ee_email))
setup(name='ee', setup(name='ee',
version='3.1.5', version='3.1.6',
description=long_description, description=long_description,
long_description=long_description, long_description=long_description,
classifiers=[], classifiers=[],

Loading…
Cancel
Save