If you want to use Brotli with Apache, you’ll have to enable the use Apache brotli module. Unlike Nginx, there’s full Brotli support for the Apache web servers. This post was tested on Ubuntu Linux but should apply to other Linux distributions. The reason I selected Ubuntu is that it’s easy to use especially for new users. Also, for students and new users learning Linux, the easiest place to start learning is Ubuntu Linux. Ubuntu is the modern, open-source Linux operating system for desktops, servers, and other devices. When you’re ready to include Brotli support with Apache, follow the steps below:

How to install Let’s Encrypt SSL on Ubuntu Linux

Brotli requires SSL. Apache will need to have SSL support before you’ll be able to use Brotli. Since Let’s Encrypt is easy to install and use with Ubuntu, we’ve written a great post on how to install a Let’s Encrypt free SSL certificate. Click on the post below to learn how to install Let’s Encrypt free SSL certificates on Ubuntu Linux. How to install Let’s Encrypt on Ubuntu Linux with Apache

How to Install Apache on Ubuntu Linux

If you don’t already have an Apache server installed, then use the steps below to download and install it from the Ubuntu repository. Installing Apache on Ubuntu Linux is pretty straightforward. Apache package is in Ubuntu repositories, so all one needs to do is run the apt-get command to install it. We’ve written a great post on how to Install Apache on Ubuntu Linux. Click on the post below to learn how to install and configure Apache on Ubuntu Linux. How to install Apache on Ubuntu Linux

How to install and enable the Apache Brotli module

At this point, you should have Apache installed with Let’s Encrypt support. If you haven’t already done so, refer to the steps above. Before you can enable the Brotli module for Apache, you must first install it. Brotli package is available in the Ubuntu default repository. Simply run the commands below to install Brotli Once Brotli is installed, run the commands below to enable the Apache Brotli module. Next, add the directive to Apache virtual host to enable Brotli support. You need to add the below code in the virtual host configuration file. An example example.com.conf virtual host configurations should look similar to the one below. When you add Brotli support above, run the commands below to restart Apache. You can text Brotli support using the curl command against your domain. That should do it! Conclusion: This post showed you how to enable Brotli support on Apache. If you find any error above or have something to add, please use the comment form below.