![]() |
HTTP/2 is a significant update to the HTTP protocol. It was created to outperform HTTP 1.1 in terms of performance and latency. The applications operate way faster and more efficiently if we enable HTTP/2 on our Apache server. Prerequisites
Step to Enable HTTP/2 in ApacheStep 1: Update ApacheCheck, your Apache installation is up to date. On Ubuntu or Debian-based systems, you can update Apache using: sudo apt update Step 2: Enabling SSL ModuleEnable SSL Module using the following command sudo a2enmod ssl
Step 3: Enable HTTP/2 ModuleEnable the HTTP/2 module in Apache. On Ubuntu/Debian systems. sudo a2enmod http2
Step 4: Configure Apache to Use HTTP/2Now, Edit your Apache SSL configuration file. location: /etc/apache2/sites-available/default-ssl.conf (Ubuntu/Debian) <VirtualHost *:443> Ensure Protocols h2 http/1.1 is added within the VirtualHost block. Step 5: Restart ApacheAfter making these changes, restart Apache to apply the new configuration: sudo systemctl restart apache2
Step 6: Verify HTTP/2 is EnabledYou can verify that HTTP/2 is enabled using a web browser or an online HTTP/2 checker. For a command-line approach command: curl -I -k -s --http2 https://www.example.com
Look for HTTP/2 200 or similar in the output, indicating HTTP/2 support. Troubleshooting
location /var/log/apache2/error.log (Ubuntu/Debian).
openssl version
sudo apachectl configtest
ConclusionIf we enable HTTP/2 on Apache server it enhances the performance of application by improving the page time loades. By following this guide steps oulined you can easily enable HTTP/2 in your apache server. |
Reffered: https://www.geeksforgeeks.org
Web Technologies |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 17 |