Disable HTTP compression on Apache servers
This article explains how to check if your Apache® server has compressed HTTP.
It also explains how to disable this compression.
Test your server for HTTP compression
-
Connect to the server by using OpenSSL.
-
Add the following request to the header to check for HTTP compression:
Accept-Encoding:compress,gzip
If you have enabled compression, the server responds by compressing the page.
If the server does not support compression, it displays the page in plain text.
Disable HTTP compression by using Ubuntu or Debian operating systems
To disable the compression by using Debian® or the Ubuntu® operating system,
use the following steps:
-
Disable the module mod_deflate by using the following command:
$ sudo a2dismod deflate
-
Restart the server:
$ sudo /etc/init.d/apache2 restart
Disable HTTP compression by using Red Hat or CentOS operating systems
To disable the compression by using Red Hat® or CentOS®, use the following steps:
-
Access the main configuraton file:
$ sudo nano /etc/httpd/conf/httpd.conf
-
Comment the following line so the system can execute it:
LoadModule deflate_module modules/mod_deflate.so
-
Restart the server:
$ sudo /etc/init.d/httpd restart
Use the Feedback tab to make any comments or ask questions. You can also start a conversation with us.
Updated about 1 year ago