SHARE
Facebook X Pinterest WhatsApp

Configuring Apache Page 4

Written By
thumbnail Aaron Weiss
Aaron Weiss
Jul 20, 2010
ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



By and large, the Web server doesn’t need much tweaking to deliver
WML pages to a wireless device. As far as Apache is concerned, it needs only
to know how to recognize the MIME type of the file, based on the file’s file name
extension. Apache will pass this MIME type to the receiving browser and, assuming
the browser knows WML, it will know what to do with a WML type file.

Recent versions of Apache can be entirely configured through the
file httpd.conf, which is typically located in the apache/conf/
directory, wherever Apache is installed on the server. If you open httpd.conf
in a text editor, you can scroll through and view the many, many Apache configuration
directives. Ultimately, you will find a section where MIME types are declared.
In the default Apache httpd.conf file, this section begins as follows
(though it may vary slightly depending on the installation):

#
# AddType allows you to tweak mime.types without actually editing it, or to
# make certain files to be certain types.
#
# For example, the PHP3 module (not part of the Apache distribution)
# will typically use:
#
#AddType application/x-httpd-php3 .phtml
#AddType application/x-httpd-php3-source .phps

AddType application/x-tar .tgz

While not strictly necessary, this is a good and logical place to add WML types
to Apache. So, we simply pasted the following lines to our httpd.conf
file just after the last line above:

#WML/WAP types
AddType text/vnd.wap.wml .wml
AddType application/vnd.wap.wmlc .wmlc
AddType text/vnd.wap.wmlscript .wmls
AddType application/vnd.wap.wmlscriptc .wmlsc
AddType image/vnd.wap.wbmp .wbmp

The basic WML file is delivered to the browser with MIME type text/vnd.wap.wml.
In the statement above, we have told Apache to delivery this MIME type whenever the filename ends
in the extension .wml. Similarly, appropriate MIME types are passed for
other WML variants. The .wmlc files would be compressed WML files, while
.wmls and .wmlsc represent WMLScript
(a wireless scripting language) and compressed WMLScript, respectively. Furthermore,
.wbmp files represent wireless bitmap files or WBMP, the graphic format
that wireless devices support (as opposed to, for example, .gif or .jpg on desktop browsers).

Changes to the Apache httpd.conf file take effect only when the server
is launched, so the server must be restarted to save the
above changes for the new MIME types to apply. Once done though, Apache is ready to
go, and will happily deliver WML and related files to a wireless device.

thumbnail Aaron Weiss

Aaron Weiss is a technology writer, comedy writer, and web developer.

Recommended for you...

What Is a Container? Understanding Containerization
What Is a Print Server? | How It Works and What It Does
Nisar Ahmad
Dec 8, 2023
What Is a Network Policy Server (NPS)? | Essential Guide
Virtual Servers vs. Physical Servers: Comparison and Use Cases
Ray Fernandez
Nov 14, 2023
ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.