Admins eHow SysAdmin Tips & Tricks

May 11, 2014

How to enable mod_deflate on Apache 2.4

Filed under: Apache — Tags: , , , — admin @ 7:02 am

Well, I am writing this guide because enabling mod_deflate on Apache 2.4 has become more complex than enabling a single module like it was on Apache 2.2
Now you have to enable 3 modules in httpd.conf for mod_deflate to work properly :

LoadModule deflate_module modules/
LoadModule headers_module modules/
LoadModule filter_module modules/

Also you have to enable compression by this config :

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
DeflateCompressionLevel 9
  • Fedor

    Thanks! This was very useful.

  • kilevvri1

    I read this and after checking realized on module wasn’t loaded. Sorted out my issue after it was enabled. Thanks.

  • This is good, but I highly recommend everyone check the HTML5 Boilerplate example, there are some small details regarding gzip that may be useful:

    Go to the /dist folder you’ll find a .htaccess with best practices for many things Apache, including gzip

  • Abdel Karim Mateos Sanchez

    AddOutputFilterByType is deprecated.

Powered by WordPress