본문 바로가기

Linux Distributions

How to Enable HTTP/2 in Apache 2.4 on Ubuntu 22.04

728x90
반응형

How to Enable HTTP/2 in Apache 2.4 on Ubuntu 22.04

To enable HTTP/2 in Apache 2.4 on Ubuntu 22.04, you can follow these steps:

 

1. Update your system:

sudo apt update

 

2. Install Apache 2.4 with SSL support and HTTP/2 module:

sudo apt install apache2
sudo apt install libapache2-mod-http2

 

3. Enable the necessary modules:

sudo a2enmod http2
sudo a2enmod ssl

 

4. Configure your virtual hosts:

Edit the Apache configuration file for your virtual host(s) where you want to enable HTTP/2. Typically, the configuration file is located at /etc/apache2/sites-available/your_virtual_host.conf. Add the following lines inside the <VirtualHost> block:

Protocols h2 http/1.1

 

5. Configure SSL/TLS:

Edit the SSL configuration file located at /etc/apache2/mods-available/ssl.conf. Make sure the following line is present and not commented out:

SSLProtocol -all +TLSv1.2 +TLSv1.3

 

6. Restart Apache:

sudo systemctl restart apache2

 

After following these steps, HTTP/2 should be enabled on your Apache 2.4 server running on Ubuntu 22.04. You can verify it by checking the response headers of your website using a browser developer tool or an online HTTP/2 checker tool.

 

728x90
반응형