Apache 2.4 is Now the Default Apache Version in the PHP Engine

Apache (httpd) 2.4 is now the default version used by Nanobox's PHP engine. Previously, when using the Apache webserver, the engine defaulted to using Apache 2.2. Apache 2.4 has been out for a while, but introduced breaking changes requiring adjustments to application code (specifically .htaccess files). This change to the PHP engine helps ensure those using Apache are using the most current, stable release.

Adjusting for Apache 2.4

The breaking changes introduced in Apache 2.4 can all be adjusted for in your .htaccess file(s) and only relate to access control. Apache has provided a thorough guide for upgrading to 2.4 from 2.2:

Upgrading to Apache 2.4 from 2.2

To avoid updating access controls in your .htaccess file(s), you can enable the access_compat Apache module in your boxfile.yml.

  engine: php
      - access_compat

Updated Apache Config Options

In Apache 2.4, the MaxRequestsPerChild and MaxClients configuration options were renamed to MaxConnectionsPerChild and MaxRequestWorkers respectively. Both old and new options names are accepted.

When using the PHP engine, these settings are configured using the apache_max_requests and apache_max_clients options in the boxfile.yml. In the future, updated config names will likely be introduced with legacy support for the old names, but since Apache respects both old and new config names, the boxfile.yml configs are being left as-is and do not need to be updated.

To Keep Using Apache 2.2

Both Apache 2.4 and 2.2 are available when using the PHP engine. If you want/need to use Apache 2.2, you need specify the apache_version in your boxfile.yml:

  engine: php
    apache_version: '2.2'

Posted in Updates