Sunday, January 8, 2017

how to setup wap server and host a wap site

WAP (Wireless Application Protocol) is a technical standard that is used to access a site (similar to html website) over a mobile wireless network.

below is a guide on how to setup a apache2 wap server, and how to access it on linux host.
- will use server.wap as the vhost name, so create dns record or hosts file according to your ip setup

1- install apache2 web server
$ sudo apt-get installl apache2

2- configure vhost that use index.wml as the directory index and use /var/html/wap as the document root, so the vhost configuration file, /etc/apache2/sites-enabled/wap.conf, will contain below
<VirtualHost *:80>
    ServerName server.wap
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/wap
    AddType application/vnd.wap.wmlscriptc .wmlsc .wsc
    AddType text/vnd.wap.wml .wml
    AddType text/vnd.wap.wmlscript .ws .wmlscript
    AddType image/vnd.wap.wbmp .wbmp
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    <Directory /var/www/wap>
        DirectoryIndex index.wml

3- create wap index file, /var/www/wap/index.wml, with content below
<?xml version="1.0"?>

<card id="XML" title="XML Tutorial">
  <p>this is a wap website.</p>


4- restart apache2 server and we finish on server part
$ sudo /etc/init.d/apache2 restart

5- on client side, use wap browser to access the site, so install the wap browser first.
$ sudo apt-get install wapua

6- start the wapua, then access to our wap site, http://server.wap
below is the snapshot of what you will get.

No comments:

Post a Comment