nginx and hhvm under debian 8.6 jessie

Install nginx from the official sources

 apt-get install nginx

Install hhvm from the hhvm.com sources

 wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | apt-key add -
 echo deb http://dl.hhvm.com/debian 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/install_fastcgi.sh

Add a own webserver user

 adduser mattionline
 vim /etc/default/hhvm
 RUN_AS_USER="mattionline"
 RUN_AS_GROUP="mattionline"
 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;
    server_name mattionline.de;
    return 301 https://$host$request_uri;
}

server {
    listen 443;
    server_name mattionline.de;
    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/mattionline.de-0001/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/mattionline.de-0001/privkey.pem;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';

    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 0.0.0.0:80 0.0.0.0:* LISTEN 63902/nginx -g daem
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 63902/nginx -g daem
tcp 0 0 0.0.0.0:9000 0.0.0.0:* LISTEN 63928/hhvm

Speed comparison between the normal php and hhvm: https://ma.ttias.be/hhvm-versus-php-fpm-5-4-and-5-5-performance-comparison/

Kommentar verfassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Nach oben scrollen