"Fossies" - the Fresh Open Source Software Archive

Member "mod_gzip-1.3.26.1a/docs/mod_gzip.conf.sample" (1 Oct 2002, 14628 Bytes) of package /linux/www/apache_httpd_modules/old/mod_gzip-1.3.26.1a.tgz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #######################################
    2 ### Apache configuration directives ###
    3 ###   for mod_gzip 1.3.26.1a        ###
    4 #######################################
    5 
    6 ##########################
    7 ### loading the module ###
    8 ##########################
    9 
   10 # ---------------------------------------------------------------------
   11 # load DLL / Win32:
   12 # LoadModule gzip_module modules/ApacheModuleGzip.dll
   13 #
   14 # load DSO / UNIX:
   15 # LoadModule gzip_module modules/mod_gzip.so
   16 #
   17 # (none of both if module has been compiled in statically;
   18 # the exact file name may depend upon the exact compilation method used
   19 # for this module)
   20 # ---------------------------------------------------------------------
   21 
   22 <IfModule mod_gzip.c>
   23 
   24 ########################
   25 ### responsibilities ###
   26 ########################
   27 
   28 # ---------------------------------------------------------------------
   29 # use mod_gzip at all?
   30   mod_gzip_on                   Yes
   31 # (you can especially enable mod_gzip inside the central server
   32 #  configuration but disable it inside some directories ot virtual
   33 #  hosts by using this directive.)
   34 # ---------------------------------------------------------------------
   35 
   36 ######################################
   37 ### statically precompressed files ###
   38 ######################################
   39 
   40 # ---------------------------------------------------------------------
   41 # let mod_gzip perform 'partial content negotiation'?
   42   mod_gzip_can_negotiate        Yes
   43 # (if this option is active and a static file is to be served in com-
   44 #  pressed for, then mod_gzip will look for a static precompressed
   45 #  version of this file with a defined additional extension - see next
   46 #  directive - which would be delivered with priority. This would allow
   47 #  for avoiding to repeatedly compress the same static file and thus
   48 #  saving CPU time.
   49 #  No dynamic caching of this file is provided; currently the user
   50 #  himself is responsible for creating and updating the precompressed
   51 #  file's content.
   52 # From version 1.3.19.2a mod_gzip automatically recognizes whether
   53 # a statically precompressed file is older than its uncompressed
   54 # original and in this case will serve the content of the original
   55 # file in uncompressed form - as to rather serve correct data than
   56 # outdated ones ...)
   57 
   58 # ---------------------------------------------------------------------
   59 # extension (suffix) for statically precompressed files
   60 mod_gzip_static_suffix .gz
   61 AddEncoding gzip .gz
   62 # (effect: see previous directive; this string will be appended to the 
   63 # name of the original file.
   64 # be sure to configure the encoding 'gzip' for this extension as well,
   65 # because mod_gzip doesn't serve the content itself but simply generates
   66 # an Apache internal redirection to this URL. Therefore the remaining
   67 # Apache configuration is responsible for setting the 'Content-Encoding'
   68 # header properly ...
   69 # prior to version 1.3.19.2a this value was not configurable.)
   70 
   71 # ---------------------------------------------------------------------
   72 # automatic updates for statically precompressed files
   73 mod_gzip_update_static No
   74 # (if set to 'Yes', this directive (being new in version 1.3.26.1a) would
   75 # cause mod_gzip to automatically update an outdated version of any 
   76 # statically precompressed file during the request, i. e. compress the 
   77 # originally requested file and overwrite the precompressed variant 
   78 # file with it! 
   79 # for each automatic update of this type, mod_gzip will write a message 
   80 # of the severity 'notice' into the Apache error_log. 
   81 # while doing so, mod_gzip will directly read the original file's content. 
   82 # therefore this content cannot be interpreted by any other Apache module 
   83 # during the request. this might possibly not be what you want - hopefully 
   84 # it will be what most users want, because it works fast this way. 
   85 # use this configuration with a lot of care, and be sure that you don't 
   86 # inadvertantly cause valuable files within the URL tree to be overwritten. 
   87 # this isn't a feature to be used for mass hosting servers, especially 
   88 # because mod_gzip might experience access control problems there - the 
   89 # userid the Apache processes are running under need to have write access 
   90 # to the precompressed files of all users, which may not automatically be 
   91 # the case.) 
   92 # ---------------------------------------------------------------------
   93 
   94 ###################
   95 ### bureaucracy ###
   96 ###################
   97 # ---------------------------------------------------------------------
   98 # display status for mod_gzip
   99 mod_gzip_command_version      '/mod_gzip_status'
  100 # (defines an URL to display the status of mod_gzip; can be specified
  101 # individually for each installation and protected against access via
  102 # <Location> section for privacy reasons)
  103 # ---------------------------------------------------------------------
  104 # The status display will look like this:
  105 #       mod_gzip is available...
  106 #       mod_gzip_version = 1.3.26.1a
  107 #       mod_gzip_on = Yes/No
  108 # and thus will provide information about
  109 # - mod_gzip being installed at the server and working correctly,
  110 # - which version has been installed and
  111 # - whether mod_gzip has been set 'active' for this Location
  112 #   (-> mod_gzip_on)
  113 # ---------------------------------------------------------------------
  114 
  115 #######################
  116 ### data management ###
  117 #######################
  118 
  119 # ---------------------------------------------------------------------
  120 # Working directory for temporary files and the compression cache
  121 # if not specified, the following default values are used:
  122 # [Win32=c:\temp], [UNIX=/tmp]
  123 # mod_gzip_temp_dir             /tmp
  124 # (This directory must already exist and the userid being used for
  125 #  running the Apache server must have read and write access to this
  126 #  directory.
  127 #  Unlike other Apache directives an absolute path name must be specified
  128 #  here; a relative value will not be interpreted relatively to ServerRoot.
  129 #  This pastname must NOT be terminated with '/'.
  130 #  For maximum performance this directory should be located on a RAM disk,
  131 #  if the file system isn't already being cached efficiently
  132 # ---------------------------------------------------------------------
  133 # Save temporary work files [Yes, No]
  134 mod_gzip_keep_workfiles       No
  135 # (one file per HTTP request - set to 'yes' for debugging purpose only!)
  136 # ---------------------------------------------------------------------
  137 
  138 ##################
  139 ### file sizes ###
  140 ##################
  141 
  142 # ---------------------------------------------------------------------
  143 # minimum size (in bytes) for files to be compressed
  144 mod_gzip_minimum_file_size    500
  145 # (for very small files compression will produce only small absolute gains
  146 #  [you will still save about 50% of the content, but some additional
  147 #  500 bytes of HTTP and TCP headers will always remain uncompressed],
  148 #  but still produce CPU load for both client and server)
  149 # ---------------------------------------------------------------------
  150 # maximum size (in bytes) for files to be compressed
  151 mod_gzip_maximum_file_size    500000
  152 # (for very large files compression may eventually take rather long and
  153 #  thus delay the start of the transmission.
  154 #  Furthermode a limitation at this point prevents the server from
  155 #  producing output of unlimited size in case of some endless loop
  156 #  inside a CGI script - or even trying to compress streaming data -
  157 #  which might otherwise cause the creation of a temporary file of
  158 #  any size and even fill up the whole hard disk.
  159 #  On the other hand, compression will have a much more perceivable
  160 #  subjective effect for large files ... so be sure to fine-tune this
  161 #  according to your requirements.)
  162 # ---------------------------------------------------------------------
  163 # maximum size (in bytes) for files to be compressed in memory
  164 mod_gzip_maximum_inmem_size   60000
  165 # (larger files will be compressed into the temp file directory; adapt
  166 #  this value to your server's available main memory.
  167 #  In mod_gzip 1.3.19.x larger values will automatically be limited to
  168 #  60000 because some operating systems are said to have problems
  169 #  allocating more than 64 kb of memory at a time.
  170 # ---------------------------------------------------------------------
  171 
  172 ####################
  173 ### requirements ###
  174 ####################
  175 
  176 # (see chapter about caching for problems when using these directives.)
  177 # ---------------------------------------------------------------------
  178 # Required HTTP version of the client
  179 # Possible values: 1000 = HTTP/1.0, 1001 = HTTP/1.1, ...
  180 # This directive uses the same numeric protocol values as Apache does
  181 # internally
  182 mod_gzip_min_http             1000
  183 # (By using this directive you may exclude old browsers, search engines
  184 #  etc. from the compression procedure: if the user agent doesn't
  185 #  declare itself capable of understanding at least the HTTP level
  186 #  specified here, only uncompressed data will be delivered - no matter
  187 #  what else it claims to be able to. The value of '1001' will especially
  188 #  exclude Netscape 4.x. and a lot of proxy servers.)
  189 # ---------------------------------------------------------------------
  190 # HTTP methods to be handled 
  191 # Possible values: 'GET', 'POST' or a list of both values.
  192 mod_gzip_handle_methods GET POST 
  193 # (By using this directive you may particularly exclude POST requests
  194 # from the compression procedure. There are known cases where the
  195 # handling of these requests by previous mod_gzip versions could cause
  196 # problems. 
  197 # Before version 1.3.19.2a this value was not configurable.)
  198 # ---------------------------------------------------------------------
  199 
  200 ###############
  201 ### filters ###
  202 ###############
  203 
  204 # ---------------------------------------------------------------------
  205 # which files are to be compressed?
  206 #
  207 # The order of processing during each of both phases is not important,
  208 # but to trigger the compression of a request's content this request
  209 # a) must match at least one include rule in each of both phases and
  210 # b) must not match an exclude rule in any of both phases.
  211 # These rules are not minimal, they are meant to serve as example only.
  212 #
  213 # phase 1: (reqheader, uri, file, handler)
  214 # ========================================
  215 # (see chapter about caching for problems when using 'reqheader' type
  216 #  filter rules.)
  217 # NO:   special broken browsers which request for gzipped content
  218 #       but then aren't able to handle it correctly
  219 mod_gzip_item_exclude         reqheader  "User-agent: Mozilla/4.0[678]"
  220 #
  221 # JA:   HTML-Dokumente
  222 mod_gzip_item_include         file       \.html$
  223 #
  224 # NO:   include files / JavaScript & CSS (due to Netscape4 bugs)
  225 mod_gzip_item_exclude         file       \.js$
  226 mod_gzip_item_exclude         file       \.css$
  227 #
  228 # YES:  CGI scripts
  229 mod_gzip_item_include         file       \.pl$
  230 mod_gzip_item_include         handler    ^cgi-script$
  231 #
  232 # phase 2: (mime, rspheader)
  233 # ===========================
  234 # YES:  normal HTML files, normal text files, Apache directory listings
  235 mod_gzip_item_include         mime       ^text/html$
  236 mod_gzip_item_include         mime       ^text/plain$
  237 mod_gzip_item_include         mime       ^httpd/unix-directory$
  238 #
  239 # NO:   images (GIF etc., will rarely ever save anything)
  240 mod_gzip_item_exclude         mime       ^image/
  241 # ---------------------------------------------------------------------
  242 # In fact mod_gzip is checking only the first 4 characters of the 1st
  243 # operand (in case of uri even the first 2 characters only, as to
  244 # allow for values like url).
  245 # ---------------------------------------------------------------------
  246 # The table for mod_gzip_item rules (include and exclude) cannot contain
  247 # more than 256 entries; when this number is exceeded mod_gzip will
  248 # output the message "mod_gzip: ERROR: Item index is full"
  249 # and report a configuration error to the Apache server.
  250 # ---------------------------------------------------------------------
  251 # The directive values described here are meant to describe the requests
  252 # elected for compression most exactly.
  253 # Especially for the mime rules it has to be made clear that the HTTP
  254 # header 'Content-Type' (that will be checked by mod_gzip for this rule)
  255 # in some cases may contain not only a MIME type but additionally a
  256 # character set description (charset) as well.
  257 # If this is the case for the requests to be handled then you need to
  258 # remove the '$' char at the end of the corresponding value so that now
  259 # only the prefix of this value will be tested for matching.
  260 # ---------------------------------------------------------------------
  261 
  262 ##########################
  263 ### transfer encodings ###
  264 ##########################
  265 
  266 # ---------------------------------------------------------------------
  267 # Allow mod_gzip to eliminate the HTTP header
  268 #    'Transfer-encoding: chunked'
  269 # and join the chunks to one (compressable) packet
  270 mod_gzip_dechunk              Yes
  271 # (this is required for handling several types of dynamically generated
  272 # contents, especially for CGI and SSI pages, but also for pages produced
  273 # by some Java Servlet interpreters.
  274 # ---------------------------------------------------------------------
  275 
  276 ###############
  277 ### logging ###
  278 ###############
  279 
  280 # ---------------------------------------------------------------------
  281 # Extended log format (for testing the compression effect)
  282 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}n pct." common_with_mod_gzip_info2
  283 # ---------------------------------------------------------------------
  284 # Create additional log file
  285 CustomLog                     logs/mod_gzip.log common_with_mod_gzip_info2
  286 # (surely you can redefine your normal log file format, but you mal well
  287 #  keep its format standard compatible for evaluation by standard web
  288 #  analysis tools. So we just create another log file.)
  289 # ---------------------------------------------------------------------
  290 # Volume computation of the delivered files inside the Apache access_log:
  291 # count HTTP header size (in bytes) as part of total output size
  292 mod_gzip_add_header_count     Yes
  293 # (This will be more than the pure document content, but it will more
  294 #  realistically describe the total output traffic of the HTTP request)
  295 # ---------------------------------------------------------------------
  296 
  297 
  298 ###############
  299 ### proxies ###
  300 ###############
  301 # ---------------------------------------------------------------------
  302 # sending a 'Vary' HTTP header
  303 mod_gzip_send_vary Yes 
  304 # (see chapter about caching for this directive.) 
  305 # don't change this unless you absolutely know what you are doing!
  306 # ---------------------------------------------------------------------
  307 
  308 </IfModule>
  309