Due to police activity on the College Green, access to Van Pelt-Dietrich Library Center is restricted until further notice. Current students, faculty and staff with a valid Penn card are permitted to enter and exit through the Rosengarten Undergraduate Study Center on the ground floor. 

During reading period, April 30 to May 14: Access to Van Pelt and Fisher Fine Arts Library is limited. Find more information.

RDDS: Explore Our Work

Creating a Minimal Web Server

This is a tutorial to create a local webserver to serve files. We will re-purpose a Wi-Fi router to serve data over Wi-Fi to the browser on local devices such as phones and tablets. This is a great way to share digital archives and data with people in locations with limited internet access.

A yellow Wi-Fi router box that has been re-purposed as a local webserver.

Internet access is the result of complex infrastructure and technologies that cannot be taken for granted across the globe. For several of our projects, reliable and affordable access to the internet poses a significant barrier to project work. Rather than a quick data exchange, we are faced with a spinning loader and an uncertain result.  Will this file download completely, or will it break? Is it frozen, or is it just taking longer than normal? With large collections of images and TIFF files, the need to download can make our digital collections inaccessible.  

To address this issue, RDDS created a "minimal web server" to take digital collections and data anywhere. It's inspired by efforts like PirateBox and LibraryBox, but offers a much-needed update for current hardware. 

This post offers a quick start for those who just want to get up and running. If you prefer a deep dive and want more control and sustainability, there's an advanced tutorial here.        

At the end, you will have the following:

  • A working Wi-Fi router running OpenWRT (Linux)
  • A page that lists all the files on your mini file server.  

Suggested Parts
For this tutorial, we'll assume the following parts that are available at the time of writing. We'll try to keep this updated if things change.

  1. GL iNet 300N Mini Smart Router (GL-MT300N-V2) $30
  2. Cotchear Mini Super Speed Micro SD/SDXC TF USB 2.0 Card Reader Adapter (B07HFQQ71F) $6
  3. 128G MicroSD Memory Card $13. 
     

Quick Start
Your "mango" mini smart router comes with a white USB cord. Plug the larger USB-A end of that cord into a computer or power source. The other end (micro USB) connects to the router.

Once your router has booted, the left light will be solid. It is now broadcasting a wifi signal that you can connect to. Look for GL-MT300N-V2-64d (or something like it) and connect to that network. Once connected, open your browser and go to 192.168.8.1. The initial password is "goodlife." You can set your preferred language and set a new root password.

We will now use that password to connect to the router using SSH. Open your terminal and enter. 

ssh root@192.168.8.1 

You can log in with the password you just set in the browser.

Plug in your formatted USB drive (the blue light should turn on). Go to /mnt and find your drive. My drive is called FMB, so I see

/mnt/FMB

The firmware installed on this router is already running OpenWRT, which is a version of Linux made to run on Wi-Fi routers. It comes with its own web server called uHTTPd, which will serve anything in the www directory to the web. To serve files from the USB drive, we create a symbolic link between it and the www folder. You can name the directory whatever you like. Here it is, "site."

ln -s /mnt/FMB/_site /www/site 

Your files in the USB folder "_site" are now available at http://192.168.8.1/site (or the name you used instead of "site"). You can also move the default index.html file so that the web server displays a listing of files in the www folder instead.  To so this, type 

mv /www/index.html /www/index.html.orig

You now have a highly mobile web server that you can take wherever you like. The server can be powered by a few AA batteries and taken anywhere. In future posts, we'll share how to create a simple digital archive with search and browse functionality for your files. We hope this was helpful. Please reach out with any questions or ideas on how you might use a mini web server on your projects.  

Author

Date

January 16, 2024

Share