Go Home Project Directory View Current Script

Kit to quickly install a LEMP Stack w/ HHVM and perform basic configurations of new Ubuntu 15.04 and 15.10 servers. Please be advised that HHVM requires you to be running an 64-bit server environment. According to those in direct charge of the HHVM project, there are no future plans to support 32-bit architecture... and I don't fault them for that.

Components include a recent mainline version of Nginx (1.9.9) using configurations from the HTML 5 Boilerplate team (and modified/customized for use with mainline and HHVM), HHVM v.3.11, and MariaDB 10.0 (drop-in replacement for MySQL), Sendmail (PHP mail function), and CSF (Config Server Firewall).

Deploys a proper directory strucutre, optimizes Nginx to be used with HHVM, creates a PHP page for testing and more!

For the record: I really like the handling of php done by HHVM - concurrent loads are handled much sweeter than that of Zend + Opcache. With that said, I place all my managed WordPress clients on this specific build, thus, the reason for me building these scripts. Saves time ...and hell... it even saves money! Do keep in mind, HHVM is still technically in it's infancy, there are limited CMS that work with this particular execution engine. Sites like Joomla! I place on my optimized VStacklet Kit.


  • Quiet installer - no more long scrolling text vomit, just see what's important; when it's presented.
  • Script writes output to /root/hstacklet.log for additional observations.
  • Color Coding for emphasis on install processes.
  • Defaults are set to (Y) - just hit enter if you accept.
  • Nginx on port 80 with SSL terminiation on 443.
  • No Apache - Full throttle!
  • Fast and Lightweight install.
  • Full Kit functionality - backup scripts included.
  • Actively maintained w/ updates added when stable.
  • HTTP/2 Nginx ready. To view if your webserver is HTTP/2 after installing the script with SSL, check @ HTTP/2 Checker
  • Everything you need to get that Nginx + HHVM server up and running!

Total script install time on a $5 Digital Ocean Droplet sits at 10:12 installing everything. No Sendmail or Cert script installs at 04:22. This time assumes you are sitting attentively with the script running. There are a limited number of interactions to be made with the script and most of the softwares installed I have automated and logged, however, I feel it is important to have some sort of interaction... at the very least so you are familiar with what is being installed along with the options to tell it to go to hell.


HStacklet - (Full Kit) Installs and configures LEMP stack w/ HHVM supporting Website-based server environments.


  • Adds repositories for the latest stable versions of MariaDB, mainline (1.9.x) versions of Nginx, and HHVM 3.x.
  • Installs and configures Nginx, HHVM and MariaDB.
  • Installs HHVM w/ Nginx and modifies for use with socket - no localhost port funk.
  • Disables php exposure
  • Installs and Auto-Configures phpMyAdmin - MySQL & phpMyAdmin credentials are stored in /root/.my.cnf
  • MariaDB 10.0 can easily switched to 5.5 or substituted for PostgreSQL.
  • Installs and Adjusts CSF (Config Server Firewall) - prepares ports used for VStacklet as well as informing your entered email for security alerts.
  • Installs and Enables (PHP) Sendmail
  • Supports IPv6 by default.
  • Optional self-signed SSL cert configuration.
  • Easy to configure & run backup executable hs-backup for data-protection.

HS-Backup - Installs scripts to help manage and automate server/site backups
As standalone or just use the full kit - HS-Backup is included.


  • Backup your files in key locations (ex: /srv/www /etc /root)
  • Backup your databases
  • Package files & databases to one archive
  • Cleanup remaining individual archives
  • Simply configure and type hs-backup to backup important directories and databases - cron examples included.

You should read these scripts before running them so you know what they're doing. Changes may be necessary to meet your needs.

Setup should be run as root on a fresh Ubuntu 64-bit installation. Stack should be run on a server without any existing LEMP or LAMP components.

If components are already installed, the core packages can be removed with:

apt-get purge apache mysql apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common \ 
libapache2-mod-php5 libapr1 libaprutil1 libdbd-mysql-perl libdbi-perl libnet-daemon-perl \ 
libplrpc-perl libpq5 mysql-client-5.5 mysql-common mysql-server mysql-server-5.5 php5-common \ 
php5-mysql
apt-get autoclean
apt-get autoremove
HStacklet FULL Kit - Installs and configures the HStacklet HHVM LEMP kit stack:
(includes vs-backup and all needed backup scripts)

NOTE: You may need to run first the following -

apt-get install -y curl

... then run our main installer ...

curl -LO https://raw.github.com/JMSDOnline/hstacklet/master/hstacklet.sh
chmod +x hstacklet.sh
./hstacklet.sh
HStacklet HS-Backup - Installs needed files for running complete system backups:

NOTE: You may need to run first the following -

apt-get install -y curl

... then run our main installer ...

curl -LO https://raw.github.com/JMSDOnline/hstacklet/master/hstacklet-backup-standalone.sh
chmod +x hstacklet-backup-standalone.sh
./hstacklet-backup-standalone.sh


HStacklet is a fork from my Varnish + Nginx project VStacklet modified for Nginx + HHVM - do enjoy!

Again, please be advised that I am building/testing this script on Ubuntu 15.04 (Vivid) and 15.10 (Wiley Werewolf) as they support Nginx versions higher than 1.8.

For added giggles of speedy ridiculousness...

We can add varnish as a caching agent on port 80 while nginx serves port 8080 and 443 (securely)

An example of this configuration can be seen directly on this site. Check out this header response on port 80 (via http://). I'll be building this on another potential repo in the future... maybe.

As per any contributions, be it suggestions, critiques, alterations and on and on are all welcome @ HStacklet's Repo on GitHub



A word to the wise

At the moment HHVM, though it handles massive loads splendidly and considerably better than typical Zend OpCache, it is still under development. I suggest reviewing the HHVM tests/passing lists before attempting to throw this up for hosting your particular CMS. I have several clients running Joomla! (up-to-date) sites and HHVM at the current moment does not play nice with them due to unit tests not currently running because of autoloading issues related to: this.