In the following sections, you will learn how to set the default document of WAP / web sites with Apache, Tomcat and IIS.


Setting Default Documents of WAP / Web Sites with Apache

Preferences - Do not show ads

In Apache, the default documents of a WAP / web site are specified with the DirectoryIndex directive in the configuration file located at apache_home/conf/httpd.conf, where apache_home is the path under which Apache was installed on your server.

To change the setting, search for the line that begins with "DirectoryIndex" in the httpd.conf file. Then you can modify the line according to the following form:


DirectoryIndex file1 file2 file3 ...


Here is an example:


DirectoryIndex index.wml default.wml


The above line specifies that:

  • When a user requests a directory, the web / WAP server should serve index.wml.

  • If index.wml does not exist in the directory, the web / WAP server should serve default.wml.

  • If the directory does not contain both index.wml and default.wml, the web / WAP server may send back the directory listing (a list of files contained in the directory) or the 404 "file not found" error to the client. The actual action depends on the configuration of the web / WAP server.


Setting Default Documents of WAP / Web Sites with Tomcat

In Tomcat 5.x and 4.x, the pre-set default document settings are stored in the file tomcat_home/conf/web.xml, where tomcat_home is the path under which Tomcat was installed. The settings in this file will be applied to all WAP / web sites hosted on your Tomcat server.

Default documents are specified with the <welcome-file-list> and <welcome-file> tags. Here is an example:


<web-app>

...

  <welcome-file-list>
    <welcome-file>index.wml</welcome-file>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>

...

</web-app>


The above example specifies that:

  • When a user requests a directory, the web / WAP server should serve index.wml.

  • If index.wml does not exist in the directory, the web / WAP server should serve index.jsp.

  • If the directory does not contain both index.wml and index.jsp, the web / WAP server may send back the directory listing (a list of files contained in the directory) or the 404 "file not found" error to the client. The actual action depends on the configuration of the web / WAP server.

If you want the settings to be applied to only one WAP site but not to all sites hosted on your Tomcat server, you should place the above markup in WEB-INF/web.xml under the directory of that WAP site, but not in tomcat_home/conf/web.xml.

If the <welcome-file-list> tag exists in both tomcat_home/conf/web.xml and WEB-INF/web.wml, the settings specified in WEB-INF/web.xml will override those specified in tomcat_home/conf/web.xml.


Setting Default Documents of WAP / Web Sites with Microsoft IIS

Microsoft IIS provides a GUI for setting up default documents of WAP / web sites. Below lists the steps for setting up default documents 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. Select the WWW Service item in the Master Properties combo box and click the Edit button next to it.

  5. In the Default Web Site Properties window, click the Documents tab.

  6. Click the Enable Default Document check box if it is not checked. Then use the buttons labeled "New..." and "Remove" to add or remove file names. The file at the top of the list will be served first.

The steps for setting default documents with other versions of IIS should be similar.

Preferences - Do not show ads


Page 13 of 13 Previous Page
Contents at a Glance
Print this Web Page | | Back to Top

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