{"id":672,"date":"2019-09-05T10:54:14","date_gmt":"2019-09-05T10:54:14","guid":{"rendered":"https:\/\/cheapsslsecurity.com\/p\/?p=672"},"modified":"2025-06-11T20:27:55","modified_gmt":"2025-06-11T20:27:55","slug":"how-to-enable-http2-on-apache","status":"publish","type":"post","link":"https:\/\/cheapsslsecurity.com\/p\/how-to-enable-http2-on-apache\/","title":{"rendered":"How to Enable HTTP2 on Apache"},"content":{"rendered":"<h2>A step-by-step guide on How to Enable HTTP2 on Apache<\/h2>\n<p>Apache is an open-source web server that serves both static and dynamic content. It\u2019s particularly useful because it\u2019s suitable for websites ranging in size from a few pages to thousands of pages. Developed and maintained by an open community of programmers (Apache Software Foundation), Apache has the highest market share in the web server market.<\/p>\n<p><!--more--><\/p>\n<p>Apache uses the TCP\/IP suite of protocols, and HTTP that runs over this protocol suite defines how requests and responses are exchanged between the client and the server. HTTP\/2, the second significant change in the HTTP family after HTTP\/1.1, is supported by all major browsers and servers.<\/p>\n<p>Let us now look into how to enable http2 in apache server.<\/p>\n<h2>Enable HTTP\/2 on Apache<\/h2>\n<ul>\n<li>Prerequisites:\n<ul>\n<li>Enable HTTPS on your server since almost all browsers allow HTTP\/2 only over HTTPS. Hence, it\u2019s necessary to install an SSL certificate.<\/li>\n<li>TLS 1.2 and above with modern cipher suites is required.<\/li>\n<li>The Apache version must be 2.4.17 or higher because these versions have built-in HTTP\/2 support.<\/li>\n<\/ul>\n<\/li>\n<li>After Apache is upgraded, enable SSL and HTTP\/2 from the mod_http2 module using the following commands.&gt; sudo a2enmod ssl<br \/>\n&gt; sudo a2enmod http2<br \/>\n&gt; sudo apachectl restart<\/p>\n<p>If the above command doesn\u2019t work, open the httpd.conf file and use LoadModule directive to enable the HTTP2 module.<\/p>\n<p>&gt; LoadModule http2_module modules\/mod_http2.so<\/li>\n<li>After loading the necessary modules, navigate to the Apache configuration directory and edit the website&#8217;s virtual host config file.<br \/>\nAdd &#8220;Protocols h2 http\/1.1&#8221; right after the tagThe host\u2019s config file should look like the following:<\/p>\n<blockquote><p>\nProtocols h2 h2c http\/1.1<br \/>\nServerAdmin example@your-site.com<br \/>\nServerName your-site.com<br \/>\n&#8230;<\/p><\/blockquote>\n<p>Note: the three parameters in the above protocols directive:<\/p>\n<ul>\n<li>h2 \u2013 instructs Apache to support HTTP\/2 protocol over SSL\/TLS<\/li>\n<li>h2c \u2013 instructs Apache to support HTTP\/2 over TCP<\/li>\n<li>http\/1.1 \u2013 if client browser does not accept HTTP\/2 then the request is served over HTTP\/1.1<\/li>\n<\/ul>\n<\/li>\n<li>After the changes, remember to reload\/restart Apache.<\/li>\n<\/ul>\n<h2>Troubleshooting<\/h2>\n<p>During the process of enabling HTTP2 on Apache, you may run into a few issues.<\/p>\n<h2>Apache 2.4.27: HTTP\/2 is Not Supported in Pre-Fork<\/h2>\n<p>From Apache version 2.4.27, the Apache multi-processing module (MPM) pre-fork does not extend support to HTTP\/2. It\u2019s indicated in the Apache error log as an \u201cMPM module not supported\u201d type of message.<\/p>\n<p>To correct this, a different MPM event or worker needs to be selected.<\/p>\n<p>Note: The following example assumes that PHP has been installed from Ubuntu\u2019s ondrej\/php repository. The PHP package names could be different in other repositories. The package names and apt-get commands might need to be changed accordingly to match the PHP vendor and package manager.<\/p>\n<p>To fix this error, follow the steps mentioned below, using these commands:<\/p>\n<ul>\n<li>To stop the service:<br \/>\n<blockquote><p>&gt; apachectl stop<\/p><\/blockquote>\n<\/li>\n<li>To install the php-fpm from your PHP repository. This package name depends on the vendor (Change package name and apt-get commands to match your PHP vendor and package manager):<br \/>\n<blockquote><p>&gt; apt-get install php7.1-fpm<br \/>\n&gt; a2enmod proxy_fcgi setenvif<br \/>\n&gt; a2enconf php7.1-fpm<\/p><\/blockquote>\n<\/li>\n<li>To disable mod_php:<br \/>\n<blockquote><p>&gt; a2dismod php7.1<\/p><\/blockquote>\n<\/li>\n<li>To disable the prefork MPM since only one MPM can run at a time:<br \/>\n<blockquote><p>&gt; a2dismod mpm_prefork<\/p><\/blockquote>\n<\/li>\n<li>To enable event MPM (you can also enable mpm_worker):<br \/>\n<blockquote><p>&gt; a2enmod mpm_event<\/p><\/blockquote>\n<\/li>\n<li>To start the service:<br \/>\n<blockquote><p>&gt; apachectl start<\/p><\/blockquote>\n<\/li>\n<\/ul>\n<h2>HTTP 421: Misdirected Request Error<\/h2>\n<p>Ensure that the TLS settings are the same for all virtual hosts that are being used to serve a specific site.<\/p>\n<h2>HTTP\/2 Not Enabled on Older Versions of TLS<\/h2>\n<p>Apache can be forced to attempt HTTP\/2 upgrade with the following directive, but the effectiveness is questionable because browsers do not support HTTP\/2 for older TLS versions or cipher suites.<\/p>\n<blockquote><p>&gt; H2ModernTLSOnly off<\/p><\/blockquote>\n<div class=\"graysection\">\n<h2>Purchase a Multi-Domain SSL Certificate from CheapSSLSecurity &amp; Save Up to 89%!<\/h2>\n<p>We offer the best discount on multi-domain SSL certificates starting as low as $18.02 per year.<\/p>\n<p><a class=\"comparebtn\" href=\"https:\/\/cheapsslsecurity.com\/sslproducts\/san-ssl-certificates.html\">Shop All SAN Certificates<\/a><\/br><\/p>\n<p><a class=\"comparebtn\" href=\"https:\/\/cheapsslsecurity.com\/sslproducts\/multi-domain-ssl-certificates.html\">Shop All Multi-Domain Certificates<\/a><\/br><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>A step-by-step guide on How to Enable HTTP2 on Apache Apache is an open-source web server that serves both static and dynamic content. It\u2019s particularly useful because it\u2019s suitable for websites ranging in size from a few pages to thousands &hellip; <a href=\"https:\/\/cheapsslsecurity.com\/p\/how-to-enable-http2-on-apache\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[127],"tags":[59,19],"class_list":["post-672","post","type-post","status-publish","format-standard","hentry","category-ssl-installation-guides","tag-apache","tag-http2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Enable HTTP2 on Apache by SSL\/TLS Experts<\/title>\n<meta name=\"description\" content=\"A complete step-by-step guide and instructions to enable HTTP2 on Apache by SSL\/TLS experts at CheapSSLsecurity.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cheapsslsecurity.com\/p\/how-to-enable-http2-on-apache\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Enable HTTP2 on Apache by SSL\/TLS Experts\" \/>\n<meta property=\"og:description\" content=\"A complete step-by-step guide and instructions to enable HTTP2 on Apache by SSL\/TLS experts at CheapSSLsecurity.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cheapsslsecurity.com\/p\/how-to-enable-http2-on-apache\/\" \/>\n<meta property=\"og:site_name\" content=\"Cheap SSL Security\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/CheapSSLSecurities\" \/>\n<meta property=\"article:published_time\" content=\"2019-09-05T10:54:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-11T20:27:55+00:00\" \/>\n<meta name=\"author\" content=\"casey.crane\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@sslsecurity\" \/>\n<meta name=\"twitter:site\" content=\"@sslsecurity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"casey.crane\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/how-to-enable-http2-on-apache\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/how-to-enable-http2-on-apache\\\/\"},\"author\":{\"name\":\"casey.crane\",\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/#\\\/schema\\\/person\\\/d9c1744bb0931c1942814061a5aca108\"},\"headline\":\"How to Enable HTTP2 on Apache\",\"datePublished\":\"2019-09-05T10:54:14+00:00\",\"dateModified\":\"2025-06-11T20:27:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/how-to-enable-http2-on-apache\\\/\"},\"wordCount\":672,\"keywords\":[\"apache\",\"http2\"],\"articleSection\":[\"SSL Installation Guides\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/how-to-enable-http2-on-apache\\\/\",\"url\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/how-to-enable-http2-on-apache\\\/\",\"name\":\"How to Enable HTTP2 on Apache by SSL\\\/TLS Experts\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/#website\"},\"datePublished\":\"2019-09-05T10:54:14+00:00\",\"dateModified\":\"2025-06-11T20:27:55+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/#\\\/schema\\\/person\\\/d9c1744bb0931c1942814061a5aca108\"},\"description\":\"A complete step-by-step guide and instructions to enable HTTP2 on Apache by SSL\\\/TLS experts at CheapSSLsecurity.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/how-to-enable-http2-on-apache\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/how-to-enable-http2-on-apache\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/how-to-enable-http2-on-apache\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"SSL Help\",\"item\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SSL Installation Guides\",\"item\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/ssl-installation-guides\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Enable HTTP2 on Apache\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/#website\",\"url\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/\",\"name\":\"Cheap SSL Security\",\"description\":\"Shop for SSL Certificates at Cheap Prices\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/#\\\/schema\\\/person\\\/d9c1744bb0931c1942814061a5aca108\",\"name\":\"casey.crane\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c18d819d34a1995e91a4aa7518e9048df7856f336a1ede2262a572db7b1c2506?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c18d819d34a1995e91a4aa7518e9048df7856f336a1ede2262a572db7b1c2506?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c18d819d34a1995e91a4aa7518e9048df7856f336a1ede2262a572db7b1c2506?s=96&d=mm&r=g\",\"caption\":\"casey.crane\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Enable HTTP2 on Apache by SSL\/TLS Experts","description":"A complete step-by-step guide and instructions to enable HTTP2 on Apache by SSL\/TLS experts at CheapSSLsecurity.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cheapsslsecurity.com\/p\/how-to-enable-http2-on-apache\/","og_locale":"en_US","og_type":"article","og_title":"How to Enable HTTP2 on Apache by SSL\/TLS Experts","og_description":"A complete step-by-step guide and instructions to enable HTTP2 on Apache by SSL\/TLS experts at CheapSSLsecurity.","og_url":"https:\/\/cheapsslsecurity.com\/p\/how-to-enable-http2-on-apache\/","og_site_name":"Cheap SSL Security","article_publisher":"https:\/\/www.facebook.com\/CheapSSLSecurities","article_published_time":"2019-09-05T10:54:14+00:00","article_modified_time":"2025-06-11T20:27:55+00:00","author":"casey.crane","twitter_card":"summary_large_image","twitter_creator":"@sslsecurity","twitter_site":"@sslsecurity","twitter_misc":{"Written by":"casey.crane","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cheapsslsecurity.com\/p\/how-to-enable-http2-on-apache\/#article","isPartOf":{"@id":"https:\/\/cheapsslsecurity.com\/p\/how-to-enable-http2-on-apache\/"},"author":{"name":"casey.crane","@id":"https:\/\/cheapsslsecurity.com\/p\/#\/schema\/person\/d9c1744bb0931c1942814061a5aca108"},"headline":"How to Enable HTTP2 on Apache","datePublished":"2019-09-05T10:54:14+00:00","dateModified":"2025-06-11T20:27:55+00:00","mainEntityOfPage":{"@id":"https:\/\/cheapsslsecurity.com\/p\/how-to-enable-http2-on-apache\/"},"wordCount":672,"keywords":["apache","http2"],"articleSection":["SSL Installation Guides"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/cheapsslsecurity.com\/p\/how-to-enable-http2-on-apache\/","url":"https:\/\/cheapsslsecurity.com\/p\/how-to-enable-http2-on-apache\/","name":"How to Enable HTTP2 on Apache by SSL\/TLS Experts","isPartOf":{"@id":"https:\/\/cheapsslsecurity.com\/p\/#website"},"datePublished":"2019-09-05T10:54:14+00:00","dateModified":"2025-06-11T20:27:55+00:00","author":{"@id":"https:\/\/cheapsslsecurity.com\/p\/#\/schema\/person\/d9c1744bb0931c1942814061a5aca108"},"description":"A complete step-by-step guide and instructions to enable HTTP2 on Apache by SSL\/TLS experts at CheapSSLsecurity.","breadcrumb":{"@id":"https:\/\/cheapsslsecurity.com\/p\/how-to-enable-http2-on-apache\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cheapsslsecurity.com\/p\/how-to-enable-http2-on-apache\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cheapsslsecurity.com\/p\/how-to-enable-http2-on-apache\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"SSL Help","item":"https:\/\/cheapsslsecurity.com\/p\/"},{"@type":"ListItem","position":2,"name":"SSL Installation Guides","item":"https:\/\/cheapsslsecurity.com\/p\/ssl-installation-guides\/"},{"@type":"ListItem","position":3,"name":"How to Enable HTTP2 on Apache"}]},{"@type":"WebSite","@id":"https:\/\/cheapsslsecurity.com\/p\/#website","url":"https:\/\/cheapsslsecurity.com\/p\/","name":"Cheap SSL Security","description":"Shop for SSL Certificates at Cheap Prices","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cheapsslsecurity.com\/p\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/cheapsslsecurity.com\/p\/#\/schema\/person\/d9c1744bb0931c1942814061a5aca108","name":"casey.crane","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c18d819d34a1995e91a4aa7518e9048df7856f336a1ede2262a572db7b1c2506?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c18d819d34a1995e91a4aa7518e9048df7856f336a1ede2262a572db7b1c2506?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c18d819d34a1995e91a4aa7518e9048df7856f336a1ede2262a572db7b1c2506?s=96&d=mm&r=g","caption":"casey.crane"}}]}},"_links":{"self":[{"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/posts\/672","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/comments?post=672"}],"version-history":[{"count":0,"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/posts\/672\/revisions"}],"wp:attachment":[{"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/media?parent=672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/categories?post=672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/tags?post=672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}