Page MenuHomePhabricator

Devise Apache config for HHVM on Labs
Closed, ResolvedPublic

Description

HHVM doesn't work with Apache / mod_php. You have to use the built-in HHVM web server instead and use a reverse proxy to have things like SSL and GZIP. Facebook recommends using Nginx.

The documentation for configuring Nginx for HHVM is located at https://github.com/facebook/hiphop-php/wiki/Using-nginx-as-Front-Server-to-HipHop.

We should devise an Nginx config that is compatible with our Apache app server config.


Version: wmf-deployment
Severity: normal
URL: https://github.com/facebook/hiphop-php/wiki/Using-nginx-as-Front-Server-to-HipHop

Details

Reference
bz54173

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:50 AM
bzimport set Reference to bz54173.

Would it be better to run nginx on each app server, or run each app server from HHVM directly and do all the SSL/GZIP at an aggregate LB/caching stage?

Is there any killer feature in Nginx required for this, orr they simply recommend whatever they use themselves, but other alternatives would also work?

[Using keyword instead of tracking bug for HipHop issues as requested in bug 40926 comment 5. Filter bugmail on this message.]

With FastCGI support built in to HHVM, we won't need to migrate to Nginx. I'm therefore changing the scope of this bug to Apache configurations.

What we currently need is an Apache configuration for Labs that invokes the HHVM interpreter rather than PHP if a special cookie is present on the client request.

Niklas has done something similar on http://dev.translatewiki.net/, using Nginx. On Apache, we could probably use mod_setenvif.

Choosing an interpreter based on an environment variable is how Apache is currently configured to work on MediaWiki-Vagrant. See https://github.com/wikimedia/mediawiki-vagrant/blob/master/puppet/modules/mediawiki/templates/mediawiki-apache-site.erb#L36.