How to configure httpd.conf file to enable zip compression on js, css and html files


We are using Apache 1.3 and would like to compress js, css and html files for optimisation. The mod_gzip component is enabled. Please could you help in specifying what configuration is required in the httpd.conf file to compress css, js and html files.

thanks in advance
Who is Participating?
Monis MontherConnect With a Mentor System ArchitectCommented:
Sorry Yes you are right, this is for apache 2.x for the older 1.3 its called mod_gzip

this is the how to

Monis MontherSystem ArchitectCommented:
1- make sure this line is un hashed (This enables the module)
Under httpd.conf

LoadModule deflate_module modules/

2- Under Your Virtual Host under your Directory where compression is to be enabled

AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript


3- (Optional ) you can add logging for deflate to verify and confirm that it is compressing

After the </Directory>

DeflateFilterNote Input input_info
DeflateFilterNote Output output_info
DeflateFilterNote Ratio ratio_info
LogFormat '"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)' deflate
CustomLog /var/log/httpd/deflate_log deflate

Herre your log file is /var/log/httpd/deflate_log

Note: Its better to disable its logging once proven to work to avoid un-necessary writes to the disk
singh101Author Commented:
Is the mdoule available on Apache 1.3. I thought this was only for apache 2.0. Please confirm.
All Courses

From novice to tech pro — start learning today.