Default file (MiMe types) for Apache httpd and Apache Tomcat
Archive - Originally posted on "The Horse's Mouth" - 2008-03-04 16:55:32 - Graham Ellis
Apache Tomcat web server default MIME type
What file extension maps to what "Mime Type" in Apache Tomcat? It's important to know, since the Mime type is sent out by the server to the browser to tell the browser how to handle the following data stream.
a) There is a long list of extensions and their mappings in the conf/web.xml file - for example it contains <mime-mapping>
<extension>html</extension>
<mime-type>text/html</mime-type>
</mime-mapping>
b) Within the source code of Servlets, an appropriate method call is used to set the type, for example outgoing.setContentType("text/html");
c) If you have enabled CGI, you'll generate a Mime header in your script
d) And if none of these apply ... the default Apache Tomcat Mime Type is text/plain. Here's an example using a .duck extension ...
Apache httpd web server default MIME type
a) Most extensions are mapped according to instructions in the TypesConfig directive in httpd.conf, which may read something like: TypesConfig conf/mime.types
b) Perl scripts (CGI) can generate a mime header, and if you're using PHP you can use the header section to change the type.
c) If the mime_magic module is loaded, the contents of the file itdelf will be examined for clues as to the return type. The configuration directive is
d) If the httpd server still hasn't been able to work out the type it will use the value specified in the DefaultType setting in httpd.conf: DefaultType text/plain