In the following sections, you will learn how to set the default document of WAP / web sites with Apache, Tomcat and IIS.
9.3. Setting Default Documents of WAP / Web Sites with Apache
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.
9.4. 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.
9.5. 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:
Bring up the Internet Information Services window by selecting Control Panel -> Administrative Tools -> Internet Service Manager.
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.
Click Properties in the menu to bring up the Properties window.
Select the WWW Service item in the Master Properties combo box and click the Edit button next to it.
In the Default Web Site Properties window, click the Documents tab.
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.
Previous Page | Page 13 of 13 |
- 1. Setting up WAP Servers Introduction
- 2. Publishing WAP 1.x / WAP 2.0 Content over the Mobile Internet
- 3. What are MIME Types?
- 4. WAP 1.x / WAP 2.0 MIME Types and File Extensions
- 5. Setting up MIME Types with Apache
- 6. Setting up MIME Types with Tomcat
- 7. Setting up MIME Types with Microsoft IIS
- 8. Setting up MIME Types without Administrator Rights
- 9. Setting up Default Documents of WAP / Web Sites