zhttpd

A small, dependency-light HTTP server written in C89 for classic UNIX and minimal modern systems. Retro where it matters, lean where it counts.

zhttpd logo / retro server
Readable in text browsers (lynx/links) and older GUI browsers (IE 5+).
 
What is zhttpd?

zhttpd is a deliberately small, static-file HTTP daemon with a conservative build and minimal dependencies. It targets classic UNIX systems, but it is equally at home on modern minimal installations where you want a web server without dependencies to external libraries.

The design favors classic UNIX mechanics: a simple accept loop with fork-per-connection, bounded buffers, and predictable control flow. The result is software that is easy to audit, easy to port, and easy to keep running for years.

If you need TLS, CGI, or modern HTTP features, zhttpd is intended to sit behind a relay (e.g. stunnel) or be used as a minimal static server for retro / embedded / constrained environments.

Core goals
  • Simplicity first: small codebase, predictable control flow, minimal moving parts.
  • Retro portability: target old compilers and libc quirks; avoid fragile dependencies.
  • Modern minimalism: useful on lean contemporary systems where you want a tiny static server with no extra libraries.
  • Static content: serve files from a confined docroot (no dynamic execution).
  • Security-minded I/O: conservative parsing, bounded buffers, safe defaults.
  • Operational clarity: config file driven; stable log format; easy to audit.

In short: zhttpd aims to be the "small, boring, reliable" option for serving static files.

Feature snapshot
  • IPv4, GET and HEAD
  • HTTP/1.0 + basic HTTP/1.1 request line acceptance (no keep-alive)
  • Docroot confinement; rejects traversal attempts; conservative file serving
  • Optional mimetypes file; small built-in fallback mapping
  • Optional access/error logs; logging can be disabled
  • Configurable concurrency cap (classic fork model)

Intentional non-features: TLS, CGI, compression, and complex HTTP behavior. The objective is reliability and portability, not maximum feature coverage.

Portability & tested platforms

zhttpd is written in C89 and aims to compile on older UNIX systems with conservative make rules. At the same time, the "no heavy dependencies" philosophy makes it a good fit for modern minimal systems: small containers, stripped-down servers, embedded Linux distributions, and recovery environments where you just need a stable static server.

Operating System Build status Test status Notes
IRIX (MIPSpro / gcc) Build OK Tested OK Often needs socket libs; conservative ANSI flags recommended.
Solaris 2.6 (SunPro C / gcc) Build OK Tested OK May require -lsocket -lnsl. Works well on classic SPARC.
Tru64 UNIX (DEC/Compaq cc) Build OK Tested OK Good libc baseline; emphasizes portable socket types and conservative headers.
Linux / *BSD Build OK Tested OK Useful on modern minimal systems where you want a static server without extra libraries.
Other systems (AIX, HP-UX, Ultrix, OpenStep) Expected OK Community Targeted by design; contributions for platform notes and patches are welcome.

“Tested OK” indicates the binary was executed and served real requests on that platform. “Expected OK” indicates the codebase is engineered for the environment, but testing may depend on community hardware availability.

Build (quick start)

Typical build on most systems:

make

Example for Solaris/SunOS style socket libraries:

make LDLIBS='-lsocket -lnsl'

The build stays intentionally conservative: no autoconf/cmake and no dependency-heavy frameworks. That makes zhttpd suitable both for classic UNIX and for modern minimal environments.

Download & source

Replace these URLs to match your actual hosting layout (or keep them as stable “virtual” endpoints).

License

zhttpd is released under the MIT License. See LICENSE.
Copyright (c) 2026 zzif.