-
Notifications
You must be signed in to change notification settings - Fork 9
HHVM
HHVM 3.11.1 is currently supported on Centos 7 of WunderTools but is still in separate branch. While the Ansible role is working, the install is not done with .rpm's as it should be. Instead we have taken a snapshot of the source and binaries right after compilation and we are using this to do 'make install' inside the role.
Clone the Centos 7 branch and cd to the project:
git clone https://github.com/wunderkraut/WunderTools.git --branch centos7 wundertools-hhvm
cd wundertools-hhvm
Change WunderMachina branch from centos7 to hhvm on line 5 of conf/project.yml. So the file should like this after editing:
project:
name: ansibleref
ansible:
remote: [email protected]:wunderkraut/wundermachina.git
branch: hhvm
revision:
buildsh:
branch: develop
revision:
Configure roles as HHVM is not enabled by default and it's not been tested with all of them. So open conf/vagrant.yml, disable varnish, memcached, letsencrypt, sslterminator and enable hhvm (I haven't really tested varnish or memcached, but at the moment of writing this, letsencrypt and sslterminator failed). Roles sections should look like this now:
roles:
- { role: base, tags: [ 'base' ] }
- { role: php-fpm, tags: [ 'php-fpm' ] }
- { role: nginx, tags: [ 'nginx' ] }
# - { role: varnish, tags: [ 'varnish' ] }
# - { role: memcached, tags: [ 'memcached' ] }
- { role: drush, tags: [ 'drush' ] }
- { role: dbserver, tags: [ 'dbserver' ] }
- { role: drupal-db, tags: [ 'drupal-db' ] }
# - { role: letsencrypt, tags: [ 'letsencrypt' ] }
# - { role: sslterminator, tags: [ 'sslterminator' ] }
# Optional HHVM role.
- { role: hhvm, tags: [ 'hhvm' ] }
Also you'd want to edit the "apps:" section. This will configure your site in Nginx (url, port and document root). After editing the apps section, vagrant.yml should look something like this:
# Apps I want to run on this server
apps:
- server_name: wundertools-hhvm.dev
http_port: 80
docroot: /vagrant/drupal/current
Now you need to change the box 'name' variable from conf/vagrant_local.yml line 1. Otherwise you'll get error from Vagrant: VirtualBox machine with the name 'ansibleref' already exists. Even if you don't have multiple WunderTools installed, it's a good practice to change this. For HHVM I'd also increase memory to 4000gb and if you want to run multiple WunderTools at the same time then change the ip. Resulting file might look like this:
name : drupal7
hostname : local.ansibleref.com
mem : 4000
cpus : 2
ip : 192.168.10.2
box : "geerlingguy/centos7"
If you're not using Vagrant::Hostsupdater, Dnsmasq or something similar then add the new ip and site url to your hosts file /etc/hosts:
192.168.10.2 drupal7.dev
And to use drush from outside the box like this - drush @drupal7.local status - you need to do one more thing. Note that drupal7 equals to name variable in conf/vagrant_local.yml
cp drupal/conf/ansibleref.aliases.drushrc.php drupal/conf/drupal7.aliases.drushrc.php
Edit the new file drupal/conf/drupal7.aliases.drushrc.php and change remote-host on line 20. Resulting file in our example would now look like this:
<?php
$home = drush_server_home();
// Solve the key file to use
$path = explode('/', dirname(__FILE__));
array_pop($path);
array_pop($path);
$path[] = '.vagrant';
$path = implode('/', $path);
$key = shell_exec('find ' . $path . ' -iname private_key');
if (!$key) {
$key = $home . '/.vagrant.d/insecure_private_key';
}
$key = rtrim($key);
$aliases['local'] = array(
'parent' => '@parent',
'site' => 'ansibleref',
'env' => 'vagrant',
'root' => '/vagrant/drupal/current',
'remote-host' => 'drupal7.dev',
'remote-user' => 'vagrant',
'ssh-options' => '-i ' . $key,
);
Start vagrant:
vagrant up