If you enable GZIP compression, the Apache web server compresses data while sending responses to improve website speed and performance.
Follow the steps below to enable GZIP compression for Apache in Ubuntu, CentOS.
-
Enable the GZIP module in Apache. For RHEL/CentOS systems, open either of the Apache configuration files in [drive]:\path\to\apache\conf\httpd.conf or /etc/apache2/apache2.conf.
-
Uncomment the following line by removing # from the beginning of the line.
LoadModule deflate_module modules/mod_deflate.so
LoadModule filter_module modules/mod_filter.so -
Enable GZIP compression in .htaccess. If you have set up an Apache Virtual Host, you can open the .htaccess file for your website and add the following lines:
.