nginx and hhvm under debian 8.6 jessie

Install nginx from the official sources

 apt-get install nginx

Install hhvm from the sources

 wget -O - | apt-key add -
 echo deb jessie main > /etc/apt/sources.list.d/hhvm.list
 apt-get update
 apt-get install hhvm

Create the hhvm.conf in the nginx folder

  bash /usr/share/hhvm/

Add a own webserver user

 adduser mattionline
 vim /etc/default/hhvm
 chown -R mattionline:mattionline /var/run/hhvm
 vim /etc/nginx/nginx.conf
 user mattionline;

Activate hhvm for your vhosts

Just add the include hhvm.conf; line to your config

nano /etc/nginx/sites-available/blog

server {
    listen 80;
    return 301 https://$host$request_uri;

server {
    listen 443;
    access_log /var/log/nginx/blog_access.log combined;
    error_log  /var/log/nginx/blog_error.log;

    root /var/www/blog/;
    index index.html index.htm index.php;

    ssl on;
    ssl_certificate /etc/letsencrypt/live/;
    ssl_certificate_key /etc/letsencrypt/live/;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;

    include hhvm.conf;
    include caching.conf;

    try_files $uri $uri/ /index.php$args;


Restart the services

systemctl restart hhvm
systemctl restart nginx

Check if nginx and hhvm are correctly running

mattionline:~# netstat -tulpn
Aktive Internetverbindungen (Nur Server)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0* LISTEN 63902/nginx -g daem
tcp 0 0* LISTEN 63902/nginx -g daem
tcp 0 0* LISTEN 63928/hhvm

Speed comparison between the normal php and hhvm:

About The Author

Kommentar verfassen

Deine E-Mail-Adresse wird nicht veröffentlicht.

Scroll to Top