Gzip Compression on Centos 6

I have created a server on the centos 6 platform 64 bit and we are currently trying to enable the gzip compression to make our website load faster. Now we have read several different articles to make sure this works first we needed to make sure that module was installed we checked that and it does show as being installed and we also heard that by default it’s installed with the setup of the server we are running the vesta control panel. Based off our research you can set the compression by either doing it on the server or by doing it in the htaccess file so we tried adding it on the server side we tried adding the following code “AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript” in the following file “/etc/httpd/conf/httpd.conf” and still came back with no results every time we do this we are restarting apache to see if it’s takes effect we even rebooted the entire server to make sure everything restarts. We have also tried putting that code in the"/home/admin/conf/web/httpd.conf" as well with the same no results. If somebody can give a step by step on what we may be doing wrong maybe there’s a way to check if gzip is installed with certain commands and also which file do we actually modify to make the compression work. thank you.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Thats exactly what I mean. You should have Compression enabled then (if the browser supports it)

ok i went into the httpd.conf file and i found this already in the file “Include conf.d/*.conf” is this what you mean or should i add another include pointing to that specific file.

I just mean check that conf.d and sub folders are on the same line as an Include statement that should enable gzip compression for you.