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