Skip to content

Commit 0f28a6d

Browse files
author
gau1991
committed
Merge branch 'master' into stable
2 parents acce40e + c24a212 commit 0f28a6d

File tree

7 files changed

+145
-97
lines changed

7 files changed

+145
-97
lines changed

CHANGELOG.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
v 3.1.6 - May 19, 2015
2+
- Added Debian 8 support, see #524
3+
- EasyEngine now uses dphys-swapfile for swap creation, see #359
4+
- Minor bug fixes and improvements.
5+
16
v 3.1.5 - May 14, 2015
27
- Fixed Debain 7 stack issues. see #538 #539 #540 #435 #546
38
- Updated MySQLTuner see #484

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Update procedure for EasyEngine to latest version
2828
wget -qO ee rt.cx/ee && sudo bash ee
2929

3030
```
31-
#### If Current version is after than 3.0.6
31+
#### If current version is after than 3.0.6
3232
```
3333
ee update
3434
```
@@ -69,6 +69,18 @@ ee site create example.com --php # create example.com with php support
6969
ee site create example.com --mysql # create example.com with php & mysql support
7070
```
7171

72+
### HHVM Enabled Sites
73+
```bash
74+
ee site create example.com --wp --hhvm # create example.com WordPress site with HHVM support
75+
ee site create example.com --php --hhvm # create example.com php site with HHVM support
76+
```
77+
78+
### PageSpeed Enabled Sites
79+
```bash
80+
ee site create example.com --wp --pagespeed # create example.com WordPress site with PageSpeed support
81+
ee site create example.com --php --pagespeed # create example.com php site with PageSpeed support
82+
```
83+
7284
## Cheatsheet - Site creation
7385

7486

@@ -84,6 +96,7 @@ ee site create example.com --mysql # create example.com with php & mysql supp
8496
- [Documentation] (http://docs.rtcamp.com/easyengine/)
8597
- [FAQ] (http://docs.rtcamp.com/easyengine/faq.html)
8698
- [Conventions used] (http://rtcamp.com/wordpress-nginx/tutorials/conventions/)
99+
- [EasyEngine Premium Support] (https://rtcamp.com/products/easyengine-premium-support/)
87100

88101
## Donations
89102

ee/cli/plugins/stack.py

Lines changed: 82 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,87 @@ def post_pref(self, apt_packages, packages):
483483
self.msg = (self.msg + ["HTTP Auth User Name: easyengine"]
484484
+ ["HTTP Auth Password : {0}".format(passwd)])
485485

486+
if set(EEVariables.ee_hhvm).issubset(set(apt_packages)):
487+
488+
EEShellExec.cmd_exec(self, "update-rc.d hhvm defaults")
489+
490+
EEFileUtils.searchreplace(self, "/etc/hhvm/server.ini",
491+
"9000", "8000")
492+
EEFileUtils.searchreplace(self, "/etc/nginx/hhvm.conf",
493+
"9000", "8000")
494+
495+
with open("/etc/hhvm/php.ini", "a") as hhvm_file:
496+
hhvm_file.write("hhvm.log.header = true\n"
497+
"hhvm.log.natives_stack_trace = true\n"
498+
"hhvm.mysql.socket = "
499+
"/var/run/mysqld/mysqld.sock\n"
500+
"hhvm.pdo_mysql.socket = "
501+
"/var/run/mysqld/mysqld.sock\n"
502+
"hhvm.mysqli.socket = "
503+
"/var/run/mysqld/mysqld.sock\n")
504+
505+
if os.path.isfile("/etc/nginx/conf.d/fastcgi.conf"):
506+
if not EEFileUtils.grep(self, "/etc/nginx/conf.d/"
507+
"fastcgi.conf",
508+
"fastcgi_keep_conn"):
509+
with open("/etc/nginx/conf.d/fastcgi.conf",
510+
"a") as hhvm_file:
511+
hhvm_file.write("fastcgi_keep_conn on;\n")
512+
513+
if os.path.isfile("/etc/nginx/conf.d/upstream.conf"):
514+
if not EEFileUtils.grep(self, "/etc/nginx/conf.d/"
515+
"upstream.conf",
516+
"hhvm"):
517+
with open("/etc/nginx/conf.d/upstream.conf",
518+
"a") as hhvm_file:
519+
hhvm_file.write("upstream hhvm {\nserver "
520+
"127.0.0.1:8000;\n"
521+
"server 127.0.0.1:9000 backup;\n}"
522+
"\n")
523+
524+
EEGit.add(self, ["/etc/hhvm"], msg="Adding HHVM into Git")
525+
EEService.restart_service(self, 'hhvm')
526+
527+
if os.path.isfile("/etc/nginx/nginx.conf") and (not
528+
os.path.isfile("/etc/nginx/common/php-hhvm.conf")):
529+
530+
data = dict()
531+
Log.debug(self, 'Writting the nginx configuration to '
532+
'file /etc/nginx/common/php-hhvm.conf')
533+
ee_nginx = open('/etc/nginx/common/php-hhvm.conf',
534+
encoding='utf-8', mode='w')
535+
self.app.render((data), 'php-hhvm.mustache',
536+
out=ee_nginx)
537+
ee_nginx.close()
538+
539+
Log.debug(self, 'Writting the nginx configuration to '
540+
'file /etc/nginx/common/w3tc-hhvm.conf')
541+
ee_nginx = open('/etc/nginx/common/w3tc-hhvm.conf',
542+
encoding='utf-8', mode='w')
543+
self.app.render((data), 'w3tc-hhvm.mustache',
544+
out=ee_nginx)
545+
ee_nginx.close()
546+
547+
Log.debug(self, 'Writting the nginx configuration to '
548+
'file /etc/nginx/common/wpfc-hhvm.conf')
549+
ee_nginx = open('/etc/nginx/common/wpfc-hhvm.conf',
550+
encoding='utf-8', mode='w')
551+
self.app.render((data), 'wpfc-hhvm.mustache',
552+
out=ee_nginx)
553+
ee_nginx.close()
554+
555+
Log.debug(self, 'Writting the nginx configuration to '
556+
'file /etc/nginx/common/wpsc-hhvm.conf')
557+
ee_nginx = open('/etc/nginx/common/wpsc-hhvm.conf',
558+
encoding='utf-8', mode='w')
559+
self.app.render((data), 'wpsc-hhvm.mustache',
560+
out=ee_nginx)
561+
ee_nginx.close()
562+
563+
if not EEService.reload_service(self, 'nginx'):
564+
Log.error(self, "Failed to reload Nginx, please check "
565+
"output of `nginx -t`")
566+
486567
if set(EEVariables.ee_php).issubset(set(apt_packages)):
487568
# Create log directories
488569
if not os.path.exists('/var/log/php5/'):
@@ -623,88 +704,7 @@ def post_pref(self, apt_packages, packages):
623704
EEVariables.ee_php_user, recursive=True)
624705

625706
EEGit.add(self, ["/etc/php5"], msg="Adding PHP into Git")
626-
EEService.reload_service(self, 'php5-fpm')
627-
628-
if set(EEVariables.ee_hhvm).issubset(set(apt_packages)):
629-
630-
EEShellExec.cmd_exec(self, "update-rc.d hhvm defaults")
631-
632-
EEFileUtils.searchreplace(self, "/etc/hhvm/server.ini",
633-
"9000", "8000")
634-
EEFileUtils.searchreplace(self, "/etc/nginx/hhvm.conf",
635-
"9000", "8000")
636-
637-
with open("/etc/hhvm/php.ini", "a") as hhvm_file:
638-
hhvm_file.write("hhvm.log.header = true\n"
639-
"hhvm.log.natives_stack_trace = true\n"
640-
"hhvm.mysql.socket = "
641-
"/var/run/mysqld/mysqld.sock\n"
642-
"hhvm.pdo_mysql.socket = "
643-
"/var/run/mysqld/mysqld.sock\n"
644-
"hhvm.mysqli.socket = "
645-
"/var/run/mysqld/mysqld.sock\n")
646-
647-
if os.path.isfile("/etc/nginx/conf.d/fastcgi.conf"):
648-
if not EEFileUtils.grep(self, "/etc/nginx/conf.d/"
649-
"fastcgi.conf",
650-
"fastcgi_keep_conn"):
651-
with open("/etc/nginx/conf.d/fastcgi.conf",
652-
"a") as hhvm_file:
653-
hhvm_file.write("fastcgi_keep_conn on;\n")
654-
655-
if os.path.isfile("/etc/nginx/conf.d/upstream.conf"):
656-
if not EEFileUtils.grep(self, "/etc/nginx/conf.d/"
657-
"upstream.conf",
658-
"hhvm"):
659-
with open("/etc/nginx/conf.d/upstream.conf",
660-
"a") as hhvm_file:
661-
hhvm_file.write("upstream hhvm {\nserver "
662-
"127.0.0.1:8000;\n"
663-
"server 127.0.0.1:9000 backup;\n}"
664-
"\n")
665-
666-
EEGit.add(self, ["/etc/hhvm"], msg="Adding HHVM into Git")
667-
EEService.restart_service(self, 'hhvm')
668-
669-
if os.path.isfile("/etc/nginx/nginx.conf") and (not
670-
os.path.isfile("/etc/nginx/common/php-hhvm.conf")):
671-
672-
data = dict()
673-
Log.debug(self, 'Writting the nginx configuration to '
674-
'file /etc/nginx/common/php-hhvm.conf')
675-
ee_nginx = open('/etc/nginx/common/php-hhvm.conf',
676-
encoding='utf-8', mode='w')
677-
self.app.render((data), 'php-hhvm.mustache',
678-
out=ee_nginx)
679-
ee_nginx.close()
680-
681-
Log.debug(self, 'Writting the nginx configuration to '
682-
'file /etc/nginx/common/w3tc-hhvm.conf')
683-
ee_nginx = open('/etc/nginx/common/w3tc-hhvm.conf',
684-
encoding='utf-8', mode='w')
685-
self.app.render((data), 'w3tc-hhvm.mustache',
686-
out=ee_nginx)
687-
ee_nginx.close()
688-
689-
Log.debug(self, 'Writting the nginx configuration to '
690-
'file /etc/nginx/common/wpfc-hhvm.conf')
691-
ee_nginx = open('/etc/nginx/common/wpfc-hhvm.conf',
692-
encoding='utf-8', mode='w')
693-
self.app.render((data), 'wpfc-hhvm.mustache',
694-
out=ee_nginx)
695-
ee_nginx.close()
696-
697-
Log.debug(self, 'Writting the nginx configuration to '
698-
'file /etc/nginx/common/wpsc-hhvm.conf')
699-
ee_nginx = open('/etc/nginx/common/wpsc-hhvm.conf',
700-
encoding='utf-8', mode='w')
701-
self.app.render((data), 'wpsc-hhvm.mustache',
702-
out=ee_nginx)
703-
ee_nginx.close()
704-
705-
if not EEService.reload_service(self, 'nginx'):
706-
Log.error(self, "Failed to reload Nginx, please check "
707-
"output of `nginx -t`")
707+
EEService.restart_service(self, 'php5-fpm')
708708

709709
if set(EEVariables.ee_mysql).issubset(set(apt_packages)):
710710
# TODO: Currently we are using, we need to remove it in future

ee/core/addswap.py

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
from ee.core.variables import EEVariables
33
from ee.core.shellexec import EEShellExec
44
from ee.core.fileutils import EEFileUtils
5+
from ee.core.aptget import EEAptGet
56
from ee.core.logging import Log
7+
import os
68

79

810
class EESwap():
@@ -17,12 +19,30 @@ def add(self):
1719
if EEVariables.ee_ram < 512:
1820
if EEVariables.ee_swap < 1000:
1921
Log.info(self, "Adding SWAP")
20-
EEShellExec.cmd_exec(self, "dd if=/dev/zero of=/ee-swapfile "
21-
"bs=1024 count=1048k")
22-
EEShellExec.cmd_exec(self, "mkswap /ee-swapfile")
23-
EEFileUtils.chown(self, "/ee-swapfile", "root", "root")
24-
EEFileUtils.chmod(self, "/ee-swapfile", 0o600)
25-
EEShellExec.cmd_exec(self, "swapon /ee-swapfile")
26-
with open("/etc/fstab",
27-
encoding='utf-8', mode='a') as swap_file:
28-
swap_file.write("/ee-swapfile\tnone\tswap\tsw\t0 0")
22+
23+
# Install dphys-swapfile
24+
EEAptGet.update(self)
25+
EEAptGet.install(self, ["dphys-swapfile"])
26+
# Stop service
27+
EEShellExec.cmd_exec(self, "service dphys-swapfile stop")
28+
# Remove Default swap created
29+
EEShellExec.cmd_exec(self, "/sbin/dphys-swapfile uninstall")
30+
31+
# Modify Swap configuration
32+
if os.path.isfile("/etc/dphys-swapfile"):
33+
EEFileUtils.searchreplace(self, "/etc/dphys-swapfile",
34+
"#CONF_SWAPFILE=/var/swap",
35+
"CONF_SWAPFILE=/ee-swapfile")
36+
EEFileUtils.searchreplace(self, "/etc/dphys-swapfile",
37+
"#CONF_MAXSWAP=2048",
38+
"CONF_MAXSWAP=1024")
39+
EEFileUtils.searchreplace(self, "/etc/dphys-swapfile",
40+
"#CONF_SWAPSIZE=",
41+
"CONF_SWAPSIZE=1024")
42+
else:
43+
with open("/etc/dphys-swapfile", 'w') as conffile:
44+
conffile.write("CONF_SWAPFILE=/ee-swapfile\n"
45+
"CONF_SWAPSIZE=1024\n"
46+
"CONF_MAXSWAP=1024\n")
47+
# Create swap file
48+
EEShellExec.cmd_exec(self, "service dphys-swapfile start")

ee/core/variables.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class EEVariables():
1212
"""Intialization of core variables"""
1313

1414
# EasyEngine version
15-
ee_version = "3.1.5"
15+
ee_version = "3.1.6"
1616

1717
# EasyEngine packages versions
1818
ee_wp_cli = "0.19.1"
@@ -93,7 +93,10 @@ class EEVariables():
9393
ee_php = ["php5-fpm", "php5-curl", "php5-gd", "php5-imap",
9494
"php5-mcrypt", "php5-common", "php5-readline",
9595
"php5-mysql", "php5-cli", "php5-memcache", "php5-imagick",
96-
"memcached", "graphviz", "php-pear", "php5-dev"]
96+
"memcached", "graphviz", "php-pear"]
97+
98+
if ee_platform_codename == 'wheezy':
99+
ee_php = ee_php + ["php5-dev"]
97100

98101
if ee_platform_distro == 'ubuntu' or ee_platform_codename == 'jessie':
99102
ee_php = ee_php + ["php5-xdebug"]

install

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fi
4848
# Define variables for later use
4949
ee_branch=$1
5050
readonly ee_version_old="2.2.3"
51-
readonly ee_version_new="3.1.5"
51+
readonly ee_version_new="3.1.6"
5252
readonly ee_log_dir=/var/log/ee/
5353
readonly ee_install_log=/var/log/ee/install.log
5454
readonly ee_linux_distro=$(lsb_release -i | awk '{print $3}')
@@ -63,7 +63,7 @@ if [ "$ee_linux_distro" != "Ubuntu" ] && [ "$ee_linux_distro" != "Debian" ]; the
6363
fi
6464

6565
# EasyEngine (ee) only support all Ubuntu/Debian distro except the distro reached EOL
66-
lsb_release -d | egrep -e "12.04|14.04|wheezy" &>> /dev/null
66+
lsb_release -d | egrep -e "12.04|14.04|wheezy|jessie" &>> /dev/null
6767
if [ "$?" -ne "0" ]; then
6868
ee_lib_echo_fail "EasyEngine (ee) only support Ubuntu 12.04/14.04 and Debian 7.x"
6969
exit 100
@@ -313,6 +313,13 @@ function ee_update_latest()
313313
cp /usr/lib/ee/templates/locations.mustache /etc/nginx/common/locations.conf &>> /dev/null
314314
fi
315315

316+
# Fix HHVM upstream issue that was preventing from using EasyEngine for site operations
317+
if [ -f /etc/nginx/conf.d/upstream.conf ]; then
318+
grep -Hr hhvm /etc/nginx/conf.d/upstream.conf &>> /dev/null
319+
if [ $? -ne 0 ]; then
320+
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
321+
fi
322+
fi
316323
}
317324

318325
# Do git intialisation

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
os.system("git config --global user.email {0}".format(ee_email))
5555

5656
setup(name='ee',
57-
version='3.1.5',
57+
version='3.1.6',
5858
description=long_description,
5959
long_description=long_description,
6060
classifiers=[],

0 commit comments

Comments
 (0)