Welcome to Developer's Home Wednesday, April 16, 2014
Home - DevelopersHome.com

In the following sections, you will learn how to set up MIME types with Apache, Tomcat and Microsoft IIS.


Setting up MIME Types with Apache


Preferences - Do not show ads

In 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.

To 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:


mimeType fileExtension1 fileExtension2 fileExtension3 ...


Here are some examples:


text/html html htm
application/vnd.wap.xhtml+xml xhtml
text/vnd.wap.wml wml
text/vnd.wap.wmlscript wmls
image/vnd.wap.wbmp wbmp


Setting up MIME Types with Tomcat

In 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.

Each mapping is specified with the <mime-mapping>, <extension> and <mime-type> tags. Here is an example:


<web-app>

...

  <mime-mapping>
    <extension>xhtml</extension>
    <mime-type>application/vnd.wap.xhtml+xml</mime-type>
  </mime-mapping>

  <mime-mapping>
    <extension>wml</extension>
    <mime-type>text/vnd.wap.wml</mime-type>
  </mime-mapping>

  <mime-mapping>
    <extension>wmls</extension>
    <mime-type>text/vnd.wap.wmlscript</mime-type>
  </mime-mapping>

  <mime-mapping>
    <extension>wbmp</extension>
    <mime-type>image/vnd.wap.wbmp</mime-type>
  </mime-mapping>

...

</web-app>


Setting up MIME Types with Microsoft IIS

Microsoft 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 Professional:

  1. Bring up the Internet Information Services window by selecting Control Panel -> Administrative Tools -> Internet Service Manager.

  2. In 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.

  3. Click Properties in the menu to bring up the Properties window.

  4. Click the Edit button located in the Computer MIME Map frame to bring up the File Types window.

  5. In 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.


The steps for setting up MIME types with other versions of IIS should be similar.

If your IIS is of version 3.0 or below, the procedure is less user-friendly. It involves editing the registry at the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ Services\InetInfo\Parameters\MimeMap. Please refer to other sources for the details.

Preferences - Do not show ads


Page 4 of 13 Previous Page | Next Page
Contents at a Glance
Print this Web Page | | Back to Top
Custom Search

Feedback Form (Expand)

What do you think about this web page?






WAP Server Setup Tutorial - Table of Contents WAP Server Setup Tutorial - Contents at a Glance Preferences - Change Color Scheme Preferences - Do Not Show Ads Previous Page Next Page