mod_mime_magic.html revision e0b181d3bfa99dfb992df3024b397660cb7afbe9
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync<html xmlns="http://www.w3.org/TR/xhtml1/strict"><head><!--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync This file is generated from xml source: DO NOT EDIT
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --><title>mod_mime_magic- Apache HTTP Server</title><link rel="stylesheet" type="text/css" href="/style/manual.css"/></head><body><blockquote><div align="center"><img src="/images/sub.gif" alt="[APACHE DOCUMENTATION]"/><h3>Apache HTTP Server Version 2.0</h3></div><h1 align="center">Apache Module mod_mime_magic</h1><table bgcolor="#cccccc" cellpadding="0" cellspacing="1"><tr><td><table bgcolor="#ffffff"><tr><td valign="top"><span class="help">Description:</span></td><td>Determines the MIME type of a file
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync by looking at a few bytes of its contents</td></tr><tr><td><a class="help" href="module-dict.html#Status">Status:</a></td><td>Extension</td></tr><tr><td><a class="help" href="module-dict.html#ModuleIdentifier">Module&nbsp;Identifier:</a></td><td>mime_magic_module</td></tr></table></td></tr></table><h2>Summary</h2>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <p>This module determines the MIME type of files in the same
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync way the Unix file(1) command works: it looks at the first few
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync bytes of the file. It is intended as a "second line of defense"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync for cases that <code><a href="mod_mime.html">mod_mime</a></code> can't
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync resolve. To assure that mod_mime gets first try at determining
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync a file's MIME type, be sure to list mod_mime_magic
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <strong>before</strong> mod_mime in the configuration.</p>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <p>This module is derived from a free version of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <code>file(1)</code> command for Unix, which uses "magic
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync numbers" and other hints from a file's contents to figure out
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync what the contents are. This module is active only if the magic
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync file is specified by the <a class="directive" href="#mimemagicfile"><code class="directive">MimeMagicFile</code></a> directive.</p>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync<h2>Directives</h2><ul><li><a href="#mimemagicfile">MimeMagicFile</a></li></ul><h2>Format of the Magic File</h2>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <p>The contents of the file are plain ASCII text in 4-5
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync columns. Blank lines are allowed but ignored. Commented lines
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync use a hash mark "#". The remaining lines are parsed for the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync following columns:</p>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <table border="1">
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <tr valign="top">
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <th>Column</th>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <th>Description</th>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync </tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <tr valign="top">
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>1</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>byte number to begin checking from<br/>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync "&gt;" indicates a dependency upon the previous non-"&gt;"
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync line</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync </tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <tr valign="top">
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>2</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync type of data to match
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <table border="1">
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>byte</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>single character</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync </tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>short</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>machine-order 16-bit integer</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync </tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>long</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>machine-order 32-bit integer</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync </tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>string</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>arbitrary-length string</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync </tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>date</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>long integer date (seconds since Unix
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync epoch/1970)</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync </tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>beshort</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>big-endian 16-bit integer</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync </tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>belong</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>big-endian 32-bit integer</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync </tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>bedate</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>big-endian 32-bit integer date</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync </tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>leshort</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>little-endian 16-bit integer</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync </tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>lelong</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>little-endian 32-bit integer</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync </tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>ledate</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>little-endian 32-bit integer date</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync </tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync </table>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync </td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync </tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <tr valign="top">
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>3</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>contents of data to match</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync </tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <tr valign="top">
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>4</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>MIME type if matched</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync </tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <tr valign="top">
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>5</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <td>MIME encoding if matched (optional)</td>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync </tr>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync </table>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <p>For example, the following magic file lines would recognize
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync some audio formats.</p>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync<pre>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# Sun/NeXT audio data
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync0 string .snd
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync&gt;12 belong 1 audio/basic
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync&gt;12 belong 2 audio/basic
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync&gt;12 belong 3 audio/basic
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync&gt;12 belong 4 audio/basic
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync&gt;12 belong 5 audio/basic
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync&gt;12 belong 6 audio/basic
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync&gt;12 belong 7 audio/basic
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync&gt;12 belong 23 audio/x-adpcm
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync</pre>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync</code></td></tr></table></blockquote>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <p>Or these would recognize the difference between "*.doc" files
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync containing Microsoft Word or FrameMaker documents. (These are
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync incompatible file formats which use the same file suffix.)</p>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync<pre>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# Frame
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync0 string \&lt;MakerFile application/x-frame
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync0 string \&lt;MIFFile application/x-frame
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync0 string \&lt;MakerDictionary application/x-frame
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync0 string \&lt;MakerScreenFon application/x-frame
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync0 string \&lt;MML application/x-frame
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync0 string \&lt;Book application/x-frame
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync0 string \&lt;Maker application/x-frame
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# MS-Word
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync0 string \376\067\0\043 application/msword
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync0 string \320\317\021\340\241\261 application/msword
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync0 string \333\245-\0\0\0 application/msword
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync</pre>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync</code></td></tr></table></blockquote>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <p>An optional MIME encoding can be included as a fifth column.
3f8c00daa9a41eeb005842cd21f9edbe0ed61193vboxsync For example, this can recognize gzipped files and set the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync encoding for them.</p>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync<pre>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# gzip (GNU zip, not to be confused with [Info-ZIP/PKWARE] zip archiver)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync0 string \037\213 application/octet-stream x-gzip
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync</pre>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync</code></td></tr></table></blockquote>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync<h2>Performance Issues</h2>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <p>This module is not for every system. If your system is barely
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync keeping up with its load or if you're performing a web server
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync benchmark, you may not want to enable this because the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync processing is not free.</p>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <p>However, an effort was made to improve the performance of
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync the original file(1) code to make it fit in a busy web server.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync It was designed for a server where there are thousands of users
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync who publish their own documents. This is probably very common
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync on intranets. Many times, it's helpful if the server can make
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync more intelligent decisions about a file's contents than the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync file name allows ...even if just to reduce the "why doesn't my
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync page work" calls when users improperly name their own files.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync You have to decide if the extra work suits your
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync environment.</p>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <p>When compiling an Apache server, this module should be at or
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync near the top of the list of modules in the Configuration file.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync The modules are listed in increasing priority so that will mean
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync this one is used only as a last resort, just like it was
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync designed to.</p>
90d3c33c9cf54d09901bfc61e9e836d4828c3abavboxsync
f5f22d30238f9adf5a42a510ff1683bca461600cvboxsync<h2><a name="notes">Notes</a></h2>
87197f779bb752fa59019122132bc431e77f8885vboxsync
87197f779bb752fa59019122132bc431e77f8885vboxsync <p>The following notes apply to the mod_mime_magic module and are
87197f779bb752fa59019122132bc431e77f8885vboxsync included here for compliance with contributors' copyright
87197f779bb752fa59019122132bc431e77f8885vboxsync restrictions that require their acknowledgment. </p>
87197f779bb752fa59019122132bc431e77f8885vboxsync<pre>
87197f779bb752fa59019122132bc431e77f8885vboxsync/*
87197f779bb752fa59019122132bc431e77f8885vboxsync * mod_mime_magic: MIME type lookup via file magic numbers
f5f22d30238f9adf5a42a510ff1683bca461600cvboxsync * Copyright (c) 1996-1997 Cisco Systems, Inc.
90d3c33c9cf54d09901bfc61e9e836d4828c3abavboxsync *
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * This software was submitted by Cisco Systems to the Apache Group in July
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * 1997. Future revisions and derivatives of this source code must
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * acknowledge Cisco Systems as the original contributor of this module.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * All other licensing and usage conditions are those of the Apache Group.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync *
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * Some of this code is derived from the free version of the file command
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * originally posted to comp.sources.unix. Copyright info for that program
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * is included below as required.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * ---------------------------------------------------------------------------
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * - Copyright (c) Ian F. Darwin, 1987. Written by Ian F. Darwin.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync *
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * This software is not subject to any license of the American Telephone and
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * Telegraph Company or of the Regents of the University of California.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync *
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * Permission is granted to anyone to use this software for any purpose on any
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * computer system, and to alter it and redistribute it freely, subject to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * the following restrictions:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync *
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * 1. The author is not responsible for the consequences of use of this
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * software, no matter how awful, even if they arise from flaws in it.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync *
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * 2. The origin of this software must not be misrepresented, either by
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * explicit claim or by omission. Since few users ever read sources, credits
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * must appear in the documentation.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync *
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * 3. Altered versions must be plainly marked as such, and must not be
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * misrepresented as being the original software. Since few users ever read
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * sources, credits must appear in the documentation.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync *
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * 4. This notice may not be removed or altered.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * -------------------------------------------------------------------------
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync *
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * For compliance with Mr Darwin's terms: this has been very significantly
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * modified from the free "file" command.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * - all-in-one file for compilation convenience when moving from one
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * version of Apache to the next.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * - Memory allocation is done through the Apache API's pool structure.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * - All functions have had necessary Apache API request or server
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * structures passed to them where necessary to call other Apache API
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * routines. (<em>i.e.</em>, usually for logging, files, or memory allocation in
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * itself or a called function.)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * - struct magic has been converted from an array to a single-ended linked
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * list because it only grows one record at a time, it's only accessed
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * sequentially, and the Apache API has no equivalent of realloc().
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * - Functions have been changed to get their parameters from the server
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * configuration instead of globals. (It should be reentrant now but has
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * not been tested in a threaded environment.)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * - Places where it used to print results to stdout now saves them in a
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * list where they're used to set the MIME type in the Apache request
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * record.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync * - Command-line flags have been removed since they will never be used here.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync *
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync */
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync</pre>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync<hr/><h2><a name="MimeMagicFile">MimeMagicFile</a> <a name="mimemagicfile">Directive</a></h2><table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1"><tr><td><table bgcolor="#ffffff"><tr><td><strong>Description: </strong></td><td>Enable MIME-type determination based on file contents
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncusing the specified magic file</td></tr><tr><td><a class="help" href="directive-dict.html#Syntax">Syntax:</a></td><td>MimeMagicFile <em>file-path</em></td></tr><tr><td><a class="help" href="directive-dict.html#Context">Context:</a></td><td>server config, virtual host</td></tr><tr><td><a class="help" href="directive-dict.html#Status">Status:</a></td><td>Extension</td></tr><tr><td><a class="help" href="directive-dict.html#Module">Module:</a></td><td>mod_mime_magic</td></tr></table></td></tr></table>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <p>The <code class="directive">MimeMagicFile</code> directive can be used to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync enable this module, the default file is distributed at
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync <code>conf/magic</code>. Non-rooted paths are relative to the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ServerRoot. Virtual hosts will use the same file as the main
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync server unless a more specific setting is used, in which case
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync the more specific setting overrides the main server's file.</p>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync<hr/></blockquote><h3 align="center">Apache HTTP Server Version 2.0</h3><a href="./"><img src="/images/index.gif" alt="Index"/></a><a href="../"><img src="/images/home.gif" alt="Home"/></a></body></html>