How to Enable HTTP/2 Support in Apache

Post Date: October 16, 2019
Last Updated: October 31, 2026

Introduction

HTTP/2 is a major revision of the HTTP protocol designed to improve website performance, reduce latency, and enable faster communication between web servers and browsers. It was developed by the Internet Engineering Task Force (IETF) and is based on Google’s earlier experimental SPDY protocol.

HTTP/2 introduces several improvements over HTTP/1.1, including multiplexing, header compression, and more efficient resource loading. These enhancements help improve website loading speed and overall performance.

In this tutorial, we will explain how to enable HTTP/2 support in Apache on a CentOS server and verify that it is working correctly.

Prerequisites

Before enabling HTTP/2 support in Apache, ensure that you have the following:

  • A server running CentOS 7.7
  • Apache HTTP Server installed and running
  • A website configured with Apache
  • A valid SSL/TLS certificate installed for your domain
  • Root or sudo access to the server

Note: HTTP/2 is generally enabled over HTTPS in modern browsers. If your domain does not have an SSL certificate, install a Let’s Encrypt SSL certificate before proceeding.

Implementation

1. Enable http2 in apache ssl configuration

To enable HTTP/2 protocol, you need to edit existing SSL configuration. In CentOS you can find the file at /etc/httpd/conf/httpd-le-ssl.conf

Add the following line inside virtual host directive

Protocols h2 h2c http/1.1

2. Verify Syntax

# apachectl -t<br> Syntax OK

3. Restart Apache

systemctl restart httpd

4. Verify HTTP/2 Support

There is an awesome website where you can verify the website is supporting HTTP/2 or not.

https://http2.pro

For instance https://google.com output as follows

Conclusion

In this tutorial, we learned how to enable HTTP/2 support in Apache by modifying the SSL virtual host configuration, verifying the Apache configuration syntax, and restarting the Apache service.

We also learned how to verify HTTP/2 support using an online testing tool. Enabling HTTP/2 can improve website performance through multiplexing, header compression, and more efficient communication between browsers and web servers.

For more Apache configuration guides, HTTP/2 tutorials, Linux server administration, web server optimization, and troubleshooting tips, visit pheonixsolutions.com.

FAQs

1. What is HTTP/2?

HTTP/2 is the second major version of the HTTP protocol that improves website performance, reduces latency, and enables faster communication between web browsers and servers.

2. What are the benefits of HTTP/2?

HTTP/2 offers several benefits, including multiplexing, header compression, reduced latency, and improved website loading speed.

3. Is SSL required to enable HTTP/2 in Apache?

Yes, most modern web browsers support HTTP/2 over HTTPS. Therefore, a valid SSL/TLS certificate is recommended.

Redirect HTTP to HTTPS in Apache

Need Help with Apache Configuration and HTTP/2 Implementation?

Need help enabling HTTP/2 in Apache, configuring SSL certificates, optimizing web server performance, or troubleshooting Apache-related issues? Our experts can assist with Apache installation, HTTP/2 configuration, SSL implementation, web server optimization, Linux server administration, and other infrastructure requirements. Get in touch with our team here.

admin

Our team has expertise across software and web development, WordPress, e-commerce, mobile applications, UI/UX, cloud and infrastructure, DevOps, CI/CD, API integration, security, testing, automation, and technical support. The team also works with AI-based software solutions, LLMs, AI workflows, AI agents, and intelligent application development to help businesses automate processes and build smarter digital solutions. We focus on developing, deploying, maintaining, and optimising secure, scalable, and reliable technology solutions while helping businesses adopt modern technologies and drive digital transformation.

Leave a Comment

Scroll to Top