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

Hi,

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
singh101Asked:
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

http://articles.sitepoint.com/article/web-output-mod_gzip-apache

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

LoadModule deflate_module modules/mod_deflate.so

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

<Directory......etc>
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript

</Directory>

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
0
 
singh101Author Commented:
Is the mod_deflate.so mdoule available on Apache 1.3. I thought this was only for apache 2.0. Please confirm.
0
All Courses

From novice to tech pro — start learning today.