Android Web Server
Do you want to have a web server in your pocket running on your android smart phone? Here I am going to discuss how to convert your android phone into a web server along with a domain name associated with it. There are a lot of Web Server apps are available in android market but what I found interesting is kWS – Android Web Server by Kamran Zafar.
kWS is a lightweight and fast Web Server especially designed for android mobile devices. It can be used to host websites and to serve files over HTTP. kWS implements HTTP1.0.
- Basic & digest authentication for secure access
- Server side includes (SSI)
- Directory index
- Directory downloads in tar, tgz & zip formats
- Resumable file downloads
- Built in Dynamic DNS update client. Supports Dynamic DNS Providers no-ip.com and dyndns.com
- Up to 20 parallel connections
- Comprehensive HTTP logs
Additional features in Pro version
- HTTPS/TLS support with BKS & PKCS12 keystores
- Password based file encryption (128 bit AES & Triple DES)
- GZip file compression
- Directory index in JSON & XML formats and index sorting
- Highly configurable with support for up to 999 per-port parallel connections
- Directory level configuration
- Support for more Dynamic DNS providers like ZoneEdit etc.
Configure kWS – Android Web Server
- Download and install kWS – Android Web Server.
- Launch kWS – Android Web Server, then go to Options and tap Settings
- General section you can configure below parameters:
- Home directory: The path of directory where your website contents are stored and will be served from by kWS – Android Web Server e.g. “/sdcard/web” without double quotes. In this case all website contents must be placed under “/sdcard/web” directory.
- Port: The TCP port on which kWS – Android Web Server will listen on. It can be any port greater than 1024 and less than 65535. Say 8080.
- Bind address: This option is only available in PRO version.
- Concurrent Connections: In lite version it supports up to 20 concurrent connections, so it can be anything between 1-20. Say 5.
- Connection timeout: This option is available only in PRO version. This is the timeout value after which connection with client will be closed.
- Status Notification: This option will show server status on notification bar if enabled.
- Advanced section you can configure below parameters:
- Server Side Includes: It will allow server-side scripting language to be used by Android Web Server.
- Directory level config: Only available in Pro version
- Directory Index: You can set directory content listing if the default document is not available in directory.
- Dynamic DNS:
- Dynamic DNS provider: Select the service provide for your dynamic dns service. You can choose from None, no-ip.com and dyndns.com. I selected dyndns.com
- Username: Username to access your DDNS service account
- Password: Password of your DDNS service account
- Hostname: Host name which you set up at your DDNS service providers server. I have entered kws.dyndns-web.com
- Auto update DNS: Updates DNS when server starts if enabled.
- Force update DNS: Only available in Pro version.
- Security section you can configure below parameters:
- Authentication: You can choose authentication method between None, Basic and Digest. To run a public android web server so that any body can open up your website you must choose None here. In remaining two options it will ask for login credentials before opening up the website.
- Realm: Available only in Pro version
- Username: Login username in case if you chose authentication method other than None.
- Password: Login password in case if you chose authentication method other than None.
- SSL settings: As we discussed in feature list kWS – Android Web Server Pro version supports SSL also. So, here you can configure SSL related settings
- Encryption: Only available with Pro version
- Logging section you can set the log options:
- Server log level: You can select from Info, Verbose and Debug
- Buffer size: You can set log buffer size in KB
- Log to file: This will log server-messages to kws.log file
- Overwrite http logs: If enabled will overwrite previous logs other wise it will create date based log files and maintain all log files
- Finally Start Server by tapping “Start server” button
The configuration part is over. Now how to check whether everything configured properly. To access your android web server you could either have your IP address or if you have configured Dynamic DNS then the fully qualified domain name is required or using either one you could access your android web server running on your android smart phone. But if you have dynamically assigned IP address to your WAN interface then it is recommended to register for Dynamic DNS service and setup a host name there, because if you want to run a public android web server then how visitor will know your IP address to access your website. Now to access android web server open up your web browser and type either http://your_ip_address:port or http://ddns_fqdn:port and then press enter.
Cheers! Your android web server is up and running. Please drop us a comment if you have any queries.