• Article for your preferred language does not exist. Below is international version of the article.

Article ID: 126997, created on Sep 25, 2015, last review on Sep 28, 2016

  • Applies to:
  • Plesk Automation 11.5

Question

The module mod_deflate in Apache is installed but is not running:

# apachectl -M |grep deflate
 deflate_module (shared)
Syntax OK

If mod_deflate is active, there must be a line Content-Encoding: gzip in the output below:

# curl -I -H 'Accept-Encoding: gzip,deflate' http://example.com/
HTTP/1.1 200 OK
Date: Fri, 25 Sep 2015 00:02:16 GMT
Server: Apache
X-Pingback: http://example.com/xmlrpc.php
X-Powered-By: PleskLin
Connection: close
Content-Type: text/html; charset=UTF-8

As the line is not presented, gzip compression is not active. How to activate it?

Answer

  1. Create the file /etc/httpd/conf.d/deflate.conf with the following content on Apache Service node:

    <ifmodule mod_deflate.c>
        AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
        DeflateCompressionLevel 8
    </ifmodule>
    
  2. Reload web server on Apache Service node:

    [root@pa115apachemysql1 ~]# /etc/init.d/httpd reload
    Reloading httpd:
    
  3. Check if compression is active:

    # curl -I -H 'Accept-Encoding: gzip,deflate' http://example.com/
    HTTP/1.1 200 OK
    Date: Fri, 25 Sep 2015 00:04:26 GMT
    Server: Apache
    X-Pingback: http://example.com/xmlrpc.php
    X-Powered-By: PleskLin
    Vary: Accept-Encoding
    Content-Encoding: gzip    <---- this line indicates that compression is active
    Content-Length: 20
    Connection: close
    Content-Type: text/html; charset=UTF-8
    

Search Words

enable compression

deflate

slow wordpress

Content-Encoding

website slow

gzip

33a70544d00d562bbc5b17762c4ed2b3 caea8340e2d186a540518d08602aa065 e0aff7830fa22f92062ee4db78133079

Email subscription for changes to this article
Save as PDF