How to easily install a web server on an Android device

If you’ve ever wanted to install a web server on your Android device, you’re in luck. This walkthrough explains how to install and configure the Apache-powered HTTP server.

From the desktop of “We do this because we can” comes the ability to run a web server on an Android device. But it’s not just any old web server – it’s an Apache-powered server. The server in question is HTTP Server powered by Apache and it can be found on the Google Play Store. This server is based on Apache 2.2 and does a great job of serving websites from your mobile device.

Of course, you ask yourself: “Why do that?” The truth is, there aren’t many good reasons, other than to show you can. But there is the idea of ​​having a mobile web server in your pocket that you can test development on. What better way to learn how to build basic websites than with a pocket server! Whatever your reason for wanting it, I’ll show you how to install it and run a basic website on your Android device.

SEE: Android Pie is here, coming to Google Pixel phones first (CNET)

Installation

The installation is quite simple. Just follow these steps:

  1. Open the Google Play Store on your Android device.
  2. Find the HTTP server.
  3. Locate and press the entrance to Tautvydas Andrikys.
  4. Tap Install.
  5. Let the installation complete.

Once the installation is complete, you will find a launcher for the app on your home screen and/or app drawer. Tap the launcher to open the app. When you first run it, you need to download and install a version of Apache (Figure A).

Figure A

To download the version, press the download button (arrow pointing down). Once downloaded, tap on the name of the download to create it. Once the download is built, you will be presented with the main screen.

SEE: Job Description: Android Developer (Tech Pro Research)

Configuring and starting your server

In the main window (Figure B), press the Edit button for the server address and port.

Figure B

In the resulting popup window (Figure C), tap to change the port (if needed) and tap the Server Address drop-down menu. From the list of possible addresses, you can select an IPv4, IPv6, loopback address, and a full network address.

Figure C

After configuring your address and port, press the Edit button and you will be returned to the main window. Press the START SERVER button and your web server is now up and running. Point a browser to your chosen IP address (assuming your Android device is on the same network as the desktop computer you’ll be testing it with) and the default index page will appear (Figure D).

Figure D

When you’re ready to add your own pages to the server, place the files in the server’s document root in /storage/emulated/0/htdocs. If your device does not include a file manager, you will find several on the Google Play Store. Or you can always install a good text editor (like anWriter free) and develop directly on the device. Either way, your web server is ready to go.

SEE: Serverless Architectures: 10 Serious Security Issues (Free TechRepublic PDF)

Enjoy

It won’t make you more productive on your Android device…unless your goal is to hone your HTML skills. But whatever your reasons for installing this web server on your Android device, have fun with it.

Read also…

Your thoughts

Does this sound like an interesting project, or are you going to skip it in favor of more hands-on tasks? Share your views with other TechRepublic members.