{"id":981,"date":"2010-07-15T08:50:32","date_gmt":"2010-07-15T12:50:32","guid":{"rendered":"http:\/\/linuxhostingsupport.net\/blog\/?p=981"},"modified":"2013-03-20T08:43:17","modified_gmt":"2013-03-20T12:43:17","slug":"how-to-enable-http-compression-on-a-plesk-server","status":"publish","type":"post","link":"https:\/\/linuxhostingsupport.net\/blog\/how-to-enable-http-compression-on-a-plesk-server","title":{"rendered":"How to enable http compression on a Plesk server?"},"content":{"rendered":"<p><strong>W<\/strong><strong>hat is http compression and which module to use for http compression?<\/strong><\/p>\n<p>Compressing data before transmitting to the browsers and then uncompressing the data before displaying. The module that is responsible for http compression is called mod_deflate.The main advantage of mod_deflate is that it saves a lot of bandwidth and loads the pages faster.<\/p>\n<p><strong>On a Plesk server, the mod_deflate module is installed by default<\/strong>, 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<blockquote>\n<pre><span style=\"color: #0000ff;\"># vi \/etc\/httpd\/conf\/httpd.conf<\/span><\/pre>\n<\/blockquote>\n<p>Search the line that says,<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\">#LoadModule deflate_module modules\/mod_deflate.so<\/span><\/pre>\n<\/blockquote>\n<p>and uncomment it i.e. remove the &#8216;#&#8217; mark<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\">LoadModule deflate_module modules\/mod_deflate.so<\/span><\/pre>\n<\/blockquote>\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<blockquote>\n<pre><span style=\"color: #0000ff;\"># vi \/etc\/httpd\/conf.d\/deflate.conf<\/span><\/pre>\n<\/blockquote>\n<p>and place the following code in it<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\">&lt;Location \/&gt;\r\nSetOutputFilter DEFLATE\r\nSetEnvIfNoCase Request_URI\u00a0 \\\r\n\\.(?:gif|jpe?g|png)$ no-gzip dont-vary\r\n&lt;\/Location&gt;<\/span><\/pre>\n<\/blockquote>\n<p>Save the file and restart Apache.<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># service httpd restart<\/span><\/pre>\n<\/blockquote>\n<p>This compression code will compress all the files except the .gif, .jpe, .jpeg and .png files before sending them to the browser. To test the compression, use the tool<\/p>\n<p>http:\/\/www.whatsmyip.org\/mod_gzip_test\/<\/p>\n<p>To enable compression for a specific directory or domain, specify the directory path in the &lt;Location&gt; directive in deflate.conf and restart the Apache server.<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #0000ff;\"><strong>Related URLs:<\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><a title=\"Enable http compression on a plain linux server\" href=\"https:\/\/linuxhostingsupport.net\/blog\/howto-enable-http-compression\" target=\"_blank\">Enable http compression on a Plain Linux server<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is http compression and which module to use for http compression?<br \/>\nCompressing data before transmitting to the browsers and then uncompressing the data before displaying. The module that is responsible for http compression is called mod_deflate.The main advantage of mod_deflate is that it saves a lot of bandwidth and loads the pages faster.<br \/>\nOn 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<p># vi \/etc\/httpd\/conf\/httpd.conf<\/p>\n<p>Search the [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[1345,957,954,951,956,955,950,953,952],"_links":{"self":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/981"}],"collection":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/comments?post=981"}],"version-history":[{"count":7,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/981\/revisions"}],"predecessor-version":[{"id":983,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/981\/revisions\/983"}],"wp:attachment":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/media?parent=981"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/categories?post=981"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/tags?post=981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}