Question: I'm try to host several domain on the same VPS, using HHVM to serve the pages.

I'm wondering how can I write the VirtualHost in order to point the right folder in my /var/www directory ?

For example xxx.domain.com >> /var/www/domain.com/

Answer: 
Good news. Since the release of HHVM 2.3 (Dec 13, 2013), you can run HHVM in FCGI mode. Use either Nginx or Apache and it works wonderfully.

Reference: <http://www.hhvm.com/blog/1817/fastercgi-with-hhvm>

With an older version of HHVM you can run multiple server instances on internal ports, i.e. 8001, 8002, etc. Then configure Nginx as a reverse proxy. (Apache can do that too).

```
upstream node1{
    server 127.0.0.1:8001;
}

upstream node2{
    server 127.0.0.1:8002;
}
server {
    ...
    server_name server1.com;
        location ~ \.php$ {
        proxy_pass http://node1;
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
            proxy_redirect off;
            proxy_buffering off;
            proxy_set_header        Host            $host;
            proxy_set_header        X-Real-IP       $remote_addr;
            proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header    X-Forwarded-Ssl on; #only for https
    }
}

server {
    ...
    server_name server2.com;
        location ~ \.php$ {
        proxy_pass http://node2;
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
            proxy_redirect off;
            proxy_buffering off;
            proxy_set_header        Host            $host;
            proxy_set_header        X-Real-IP       $remote_addr;
            proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header    X-Forwarded-Ssl on; #only for https
    }
}

```

Of course this setup takes up a lot of memory. Go with 2.3 if you can upgrade.
Apparently is not yet possible. Accordling to the official [github repository](https://github.com/facebook/hiphop-php) where the code is hosted exists an [open issue](https://github.com/facebook/hiphop-php/issues/885) about the same issue you are asking and it's tag for **wishlist** / **feature request**.

Probably the best way to solve this is to run a HHVM server for each domain (mean each domain you need a different root folder) and use Apache or Nginx as proxy.