The most important lines in this code are the rewrite statements at the end. If you have already a working virtualhost configuration, just add these two lines to it, rather than copying this whole setup. If you are able to override the settings for mod_rewrite in your htaccess files (check with your hosting provider), you can place a file called .htaccess containing the following lines in the root of your installation. This is the default name and what 99% of hosting providers use, but it pays to check first!
RewriteEngine On RewriteRule !\.(js|gif|css|jpg|png)$ /path/to/ezpublish/index.php