Today we're going to learn how to install Facebook's HHVM (HIP HOP VIRTUAL MACHINE) and make it work together with the Faster CGI module in Apache. Basically what is going to happen is Apache will be handling all the static content and we will let HHVM do what it does best - handle PHP or hack!
For those of you who don't know this yet, HHVM is a super fast way of interpreting PHP code. What HHVM does is it compiles PHP code into a byte code language, very close to native code and stores it into an sqlite database file. This will make your website super fast!
Head over to Digital Ocean and get a $5/Month server. It features 512MB of RAM / 1 CPU, 20GB SSD DISK and 1TB TRANSFER. Once you have installed your droplet you need to connect to it as root by using your favorite ssh client.
Second step is to to install the LAMP server and the fastest way to do so is using the tasksel application on Ubuntu. To test the installation, just access the server IP from your browser.
Once you have LAMP running, install HHVM and then execute the bash script that links Apache and HHVM through the Faster CGI module. Then you can uninstall php.
# first install your lamp server [email protected] [~]# tasksel install lamp-server # then get the repos to be able to install hhvm through apt-get wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add - echo deb http://dl.hhvm.com/ubuntu saucy main | sudo tee /etc/apt/sources.list.d/hhvm.list # then update your local repo database apt-get update # then install hhvm apt-get install hhvm # once you've finished intalling you should run the bash script that comes with the package to make apache work well with HHVM /usr/share/hhvm/install_fastcgi.sh # at the end, if you want you can remove PHP apt-get remove php* #BOOM - You're done