On LAMP how do one turn OFF an ON gZip compression?

Posted December 4, 2014 4.3k views

Hi there,

I see by default gzip is ON. That’s sound! But what if I want turn it off? I need perform some tests and see difference between turned on and off gzip.

I found this htaccess line of code RewriteRule . - [E=no-gzip:1]
Bot it seems doesn’t work..

Thank you

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers


You can disable gzip compression by disabling the two modules that handle it:

sudo a2dismod deflate
sudo a2dismod gzip

Make sure you restart Apache after doing that:

sudo service apache2 restart
  • Hey,
    Thanks for the quick replay

    Looks like it works.. Tho server told me he doesn’t know who is gZip

    Here’s log

    root@######:/var/www# sudo a2dismod deflate
    Module deflate disabled.
    To activate the new configuration, you need to run:
    service apache2 restart
    root@######:/var/www# sudo a2dismod gzip
    ERROR: Module gzip does not exist!
    root@######:/var/www# sudo /etc/init.d/apache2 restart
    * Restarting web server apache2 
    AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using Set the 'ServerName' directive globally to suppress this message

    Not sure what that all means.. first time on ubuntu.. on mac, sentos and freebsd was a bit different)