mod_mime_magic.xml revision 6aada32e978e09cc60d52cb05ae4cee91b676da1
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy<?xml version="1.0"?>
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy<?xml-stylesheet type="text/xsl" href="/style/manual.xsl"?>
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy<modulesynopsis>
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy<name>mod_mime_magic</name>
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy<description>Determines the MIME type of a file
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy by looking at a few bytes of its contents</description>
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy<status>Extension</status>
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy<sourcefile>mod_mime_magic.c</sourcefile>
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy<identifier>mime_magic_module</identifier>
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy<summary>
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy <p>This module determines the MIME type of files in the same
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy way the Unix file(1) command works: it looks at the first few
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy bytes of the file. It is intended as a "second line of defense"
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy for cases that <module>mod_mime</module> can't
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy resolve. To assure that mod_mime gets first try at determining
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy a file's MIME type, be sure to list mod_mime_magic
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <strong>before</strong> mod_mime in the configuration.</p>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <p>This module is derived from a free version of the
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <code>file(1)</code> command for Unix, which uses "magic
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy numbers" and other hints from a file's contents to figure out
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy what the contents are. This module is active only if the magic
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy file is specified by the <directive module="mod_mime_magic"
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy >MimeMagicFile</directive> directive.</p>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy</summary>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy<section><title>Format of the Magic File</title>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <p>The contents of the file are plain ASCII text in 4-5
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy columns. Blank lines are allowed but ignored. Commented lines
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy use a hash mark "#". The remaining lines are parsed for the
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy following columns:</p>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <table border="1">
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <tr valign="top">
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <th>Column</th>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <th>Description</th>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy </tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <tr valign="top">
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>1</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>byte number to begin checking from<br />
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy "&gt;" indicates a dependency upon the previous non-"&gt;"
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy line</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy </tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <tr valign="top">
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>2</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy type of data to match
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <table border="1">
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>byte</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>single character</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy </tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>short</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>machine-order 16-bit integer</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy </tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>long</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>machine-order 32-bit integer</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy </tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>string</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>arbitrary-length string</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy </tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>date</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>long integer date (seconds since Unix
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy epoch/1970)</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy </tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>beshort</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>big-endian 16-bit integer</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy </tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>belong</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>big-endian 32-bit integer</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy </tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>bedate</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>big-endian 32-bit integer date</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy </tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>leshort</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>little-endian 16-bit integer</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy </tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>lelong</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>little-endian 32-bit integer</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy </tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>ledate</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>little-endian 32-bit integer date</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy </tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy </table>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy </td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy </tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <tr valign="top">
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>3</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>contents of data to match</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy </tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <tr valign="top">
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>4</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>MIME type if matched</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy </tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <tr valign="top">
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>5</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <td>MIME encoding if matched (optional)</td>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy </tr>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy </table>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <p>For example, the following magic file lines would recognize
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy some audio formats.</p>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy<example>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy<pre>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy# Sun/NeXT audio data
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy0 string .snd
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy&gt;12 belong 1 audio/basic
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy&gt;12 belong 2 audio/basic
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy&gt;12 belong 3 audio/basic
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy&gt;12 belong 4 audio/basic
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy&gt;12 belong 5 audio/basic
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel&gt;12 belong 6 audio/basic
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel&gt;12 belong 7 audio/basic
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy&gt;12 belong 23 audio/x-adpcm
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy</pre>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy</example>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <p>Or these would recognize the difference between "*.doc" files
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy containing Microsoft Word or FrameMaker documents. (These are
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy incompatible file formats which use the same file suffix.)</p>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy<example>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy<pre>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy# Frame
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy0 string \&lt;MakerFile application/x-frame
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy0 string \&lt;MIFFile application/x-frame
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy0 string \&lt;MakerDictionary application/x-frame
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy0 string \&lt;MakerScreenFon application/x-frame
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy0 string \&lt;MML application/x-frame
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy0 string \&lt;Book application/x-frame
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy0 string \&lt;Maker application/x-frame
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy# MS-Word
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy0 string \376\067\0\043 application/msword
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy0 string \320\317\021\340\241\261 application/msword
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy0 string \333\245-\0\0\0 application/msword
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy</pre>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy</example>
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy <p>An optional MIME encoding can be included as a fifth column.
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy For example, this can recognize gzipped files and set the
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy encoding for them.</p>
<example>
<pre>
# gzip (GNU zip, not to be confused with [Info-ZIP/PKWARE] zip archiver)
0 string \037\213 application/octet-stream x-gzip
</pre>
</example>
</section>
<section><title>Performance Issues</title>
<p>This module is not for every system. If your system is barely
keeping up with its load or if you're performing a web server
benchmark, you may not want to enable this because the
processing is not free.</p>
<p>However, an effort was made to improve the performance of
the original file(1) code to make it fit in a busy web server.
It was designed for a server where there are thousands of users
who publish their own documents. This is probably very common
on intranets. Many times, it's helpful if the server can make
more intelligent decisions about a file's contents than the
file name allows ...even if just to reduce the "why doesn't my
page work" calls when users improperly name their own files.
You have to decide if the extra work suits your
environment.</p>
<p>When compiling an Apache server, this module should be at or
near the top of the list of modules in the Configuration file.
The modules are listed in increasing priority so that will mean
this one is used only as a last resort, just like it was
designed to.</p>
</section>
<section id="notes"><title>Notes</title>
<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>
</section>
<directivesynopsis>
<name>MimeMagicFile</name>
<description>Enable MIME-type determination based on file contents
using the specified magic file</description>
<syntax>MimeMagicFile <em>file-path</em></syntax>
<contextlist><context>server config</context>
<context>virtual host</context></contextlist>
<usage>
<p>The <directive>MimeMagicFile</directive> 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>
</usage>
</directivesynopsis>
</modulesynopsis>