3 Subj: KNOWN good mod_gzip sample configurations
6 NOTE: These KNOWN good sample configurations are for
7 version 1.3.17.2a ( and above ) of mod_gzip unless
10 Many thanks to the members of the mod_gzip online forum
11 for taking the time to post their KNOWN GOOD configurations.
13 You can join the mod_gzip online forum at...
14 http://lists.over.net/mailman/listinfo/mod_gzip
16 There are several 'safe' configurations in this file so scroll
17 down to see them all. They will be broken out into separate
18 files soon with their own links but for now they are all
19 included here in the same document.
22 *** MINIMUM 'SAFE' CONFIGURATION...
23 *** This will only compress text/html and text/plain MIME types...
25 Submitted by: Kevin Kiley 02/21/01
27 The minimum 'safe' set of configuration commands for
28 the 1.3.17.x series would still look like the following...
30 # [ mod_gzip sample configuration ]
32 # mod_gzip_on [Yes/No]
34 # Use this command to turn mod_gzip 'on' or 'off'.
35 # The command can go into the base server configuration
36 # or be used to control if mod_gzip is active inside
37 # any particular virtual directory or host section.
41 # mod_gzip_item_include type regular_expression
42 # mod_gzip_item_exclude type regular_expression
44 # Use 'include' and 'exclude' commands to specify which
45 # items are eligible for compression.
47 # The valid values for 'type' field are...
49 # file, mime, handler, reqheader, rspheader.
51 # The 3rd parameter must be a valid 'regular expression'
52 # which will be used to 'match' the requested item(s).
54 mod_gzip_item_include file \.htm$
55 mod_gzip_item_include file \.html$
56 mod_gzip_item_include mime text/.*
58 # NOTE: The following entry was required to compress negotiated
59 # home pages in version 1.3.17.1a but is now only needed
60 # if you would like to compress your directory listings...
62 # mod_gzip_item_include mime httpd/unix-directory
64 # mod_gzip_dechunk [Yes/No]
66 # If a response is being generated dynamically and
67 # the response content generator is always using
68 # 'Transfer-Encoding: chunked' then that response
69 # cannot normally be 'compressed' since a transport layer
70 # encoding is already being applied. The "mod_gzip_dechunk Yes"
71 # option will transparently remove all 'chunked' encoding
72 # and allow the response to be fully compressed. Certain
73 # versions of mod_php will need this option set ON for the
74 # dynamic output to be compressed. Whenever possible just
75 # make sure this option and the extra step required
76 # are NOT needed by making sure the response generator is NOT
77 # using 'Transfer-encoding: chunked'.
81 # mod_gzip_min_http [1000/1001/etc...]
83 # Only use this to 'block' browsers that don't support a
84 # certain minimum level of the HTTP protocol. The option
85 # uses the same internal 'numeric' value(s) used by Apache
86 # itself to indicate certain HTTP protocol support level(s).
88 # 1000=HTTP/1.0 1001=HTTP/1.1, etc.
90 # mod_gzip_min_http 1000
92 # mod_gzip_temp_dir /tmp
94 # Use this option to specify the directory that mod_gzip should
95 # use for workfiles. Do not add a trailing 'slash' to the name.
97 # Whenever possible ( and for the best performance ) this 'temporary'
98 # workfile directory should be a valid RAMDISK.
100 # The directory must already exist when Apache starts.
102 # Be sure permissions are set right for whatever directory is
103 # used as the 'temp_dir'. The User/Group used by the Server during
104 # runtime ( such as 'www' or 'nobody' ) must have read/write
105 # access to the directory. If permissions are incorrect then the
106 # mod_gzip 'result' string will probably be 'RECOVERY' and your
107 # Apache error_log will contain messages about mod_gzip being
108 # unable to access work files.
110 # If no 'mod_gzip_temp_dir' is specified then the DEFAULTS are...
115 mod_gzip_temp_dir /tmp
117 # mod_gzip_keep_workfiles [Yes/No]
119 # If this option is 'Yes' then mod_gzip will not delete any
120 # workfiles it may be generating in the 'mod_gzip_temp_dir'
121 # location. Use this option only for diagnostic purposes.
122 # The 'default' setting is 'No'.
124 mod_gzip_keep_workfiles No
126 # [End of mod_gzip sample config]
129 *** PHP, JAVA JSP TOMCAT, MOD_JK, MOD_PERL, ETC...
131 Submitted by: David Rees 02/21/01
133 Here is a KNOWN working config which compresses output for static
134 text files, PHP, JSP/servlets (using Jakarta Tomcat/ mod_jk),
135 mod_perl as well as the output from the mod_status and
136 mod_info modules. It EXCLUDES Style Sheets ( .css ) and
137 .js scripts and image/* mime type(s).
140 mod_gzip_minimum_file_size 300
141 mod_gzip_maximum_file_size 0
142 mod_gzip_maximum_inmem_size 100000
143 mod_gzip_keep_workfiles No
144 mod_gzip_temp_dir /usr/local/apache/gzip
145 mod_gzip_item_include file \.html$
146 mod_gzip_item_include file \.jsp$
147 mod_gzip_item_include file \.php$
148 mod_gzip_item_include file \.pl$
149 mod_gzip_item_include mime ^text/.*
150 mod_gzip_item_include mime ^application/x-httpd-php
151 mod_gzip_item_include mime ^httpd/unix-directory$
152 mod_gzip_item_include handler ^perl-script$
153 mod_gzip_item_include handler ^server-status$
154 mod_gzip_item_include handler ^server-info$
155 mod_gzip_item_exclude file \.css$
156 mod_gzip_item_exclude file \.js$
157 mod_gzip_item_exclude mime ^image/.*
160 *** LINUX + APACHE 1.3.14 + MOD_JSERV + MOD_SSE
162 Here is a KNOWN good mod_gzip configuration section for
163 Apache 1.3.14 with mod_jserv and mod_ssl running on linux.
165 Submitted by: Michael Suszycki 02/21/01
167 <IfModule mod_gzip.c>
170 mod_gzip_keep_workfiles No
171 mod_gzip_temp_dir /tmp
172 mod_gzip_minimum_file_size 1002
173 mod_gzip_maximum_file_size 0
174 mod_gzip_maximum_inmem_size 1000000
176 mod_gzip_item_include file \.htm$
177 mod_gzip_item_include file \.html$
178 mod_gzip_item_include mime text/.*
179 mod_gzip_item_include file \.php$
180 mod_gzip_item_include mime "jserv-servlet"
181 mod_gzip_item_include handler "jserv-servlet"
182 mod_gzip_item_include mime "application/x-httpd-php.*"
183 mod_gzip_item_include mime httpd/unix-directory
185 mod_gzip_item_exclude file "\.css$"
186 mod_gzip_item_exclude file "\.js$"
187 mod_gzip_item_exclude file "\.wml$"
188 LogFormat "%h %l %u %t \"%V %r\" %>s %b mod_gzip: %{mod_gzip_result}n In:%{mod_gzip_input_size}n Out:%{mod_gzip_output_size}n:%{mod_gzip_compression_ratio}npct." common_with_mod_gzip_info2
189 CustomLog /var/log/httpd/mod_gzip common_with_mod_gzip_info2
193 *** SuSE LINIX + APACHE 1.3.17 + mod_php 4.0.5dev
195 Here is a KNOWN good mod_gzip configuration section for
196 SuSE Linux 6.2 running Apache 1.3.17 and mod_php 4.0.5dev.
197 It only compresses UNIX directory listings, text/html,
198 text/plain and PHP script output.
200 Submitted by: Philip Hofstetter 02/24/01
203 mod_gzip_item_include file \.htm$
204 mod_gzip_item_include file \.html$
205 mod_gzip_item_include file \.php$
206 mod_gzip_item_include mime text/.*
207 mod_gzip_item_include mime httpd/unix-directory
209 mod_gzip_temp_dir /tmp
210 mod_gzip_keep_workfiles No