Search Engine: Elastic

Article ID: 132340, created on Mar 7, 2018, last review on Jun 7, 2018

  • Applies to:
  • Operations Automation

Using the mod_deflate Apache module, you can compress the content of websites before it is delivered to clients. To learn more about the module, refer to the http://httpd.apache.org/docs/2.2/mod/mod_deflate.html webpage.

Note: This module is supported since CloudLinux 6

To enable mod_deflate for all websites on a WebHosting Linux server, follow the below steps:

  1. Make sure the mod_deflate module is enabled in the main Apache configuration file:

    # grep -i deflate /etc/httpd/conf/httpd.conf
    LOADMODULE deflate_module modules/mod_deflate.so
    

    and the module is loaded:

    # apachectl -M | grep -i deflate
    [Thu Jun 07 11:02:17 2018] [notice] POA VHosts: module has registered its hooks.
    Syntax OK
     deflate_module (shared)
    
  2. Edit the file /etc/httpd/conf.d/ng_custom.conf and add the below lines to compress the most common text-based types of files:

    <Directory "/var/www/vhosts">
        AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
    </Directory>
    
  3. Restart the Apache service:

    # service httpd restart
    

Note: If you are using a WebHosting Linux cluster, carry out these steps for all nodes in the cluster

See also:

5356b422f65bdad1c3e9edca5d74a1ae caea8340e2d186a540518d08602aa065 e12cea1d47a3125d335d68e6d4e15e07

Email subscription for changes to this article
Save as PDF