How to Enable HTTP/2 On a Server

HTTP/2 is a major advancement in web protocol technology, offering significant improvements in speed, efficiency, and security over HTTP/1.1. With features like multiplexing, header compression, and server push, HTTP/2 can significantly reduce web page load times and enhance the user experience.

In this blog, we’ll explain HTTP/2 and guide you through the process of enabling it on your server using common control panels like Plesk and cPanel. We’ll break down the steps, providing detailed instructions and important notes to ensure a smooth transition. Let’s get started!

What is HTTP/2?

HTTP/2 is a major revision of the HTTP network protocol, officially approved in 2015. Based on Google’s SPDY protocol, it is designed to improve the speed, efficiency, and security of data transfer between a client and server. HTTP/2 addresses many of the performance limitations of HTTP/1.1, which was standardized back in 1997.

HTTP/2 vs. HTTP/1.1

Connection Management

  • HTTP/1.1: Uses a single connection per request-response pair, leading to inefficiencies and increased latency.
  • HTTP/2: Utilizes a single connection for multiple streams, allowing multiple requests and responses to be sent simultaneously over one connection, reducing overhead and latency.

Header Compression

  • HTTP/1.1: Headers are sent as plain text, which can become quite large and add significant overhead.
  • HTTP/2: Implements header compression using the HPACK algorithm, reducing the size of headers and the amount of data that needs to be transferred.

Data Format

  • HTTP/1.1: Uses a text-based format, which is less efficient and more prone to errors during parsing.
  • HTTP/2: Adopts a binary format, which is more efficient for both transmission and parsing, reducing the likelihood of errors.

Server Push

  • HTTP/1.1: The server can only respond to requests made by the client.
  • HTTP/2: Introduces server push, allowing the server to send resources to the client proactively before they are requested, reducing load times for web pages by preloading critical resources.

The Need for HTTP/2

Growing Complexity of Web Content

Modern web pages often include numerous resources such as images, JavaScript files, CSS stylesheets, and more. HTTP/1.1 can lead to significant inefficiencies and delays due to the need for separate requests for each resource.

Performance Bottlenecks

HTTP/1.1’s request-response model can become a bottleneck, especially on mobile networks or in high-latency environments, slowing down page loads and frustrating users.

Enhanced Security Requirements

HTTP/2 requires the use of SSL/TLS, ensuring that data is encrypted during transmission, which enhances security and builds user trust.

Improved User Experience

Faster websites lead to higher user engagement, better search engine rankings, and increased conversions. HTTP/2’s features, such as multiplexing and server push, are key to achieving these performance gains.

Key Features and Benefits of HTTP/2

  • Multiplexing: Multiple requests and responses can be sent simultaneously over a single connection.
  • Header Compression: Reduces the overhead of HTTP headers, improving performance.
  • Server Push: Allows servers to send resources to the client before they are requested.
  • Binary Protocol: Unlike the text-based HTTP/1.1, HTTP/2 uses a binary format, which is more efficient to parse and less error-prone.

Enable HTTP/2 – Start Using HTTP/2

Before enabling HTTP/2, run a performance test on WebPageTest.org. Save the results – we’ll revisit them soon.

Plesk

  1. Log in to Plesk.
  2. Go to Tools & Settings > Updates and Upgrades to update Plesk and server packages.
  3. Verify that your server meets the requirements for HTTP/2 (Apache with nginx as a reverse proxy or Apache with mod_http2 module).
  4. Go to Tools & Settings > Apache Web Server and check the box to enable HTTP/2 support.
  5. Ensure nginx is configured to work with HTTP/2 if used as a reverse proxy, or ensure the mod_http2 module is enabled for Apache.
  6. Go to Websites & Domains > [select your domain] > SSL/TLS Certificates to install or verify a valid SSL certificate.
  7. Test HTTP/2 support using online tools like KeyCDN HTTP/2 Test or SSL Labs.
  8. Go to Tools & Settings > Services Management and restart Apache and nginx services.

Optional: Enabling HTTP/2 for Specific Domains

  1. Log in to Plesk.
  2. Go to Websites & Domains and select the domain.
  3. Click on Apache & nginx Settings.
  4. Enable Proxy mode, Smart static files processing, and HTTP/2 support.
  5. Click OK or Apply to save changes.
  6. Restart necessary services as described earlier.

cPanel

  1. Log in to WHM.
  2. Go to Home > cPanel > Upgrade to Latest Version to ensure cPanel is up to date.
  3. Go to Home > Software > Update Server Software and Home > Software > System Update to ensure all server packages are current.
  4. Navigate to Home > Software > EasyApache 4 and ensure EasyApache 4 is installed.
  5. In EasyApache 4, click Customize next to your current profile, go to the Apache Modules section, select the mod_http2 module, and click Provision.
  6. Go to Home > Service Configuration > Apache Configuration > Global Configuration and ensure the Protocols directive includes h2 and http/1.1.
  7. Go to Home > SSL/TLS > Manage SSL Hosts to install or verify valid SSL certificates for your domains.
  8. Go to Home > Restart Services > HTTP Server (Apache) and click Yes to restart Apache.
  9. Verify HTTP/2 support using online tools like KeyCDN HTTP/2 Test or SSL Labs.

Optional: Enabling HTTP/2 for Specific Domains

  1. Log in to cPanel.
  2. Go to Security > SSL/TLS and ensure a valid SSL certificate is installed for your domain.
  3. Verify HTTP/2 configuration for specific domains by checking the .htaccess file or any specific virtual host configurations.

Test HTTP/2 Performance

Once you’ve enabled HTTP/2 on your server, verify that it’s working correctly and see the performance benefits. The tool is WebPageTest.org, is excellent for this purpose. It allows you to run detailed performance tests from multiple locations around the world using real browsers.

Compare these new results with the old ones. Look for improvements in load times, reduced latency, and more efficient resource loading.

Are You Using WPEngine for your hosting?

At WP Engine, they understand that you want your website to perform at its best. They are committed to helping you achieve all your performance goals and provide a great experience for your visitors.

WP Engine was excited to announce that they supported HTTP/2, the latest version of the HTTP protocol. HTTP/2, often referred to as “H2,” enhances data transfer speed and can also improve your website’s SEO by reducing page load times.

Starting July 2016, They upgraded all customer sites to HTTP/2. This upgrade enhanced speed and SEO without requiring any changes from you, as long as you have SSL/TLS certificates. If your site did not have these certificates, you could easily purchase them through the User Portal. To check if HTTP/2 is active on your site, click here. If you want to purchase WPEngine hosting, you can follow this link and start with a big discount.

Take Action

If you need assistance with implementing and Enable HTTP/2 for your website, the Let’s Design For You team is here to help. Our experts can ensure a smooth and effective transition, enhancing your website’s performance and user experience. Get a free consultation today to learn how we can support your web development needs.

Resources

For additional reading and video tutorials, check out the following resources:

By following these steps, you can enable HTTP/2 on your server, enhancing your website’s performance and providing a better experience for your users.

Share this article

More Similar Posts

Accessibility Toolbar