Este contenido no está disponible en el idioma seleccionado.
Chapter 5. Enabling HTTP/2 for the JBoss Core Services HTTP Server
The Hypertext Transfer Protocols are standard methods of transmitting data between applications (such as servers and browsers) over the internet. HTTP/2 improves on HTTP/1.1 by providing enhancements such as:
- header compression - reducing the size of the header transmitted by omitting implied information, and
- multiple requests and responses over a single connection - using binary framing to break down response messages, as opposed to textual framing.
Using HTTP/2 with the Red Hat JBoss Core Services Apache HTTP Server:
-
is supported for encrypted connections using Transport Layer Security (TLS) (
SSLEnabled="true"), indicated by theh2keyword when enabled. -
is not supported for unencrypted connections using the Transmission Control Protocol (TCP) indicated by the
h2ckeyword when enabled.
HTTP/2 is not available for web servers using the Multi-Processing Module prefork modules/mod_mpm_prefork.so
Prerequisites
- Root user access (Red Hat Enterprise Linux and Solaris systems)
- Administrative access (Windows Server)
- Red Hat JBoss Core Services Apache HTTP Server 2.4.23 or higher
Modules required:
-
ssl_module
modules/mod_ssl.so -
http2_module
modules/mod_http2.so
-
ssl_module
Procedure
Enable HTTP/2 for a Apache HTTP Server:
Add the http2_module to
HTTP_HOME/conf.modules.d/00-base.conf:... LoadModule http2_module modules/mod_http2.so
... LoadModule http2_module modules/mod_http2.soCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the
h2protocol inHTTP_HOME/conf/httpd.conf.-
To enable HTTP/2 support for a virtual host, add the
h2protocol to the virtual host configuration, To enable HTTP/2 support for all server connections, add the
h2protocol to the 'Main' server configuration section ofhttpd.conf.For example:
<IfModule http2_module> Protocols h2 http/1.1 ProtocolsHonorOrder on </IfModule><IfModule http2_module> Protocols h2 http/1.1 ProtocolsHonorOrder on </IfModule>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
To enable HTTP/2 support for a virtual host, add the
Update the Secure Socket Layer (SSL) configuration in
HTTP_HOME/conf.d/ssl.conf.Ensure the
SSLEnginedirective is set to enabled (the SSL Engine is enabled by default):SSLEngine on
SSLEngine onCopy to Clipboard Copied! Toggle word wrap Toggle overflow Update the
SSLProtocoldirective to disable theSSLv2andSSLv3protocols, forcing connections to use the Transport Layer Security (TLS) Protocols:SSLProtocol all -SSLv2 -SSLv3
SSLProtocol all -SSLv2 -SSLv3Copy to Clipboard Copied! Toggle word wrap Toggle overflow Update the
SSLCipherSuitedirective to specify which SSL ciphers can with the Apache HTTP Server.For example:
SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK
SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSKCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteFor information on the SSL module and the supported directives, see: Apache HTTP Server Documentation Version 2.4 - Modules: Apache Module mod_ssl.
Restart the Red Hat JBoss Core Services Apache HTTP Server as the root user, to apply the changed configuration.
For SysV (Red Hat Enterprise Linux 6) users:
service jbcs-httpd24-httpd restart
# service jbcs-httpd24-httpd restartCopy to Clipboard Copied! Toggle word wrap Toggle overflow For systemd (Red Hat Enterprise Linux 7) users:
systemctl restart jbcs-httpd24-httpd.service
# systemctl restart jbcs-httpd24-httpd.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow For Red Hat Enterprise Linux users running Red Hat JBoss Core Services using apachectl:
HTTP_HOME/sbin/apachectl restart
# HTTP_HOME/sbin/apachectl restartCopy to Clipboard Copied! Toggle word wrap Toggle overflow For Solaris users:
HTTP_HOME/sbin/apachectl restart
# HTTP_HOME/sbin/apachectl restartCopy to Clipboard Copied! Toggle word wrap Toggle overflow For Windows Server users:
net restart Apache2.4
# net restart Apache2.4Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Next Steps
Verify that HTTP/2 is enabled by reviewing the Apache HTTP Server logs or by using the curl command:
Access the server from a browser or using
curl, then check the SSL/TLS access or request logs (HTTP_HOME/logs/ssl_access_logorHTTP_HOME/logs/ssl_access_log) to verify that the connection is configured to support HTTP/2:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Or verify using
curl(for versions ofcurlthat supportHTTP2):NoteThe
curlpackage provided with Red Hat Enterprise Linux 7 or earlier does not support HTTP/2. To checkcurlfor HTTP/2 support:Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example, when the HTTP/2 protocol is inactive:
curl -I http://<JBCS_httpd_server>:80/<test.html>
$ curl -I http://<JBCS_httpd_server>:80/<test.html> HTTP/1.1 200 ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow But if the HTTP/2 protocol is active,
curlreturns:curl -I https://<JBCS_httpd_server>:443/<test.html>
$ curl -I https://<JBCS_httpd_server>:443/<test.html> HTTP/2 200 ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow Where:
-
<JBCS_httpd_server> is the URI of the server (such as
example.com), - the port number is dependent on your configuration,
- <test.html> is any html page for testing the configuration (not provided), and
-
<JBCS_httpd_server> is the URI of the server (such as
Additional Resources
- For additional information on using HTTP/2, see: Apache HTTP Server Documentation Version 2.4 - How-To / Tutorials: HTTP/2 guide.
- For information on SSL configuration, see: Apache HTTP Server Documentation Version 2.4 - SSL/TLS Strong Encryption: How-To.
- For information on the HTTP/2 module and the supported directives, see: Apache HTTP Server Documentation Version 2.4 - Modules: Apache Module mod_http2.
- For information on the SSL module and the supported directives, see: Apache HTTP Server Documentation Version 2.4 - Modules: Apache Module mod_ssl.
- The proposed internet standard for HTTP/2: IETF: RFC 7540 - Hypertext Transfer Protocol Version 2 (HTTP/2).