In the following sections, you will learn how to set up
MIME types with Apache, Tomcat and Microsoft IIS.
5. Setting up MIME
Types with Apache
Apache, the mappings between MIME types and file extensions are
stored in the configuration file apache_home/conf/mime.types,
where apache_home is the path
under which Apache was installed on your server.
set up MIME types, open the mime.types
file. Lines that begin with the # character are comments and they will be
ignored by Apache. Each of the
other lines begins with a MIME type, then follows by one or more file
extensions. It has the following form:
fileExtension1 fileExtension2 fileExtension3
are some examples:
text/html html htm
6. Setting up MIME
Types with Tomcat
Tomcat 5.x and 4.x, the default mappings between MIME types and file
extensions are stored in the file tomcat_home/conf/web.xml,
where tomcat_home is the path
under which Tomcat was installed on your server. The mappings specified there are
applied to all web / WAP applications hosted on your Tomcat server. Application-specific mappings
should be set in the WEB-INF/web.xml file under the directory of your
web / WAP application.
mapping is specified with the <mime-mapping>, <extension>
and <mime-type> tags. Here is an example:
7. Setting up MIME
Types with Microsoft IIS
IIS provides a GUI for setting up MIME types. Below lists the steps
for setting up MIME types with IIS 5.0 on Microsoft Windows 2000
up the Internet Information Services window by selecting
Control Panel ->
-> Internet Service Manager.
the tree on the left-hand side, you should see an item whose caption
is your computer's name. Right-click on it to pop up a menu.
Properties in the
menu to bring up the Properties
the Edit button
located in the Computer MIME Map
frame to bring up the File Types
the File Types window, you can see a list of MIME mappings.
Use the buttons labeled "New Type...", "Remove"
and "Edit..." to make any changes you want.
steps for setting up MIME types with other versions of IIS should be
your IIS is of version 3.0 or below, the procedure is less
user-friendly. It involves editing the registry at the key
Please refer to other sources for the details.
Feedback Form (ExpandCollapse)