{"id":892,"date":"2014-10-30T03:43:51","date_gmt":"2014-10-30T03:43:51","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=892"},"modified":"2014-10-30T03:43:51","modified_gmt":"2014-10-30T03:43:51","slug":"add-mod-deflate-plesk-centos-6-5","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2014\/10\/30\/add-mod-deflate-plesk-centos-6-5\/","title":{"rendered":"Add Mod deflate on Plesk with CentOS 6.5"},"content":{"rendered":"<p>By default deflate module is already compiled on Plesk based Linux servers(new versions). You just need to add the rules in Apache to enable\/load the deflate module.<\/p>\n<p>You can test if your website already has mod_deflate enabled using the following tool.<\/p>\n<p><a href=\"http:\/\/www.whatsmyip.org\/mod_gzip_test\/\" target=\"_blank\" rel=\"noopener\">http:\/\/www.whatsmyip.org\/mod_gzip_test\/<\/a><\/p>\n<p>Check the main httpd.conf file<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# grep &#039;mod_deflate&#039; \/etc\/httpd\/conf\/httpd.conf\n\n<\/pre>\n<p>If the result was LoadModule deflate_module modules\/mod_deflate.so, you can continue. If the result was #LoadModule deflate_module modules\/mod_deflate.so, please run the following command:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# perl -pi -e &#039;s\/# LoadModule mod_deflate\/LoadModule mod_deflate\/g&#039; \/etc\/httpd\/conf\/httpd.conf\n<\/pre>\n<p>Then add this to the httpd.conf file for the site<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">#\n# Deflate output configuration\n#\nAddOutputFilterByType DEFLATE text\/html text\/plain text\/xml text\/css\nBrowserMatch ^Mozilla\/4 gzip-only-text\/html\nBrowserMatch ^Mozilla\/4.0&#x5B;678] no-gzip\nBrowserMatch bMSIE !no-gzip !gzip-only-text\/html\n\n<\/pre>\n<p>Restart Apache and test from online tools to see if deflate is enabled.<\/p>\n<p>Other configuration<\/p>\n<p>Include this in the conf.d directory. Make sure that the conf.d directory is included in httpd.conf.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# Insert filter\nSetOutputFilter DEFLATE\n\n# Netscape 4.x has some problems...\nBrowserMatch ^Mozilla\/4 gzip-only-text\/html\n\n# Netscape 4.06-4.08 have some more problems\nBrowserMatch ^Mozilla\/4.0&#x5B;678] no-gzip\n\n# MSIE masquerades as Netscape, but it is fine\n# BrowserMatch bMSIE !no-gzip !gzip-only-text\/html\n\n# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48\n# the above regex won&#039;t work. You can use the following\n# workaround to get the desired effect:\nBrowserMatch bMSI&#x5B;E] !no-gzip !gzip-only-text\/html\n\n# Don&#039;t compress images\nSetEnvIfNoCase Request_URI \n.(?:gif|jpe?g|png)$ no-gzip dont-vary\n\n# Make sure proxies don&#039;t deliver the wrong content\nHeader append Vary User-Agent env=!dont-vary\n\n<\/pre>\n<p>Restart Apache and test from online tools to see if deflate is enabled.<\/p>\n<p>Easy<\/p>\n<p>On a Plesk server, the mod_deflate module is installed by default, however it may be disabled in the Apache configuration file. To enable the mod_deflate module in Plesk edit the Apache configuration file<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# vi \/etc\/httpd\/conf\/httpd.conf\n\n<\/pre>\n<p>Search the line that says,<\/p>\n<p>#LoadModule deflate_module modules\/mod_deflate.so<\/p>\n<p>and uncomment it i.e. remove the \u2018#\u2019 mark<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nLoadModule deflate_module modules\/mod_deflate.so\n\n<\/pre>\n<p>Now, create a \/etc\/httpd\/conf.d\/deflate.conf file. Apache reads all the .conf files from the \/etc\/httpd\/conf.d directory on a Plesk server.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# vi \/etc\/httpd\/conf.d\/deflate.conf\n<\/pre>\n<p>and place the following code in it<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nSetOutputFilter DEFLATE\nSetEnvIfNoCase Request_URI  \\\n\\.(?:gif|jpe?g|png)$ no-gzip dont-vary\n\n<\/pre>\n<p>Save the file and restart Apache.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# service httpd restart\n\n<\/pre>\n<p>Source: http:\/\/linuxhostingsupport.net\/blog\/how-to-enable-http-compression-on-a-plesk-server<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default deflate module is already compiled on Plesk based Linux servers(new versions). You just need to add the rules in Apache to enable\/load the deflate module. You can test if your website already has mod_deflate enabled using the following tool. http:\/\/www.whatsmyip.org\/mod_gzip_test\/ Check the main httpd.conf file # grep &#039;mod_deflate&#039; \/etc\/httpd\/conf\/httpd.conf If the result was &#8230; <a title=\"Add Mod deflate on Plesk with CentOS 6.5\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2014\/10\/30\/add-mod-deflate-plesk-centos-6-5\/\" aria-label=\"Read more about Add Mod deflate on Plesk with CentOS 6.5\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,86],"tags":[],"class_list":["post-892","post","type-post","status-publish","format-standard","hentry","category-apache","category-plesk"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/892","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=892"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/892\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=892"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=892"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=892"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}