{"id":951,"date":"2017-01-23T11:14:51","date_gmt":"2017-01-23T11:14:51","guid":{"rendered":"http:\/\/www.haxed.me.uk\/?p=951"},"modified":"2017-01-23T11:15:09","modified_gmt":"2017-01-23T11:15:09","slug":"enable-gzip-compressionmod_deflate-apache","status":"publish","type":"post","link":"https:\/\/haxed.me.uk\/index.php\/2017\/01\/23\/enable-gzip-compressionmod_deflate-apache\/","title":{"rendered":"How To Enable GZIP Compression\/mod_deflate in Apache"},"content":{"rendered":"<p>This is something quite easy to do.<\/p>\n<p>Check that the deflate module is installed<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# apachectl -M | grep deflate\r\n deflate_module (shared)\r\nSyntax OK\r\n<\/pre>\n<p>Check the content encoding is enabled by using curl on the site<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# curl -I -H 'Accept-Encoding: gzip,deflate' http:\/\/somewebsite.com\/\r\nHTTP\/1.1 200 OK\r\nDate: Fri, 23 Jan 2017 11:02:16 GMT\r\nServer: Apache\r\nX-Pingback: http:\/\/somewebsite.com\/somesite.php\r\nX-Powered-By: rabbits\r\nConnection: close\r\nContent-Type: text\/html; charset=UTF-8\r\n<\/pre>\n<p>Create a file called \/etc\/httpd\/conf.d\/deflate.conf<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&lt;ifmodule mod_deflate.c&gt;\r\n    AddOutputFilterByType DEFLATE text\/html text\/plain text\/xml text\/css text\/javascript application\/javascript\r\n    DeflateCompressionLevel 8\r\n&lt;\/ifmodule&gt;\r\n<\/pre>\n<p>Restart apache2<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n\/etc\/init.d\/httpd reload\r\nReloading httpd:\r\n<\/pre>\n<p>retest the gzip content-encoding directive with curl using Accept-Encoding: gzip directive.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n\r\n# curl -I -H 'Accept-Encoding: gzip,deflate' http:\/\/somesite.com\/\r\nHTTP\/1.1 200 OK\r\nDate: Fri, 25 Sep 2015 00:04:26 GMT\r\nServer: Apache\r\nX-Pingback: http:\/\/somesite.com\/somesite.php\r\nX-Powered-By: muppets\r\nVary: Accept-Encoding\r\nContent-Encoding: gzip    &lt;---- this line indicates that compression is active\r\nContent-Length: 20\r\nConnection: close\r\nContent-Type: text\/html; charset=UTF-8<\/pre>\n<p>For this, thanks to odin.com<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is something quite easy to do. Check that the deflate module is installed # apachectl -M | grep deflate deflate_module (shared) Syntax OK Check the content encoding is enabled by using curl on the site # curl -I -H &hellip; <a href=\"https:\/\/haxed.me.uk\/index.php\/2017\/01\/23\/enable-gzip-compressionmod_deflate-apache\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33,19,61],"tags":[],"class_list":["post-951","post","type-post","status-publish","format-standard","hentry","category-apache","category-bash","category-rackspace"],"_links":{"self":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/951","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/comments?post=951"}],"version-history":[{"count":2,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/951\/revisions"}],"predecessor-version":[{"id":953,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/951\/revisions\/953"}],"wp:attachment":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/categories?post=951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/tags?post=951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}