Enable HTTP/2 support with Apache
NOTE: The Approach A sections referred to below do not apply to Bitnami native installers. Users of Bitnami native installers should refer only to the Approach B sections.
Bitnami stacks ship with the mod_http2 module installed, but it is not enabled by default. To enable this module, follow these instructions. Once the module is active, follow the steps below:
Approach A: Bitnami installations using system packages
-
Add the following lines in the default Apache HTTP virtual host configuration file at installdir/apache2/conf/bitnami/bitnami.conf, inside the default VirtualHost directive, so that it looks like this:
<VirtualHost _default_:80> ... Protocols h2 h2c http/1.1 H2Direct on </VirtualHost>
-
Add the following lines in the default Apache HTTPS virtual host configuration file at installdir/apache2/conf/bitnami/bitnami-ssl.conf, inside the default VirtualHost directive, so that it looks like this:
<VirtualHost _default_:443> ... Protocols h2 h2c http/1.1 H2Direct on </VirtualHost>
-
Add the following lines in any Apache virtual host file defined inside the installdir/apache2/conf/vhosts/ directory, inside the default VirtualHost directive for each file, so that it looks like this:
NOTE: Replace the PORT placeholder with the port number used by the virtual host.
<VirtualHost 127.0.0.1:PORT _default_:PORT> ... Protocols h2 h2c http/1.1 H2Direct on </VirtualHost>
-
After modifying the Apache configuration files, restart Apache to apply the changes.
$ sudo installdir/ctlscript.sh restart apache
Approach B: Self-contained Bitnami installations
-
Add the following lines in the default Apache virtual host configuration file at installdir/apache2/conf/bitnami/bitnami.conf, inside the default VirtualHost directives, so that it looks like this:
<VirtualHost _default_:80> ... Protocols h2 h2c http/1.1 H2Direct on </VirtualHost> ... <VirtualHost _default_:443> ... Protocols h2 h2c http/1.1 H2Direct on </VirtualHost>
Repeat the above change for any other virtual hosts you may have defined.
-
After modifying the Apache configuration files, restart Apache to apply the changes.
$ sudo installdir/ctlscript.sh restart apache