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: 
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.
On Nginx, the only way I was able to get this to work was to use `/` as `SourceRoot` for HHVM, and to add a `/` in `fastcgi_param SCRIPT_FILENAME /$document_root$fastcgi_script_name;` in my `/etc/nginx/hhvm.conf` file. With that combination, I'm running ~7 sites without a problem so far. I'm running Ubuntu 13.10 64-bit. 

In `/etc/hhvm/server.hdf`, change `SourceRoot = /var/www` to `SourceRoot = /`:

```
Server {
  Port = 9000
  SourceRoot = /
  DefaultDocument = index.php
}

```

In `/etc/nginx/hhvm.conf`, add a / in front of `$document_root$fastcgi_script_name;`:

```
location ~ \.php$ {
    fastcgi_split_path_info ^(.+?\.php)(/.*)$;
    fastcgi_keep_conn on;
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME /$document_root$fastcgi_script_name;
    fastcgi_intercept_errors on;
    fastcgi_read_timeout 300;
    include        fastcgi_params;
}

```

You may also need to change `fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;` to `fastcgi_param SCRIPT_FILENAME /$document_root$fastcgi_script_name;`, at least I had to with mine. 

There may be security implications by using `/` as your SourceRoot - I mitigate this as much as I can by firewalling port 9000 so only localhost can reach it. Or you can use a socket instead. Not fool-proof, but from what I've seen so far it's OK.