Where and How to enable mod_deflate on Apache 2.4?

Terrance

Member
Registered
Joined
Jun 30, 2016
Messages
33
Points
0
I knew that mod_deflate will help compressing data like html, js, css before transmitting them to the visitors can speed up your sites and save you bandwidth. Recently I have updated my web server Apache on one server from version 2.2 to 2.4 but my mod_deflate rules won't work for any reasons, may be changes in the new version of Apache. So where and how to enable mod_deflate on Apache 2.4 all whole my VPS and is there a way to do that in WHM?

I saw an option in cPanel on each reseller account, it is Optimize Website > Compress All Content. Is this the same to mod_deflate?
 

Luxin Host

Well-known member
Registered
Joined
Jun 26, 2016
Messages
543
Points
43
If you are using WHM its easy.

go to : Service Configuration Apache Configuration > Include Editor > Pre VirtualHost Include

Choose from preference on the drop down menu, use all version implement settings on the whole server.

Add the code below:

Code:
<IfModule mod_deflate.c> 
SetOutputFilter DEFLATE 
SetEnvIfNoCase Request_URI \.(?:gif|ico|zip|gz|mp4|flv)$ no-gzip
</IfModule>
Note: incase you didnt know, the formats in the code above are EXCLUDED from compression.
 
Similar Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top