SolutionsTools & SDKSupportForums Register



Quick Links
 
Web Server Config FAQ
 
 


Q: How do you configure a web server to publish WML or HDML content?
A:  To serve static WML or HDML from any web server, the following entries must first be added to the web server's MIME configuration table:
File Extension MIME Type
.wml text/vnd.wap.wml
.wmls text/vnd.wap.wmlscript
.hdml text/x-hdml
.bmp image/bmp
For more information, please refer to Chapter 4 of the SDK Getting Started Guide.




Q: How do you serve dynamic WML or HDML content from a Web program or script?
A:  In most Web programming and scripting environments, it is the programmer's responsibility to ouput the appropriate Content-type HTTP response header string. How you do this depends on your environment. Conventional programming languages (e.g. Perl) require that you print the actual Content-type header string at the beginning of your output, while scripting environments (e.g. Cold Fusion) usually provide tags to control this at a higher level. Here are a few examples: Perl: Print the HTTP response header string, followed by a blank line before printing a WML deck: print "Content-type: text/vnd.wap.wml\n\n"; print $DECK;
Cold Fusion: Set the appropriate tag at the beginning of your script: <CFCONTENT Type="text/vnd.wap.wml">
Microsoft Active Server Pages (ASP): Set the appropriate tag at the beginning of your script: < Response.ContentType = "text/vnd.wap.wml">
If you are publishing HDML content, use the MIME type "text/x-hdml" instead of "text/vnd.wap.wml". For more information, please refer to Chapter 4 of the SDK Getting Started Guide.




Q: How do you configure Microsoft's Internet Information Server (IIS), Peer Web Services, or Personal Web Server to publish HDML or WML content?
A:  The procedure for configuring the required MIME types depends on which version of IIS, Peer Web Services, or Personal Web Server you are using. Older versions of these products share the same MIME table in the Windows registry, and can be configured using the regedit utility. Later versions provide "user friendly" tools for adding new MIME types... If you are using IIS v4.0, use the Internet Service Manager tool (aka Management Console):
1)Launch Internet Service Manager
2)Open "Internet Information Server" under "Console Root"
3)Right-click on the local computer name and select "Properties"
4)Click on the button labeled "File Types"
5)Click on "New Type..."
6)Enter the following field values:
Associated Extension: .wml
Content Type (MIME): text/vnd.wap.wml
7)Click on the "OK" button
8)Click on "New Type..."
9)Enter the following field values:
Associated Extension: .hdml
Content Type (MIME): text/x-hdml
10)Click on the "OK" button
11)Reboot your system
If you are using Personal Web Server v4.0, use the MetaEdit tool included with Microsoft's IIS Resource Kit:
1)Launch MetaEdit
2)Open "/MIMEMAP" under "/LM"
3)Select "MimeMap" and then double-click
4)Using the pop-up dialog, add the following new values to the MimeMap list:
wml,text/vnd.wap.wml
hdml,text/x-hdml
5)Click on the "OK" button
6)Reboot your system
If you are using IIS v3.0 or below, Peer Web Services, or Personal Web Server v1.0, follow this procedure to configure the MIME type for HDML files in the Windows registry:
1)Run the regedit utility (REGEDIT.EXE)
2)Open the Registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ Services\InetInfo\Parameters\MimeMap
3)Add two new String Values with the following names:
text/vnd.wap.wml,wml,,5
text/x-hdml,hdml,,5
NOTE: In both cases, the string value should be left blank
4)Reboot your system





Q: How do you serve static HDML or WML files from an ISP's web server that isn't configured for the required MIME types?
A:  If your ISP hosts a web server based on the NCSA web server (e.g. NCSA, Apache, etc.), you can configure new MIME types without the intervention of the ISP administrator. To configure new types, create a file named .htaccess and add lines to it with the following format:
addtype
where is the MIME type and is the file extension to which the MIME type is mapped. For example:
addtype text/vnd.wap.wml wml
addtype text/vnd.wap.wmlscript wmls
addtype text/x-hdml hdmladdtype image/bmp bmp
The .htaccess file is effective for all recursive subdirectories, so you should normally store the file in your root-level web directory. Be sure the file is world-readable, so the web server can read it. If your ISP does not use an NCSA-complient server, you will need to ask the ISP administrator to manually configure the MIME types in the web server MIME configuration table.




Q: How do you install and configure Perl to run the SDK example scripts?
A:  If you are using a Unix Web server, download the latest release of Perl 5.0 from www.perl.com. After you install Perl, copy the sdk\examples directory anywhere under your Web server document root directory. If you are using a Windows Web server, download the latest release of ActivePerl from www.activestate.com. Be sure to install your Web server first. IMPORTANT: After you install ActivePerl be sure to associate the "cgi" file extension to the perlis.dll interpreter in your Web server configuration table. If you don't do this, you will have to modify all of the SDK example scripts and source code to use ".pl" instead of ".cgi". For more information, please refer to ActiveState's Win32 FAQ. After everything is installed, reboot your Windows system.




Q: How do I get my main web site URL to serve both HTML and WAP content, based on the type of browser?
A:  First, you need to configure the default file for your root web server directory to be a program or script. How you configure this is dependent on which web server you're using. Refer to your web server administration guide for details. In the script that serves your root URL, check the USER_AGENT and ACCEPT headers in the HTTP request to determine the browser type, browser version, and supported languages. Using this information, you can branch and serve the appropriate content. The following Perl example shows one way of doing this -- by serving a different file based on the native language of the requesting browser. Note: Although Mobile Browser 4.x is a native WML browser, you may serve either WML or HDML content to phones running Mobile Browser 4.x as long as the WAP Gateway is a Phone.com UP.Link Server:
#!/usr/up/tools/bin/perl5
$accept = $ENV{"HTTP_ACCEPT"};
$agent = $ENV{"HTTP_USER_AGENT"};
if ($agent =~ "UP.B") {
if ($accept =~ "wmlscript") {
# Mobile Browser 4.x (WML)
print "Location: http://www.mysite.com/index.wml\n\n";
exit(0);
} else {
# Mobile Browser 3.x or earlier (HDML)
print "Location: http://www.mysite.com/index.hdml\n\n";
exit(0);
}
} else {
# Not a Phone.com Browser (HTML)
print "Location: http://www.mysite.com/index.html\n\n";
exit(0);
}




Q: Why am I getting 1012 or 7514 errors when trying to access my HTTPS site?
A:  You may be delivering expired Certificate Authority (CA) information. This may be the case even if your SSL certificate has not expired. To remedy this issue, remove the any CA information that you may be delivering. To do this from the Netscape Web Server Administration interface take the following steps: --Select Keys and Certificates.
--Manage certificates.
--Select alias.
--Select each expired certificate in turn.
--Select delete certificate for each.


 
Copyright © 2000-2008 Openwave Systems Inc.    About Us  |  Openwave  |  Terms & Conditions  |  Privacy Policy  |  Update Profile