A web server for a settlement is a program that hands out files from a folder in answer to HTTP requests, and for a library of pages that rarely change a plain static server such as nginx or Apache is enough: copy the folder into the document root, let the server read but not write it, and add dynamic features only when a real need forces them. Page weight matters more than server power, since a 500 kB page takes 0.04 s on a 100 Mbps link but 4 s on a 1 Mbps radio link. Keep a second copy of the site folder, because a static site can be rebuilt on any machine by copying it.

Part of Networking

Hosting a settlement’s shared pages: choosing a static server, the minimum configuration, file permissions, and the cost of page size on slow links.

A Static Folder Is The Easiest Thing To Serve And To Rebuild

The carrier Internet Infrastructure calls the web server the most versatile service: it can host documentation, coordinate resources, show sensor data and run web applications, with the document root at /var/www/html/ and an internal wiki as the first application, becoming the community’s shared library. HTTP shows what the server does with each request. For a library of reference pages, a static server does everything needed. It reads a file and sends it, needs no database, and has little code to go wrong. A static site is also the easiest thing in the settlement to back up: it is a folder.

Dynamic content (the carrier mentions PHP or Python CGI) means running programs on every request. It needs more maintenance, more patching and a bigger attack surface. Add it only for something a static page cannot do, such as accepting a form.

What You Need

  • A server machine (Linux Server Setup) with a fixed address and a name in DNS (DNS)
  • The server program and its documentation in the offline package archive
  • The pages, as a folder
  • A way to check from another machine — a browser or a hand-typed request (HTTP)

Method: Serve A Folder

Step 1: Install the server and put the site in the document root Use the carrier’s /var/www/html/ or the directory your configuration names. The pages need an index file for the folder’s front page.

Step 2: Write the smallest configuration For nginx, general knowledge, not from the other articles:

server {
    listen 80;
    server_name library.settlement.internal;
    root /var/www/html;
    index index.html;
}

Step 3: Set permissions so the server reads but cannot write The server runs as its own user. Give it read access to the site and no write access, so a fault in the server cannot change the pages. Only the person who updates the site should write to the folder (Access Control).

Step 4: Test from another machine, by name Open the page and read the status code. A 404 means the path is wrong and the network is fine (HTTP).

Step 5: Read the log after a day The access log shows who asked for what, and the error log shows missing files (Intrusion Detection explains reading logs).

Step 6: Copy the site folder to a second machine Update the copy whenever the site changes (File Transfer).

Take a page of 500 kB, counted as 500,000 bytes. In bits: 500,000 x 8 = 4,000,000 bits.

  • On a 100 Mbps wired link: 4,000,000 / 100,000,000 = 0.04 s.
  • On a 2 Mbps radio link: 4,000,000 / 2,000,000 = 2 s.
  • On a 1 Mbps radio link: 4,000,000 / 1,000,000 = 4 s.

The carrier gives radio modems 1-10 Mbps. These times ignore protocol overhead, so real times are somewhat longer, and they are for one user: if ten people on the far side fetch the page at once, the link is shared (Network Fundamentals: two users on a link each see half its rate). The practical lesson is to keep pages and images small and to serve the heavy material from the server nearest the readers, with a copy at each settlement (Server Deployment).

Common Mistakes

  • Making the site folder writable by the server — one fault then changes or defaces the pages
  • Serving more than the site — a configuration that points at the whole disk exposes everything on it
  • Heavy images on a slow link — a 4 s page is a page nobody reads
  • No second copy — the only copy on a failing disk is a lost library
  • Putting private material on plain HTTP — see Encryption Basics

What’s Next

  • Learn next: Mail Server — the other service most people use daily
  • Combine with: Firewalls — allowing port 80 and nothing more