Re: Apache/php Compression not enabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

I dug around to find the webserver logging, and found that it's not logging to apache2, it's logging to nginx. 
So I think apache compression doesn't work because we're not using apache. 
Sorry, My bad :(


On 2024/01/24 17:21, Franciscus van Meelis wrote:

Hi

Apologies, I'm figuring this out as I go along, so I might state the obvious, or not state something that I should.

We've deployed an application to a hosted linux server running CentOS v7.9.2009 standard kvm, I have full access to this via whm, cpanel, putty, and ftp.

The application's front end is coded in php, the back end in java, both accessing a set of mysql databases. I'm java, I don't know php at all.

I'm trying to enable Apache deflate. I'm using the following as a guide:

https://copyprogramming.com/howto/compressing-content-with-php-ob-start-vs-apache-deflate-gzip

This is actually critical, we're trying to target Zimbabwe, and have only now figured out how slow, expensive, and nasty their internet actually is.

What I have tried:

If I go into WHM and look at EasyApache, I can see that we're using Apache 2.4, and the mod_deflate package is enabled.

I launch filezilla and navigate to .htaccess. I pull it to my machine, edit it to include all of the AddOutputFilterByType DEFLATE lines, the important one being text/html. I upload it back.
I'm absolutely sure it's the correct file, because at some point I tried some other code, and the landing page gave an internal server error until I removed it.

I initially tested using the pingdom site linked to on that guide, but later I just used wget from a powershell, and looked for a line saying Content-Encoding:gzip.

I also logged into the system using chrome, and looked at the developer tools view. I then started wireshark, then navigated to a particularly heavy form. I stopped wireshark, and looked at the stats. I also ftped into the server and looked at the html file that the php had generated. The generated file was 5.56Mb in size, but if I compressed it using 7Zip it reduced to 116kb, or 200kb with winzip. The wireshark traffic looked to be 6474 packets of 1514 bytes each over 5 seconds sent from the server, while my machine replied with 6460 packets of 54 bytes each. This totals around 9.3Mb down and 340kb returned. So not compressed.

It occurs to me that the html generated by php is in a subdirectory under the .htaccess file, so might be excluded from it's scope? Is that a thing? Can you move where php generates html?

Thanks



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux