Run both HHVM and Normal Apache Server Run both HHVM and Normal Apache Server apache apache

Run both HHVM and Normal Apache Server


To /etc/apache2/ports.conf add...

Listen 8080

Then, to your vhost configuration (since using localhost as your domain, probably /etc/apache2/sites-available/default.conf), copy everything in there and paste it right below so you have a second VirtualHost instance. To the second instance, change the *:80 to *:8080, then add your ProxyPassMatch to tell it you're wanting to use HHVM for hh and php file extensions (don't forget to update to correct directory).

It should look something like...

<VirtualHost *:80>    ... keep the same ...</VirtualHost><VirtualHost *:8080>    ... keep the same ...    ProxyPassMatch ^/(.+\.(hh|php)(/.*)?)$ fcgi://127.0.0.1:9000/var/www/$1</VirtualHost>

Go into /etc/apache2/mods-available/hhvm_proxy_fcgi.conf and comment out what's in there. Otherwise everything will be headed toward HHVM.

Finally, restart apache

sudo service apache2 restart

I tested this quickly on an existing local site and it was redirecting back to 80 from 8080 which it should have done. If this doesn't work out, let me know.

UPDATE: Tested a bit more, and it looks like this should work out for you. After adding the following, jumping between local.site.com/hhvm.php and local.site.com:8080/hhvm.php flipped the echo correctly.

<?php if (defined('HHVM_VERSION')) {    echo "golden!";} else {    echo "doh...";}


Yes. You can have Apache listen on both port 80 and port 8080 (just add in additional listen configurations), then add a virtual host for localhost:8080 that passes requests off to HHVM through FastCGI.