HHVM template research thread
Posted: Sun Apr 26, 2015 2:50 pm
Greetings!
HHVM is a super fast PHP and HACK language JIT compiler which replaces the PHP runtime.It can often be 2x faster then PHP 5.6 with OpCache enabled: https://kinsta.com/blog/real-world-word ... -and-hhvm/
This is how you install it on Ubuntu:
Install script:
Run HHVM at boot:
Use HHVM at the command line instead of PHP (optional)
I took the advise in viewtopic.php?f=11&t=5830 and instead of modifying the default.tpl profile (which breaks phpmyadmin), but I copied (as phpmyadmin breaks if in default and I don't want default running HHVM):
/usr/local/vesta/data/templates/web/nginx/default.tpl --> /usr/local/vesta/data/templates/web/nginx/hhvm.tpl
/usr/local/vesta/data/templates/web/nginx/hhvm.stpl -> /usr/local/vesta/data/templates/web/nginx/hhvm.stpl
and then added the tweaks from https://github.com/facebook/hhvm/issues/3472
**Apache Config Guide**
https://github.com/facebook/hhvm/wiki/FastCGI says we need mod_proxy mod_proxy_fcgi, so:
(this enables mod_proxy automatically as a dependency)
cp /usr/local/vesta/data/templates/web/apache2/default.tpl /usr/local/vesta/data/templates/web/apache2/hhvm.tpl
cp /usr/local/vesta/data/templates/web/apache2/default.stpl /usr/local/vesta/data/templates/web/apache2/hhvm.stpl
Add
To each hhvm.tpl & hhvm.stpl
You'll also want to:
As this file overrides the vhost config: https://github.com/facebook/hhvm/issues/3472
Now you can select your new HHVM template(s) in VestaCP under Packages or Host config!
HHVM is a super fast PHP and HACK language JIT compiler which replaces the PHP runtime.It can often be 2x faster then PHP 5.6 with OpCache enabled: https://kinsta.com/blog/real-world-word ... -and-hhvm/
This is how you install it on Ubuntu:
Code: Select all
Ubuntu 12.04:
$ sudo add-apt-repository -y ppa:mapnik/boost
$ wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add -
$ echo deb http://dl.hhvm.com/ubuntu precise main | sudo tee /etc/apt/sources.list.d/hhvm.list
$ sudo apt-get update
$ sudo apt-get install -y hhvm
Ubuntu 14.04:
$ wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add -
$ echo deb http://dl.hhvm.com/ubuntu trusty main | sudo tee /etc/apt/sources.list.d/hhvm.list
$ sudo apt-get update
$ sudo apt-get install -y hhvm
Code: Select all
sudo /usr/share/hhvm/install_fastcgi.sh
Code: Select all
sudo update-rc.d hhvm defaults
Code: Select all
sudo /usr/bin/update-alternatives --install /usr/bin/php php /usr/bin/hhvm 60
/usr/local/vesta/data/templates/web/nginx/default.tpl --> /usr/local/vesta/data/templates/web/nginx/hhvm.tpl
/usr/local/vesta/data/templates/web/nginx/hhvm.stpl -> /usr/local/vesta/data/templates/web/nginx/hhvm.stpl
and then added the tweaks from https://github.com/facebook/hhvm/issues/3472
**Apache Config Guide**
https://github.com/facebook/hhvm/wiki/FastCGI says we need mod_proxy mod_proxy_fcgi, so:
Code: Select all
sudo a2enmod proxy_fcgi
cp /usr/local/vesta/data/templates/web/apache2/default.tpl /usr/local/vesta/data/templates/web/apache2/hhvm.tpl
cp /usr/local/vesta/data/templates/web/apache2/default.stpl /usr/local/vesta/data/templates/web/apache2/hhvm.stpl
Add
Code: Select all
ProxyPass / fcgi://127.0.0.1:9000/%docroot%/
# Or if you used a unix socket
# ProxyPass / unix://var/run/hhvm/sock|fcgi://127.0.0.1:9000/path/to/your/www/root/goes/here/
<Directory %docroot%>
DirectoryIndex index.php
</Directory>
You'll also want to:
Code: Select all
rm /etc/apache2/mods-enabled/hhvm_proxy_fcgi.conf
Now you can select your new HHVM template(s) in VestaCP under Packages or Host config!