Althttpd

From Alpine Linux

Althttpd is a simple web-server that has run the https://sqlite.org/ website, among others, since 2004. Althttpd strives for simplicity, security, and low resource usage.

Features

  • Virtual Hosts
  • Brotli and GZip content compression
  • Request URIs sanitized for security
  • Basic authentication
  • Client IP blocking
  • CGI/SCGI support
  • TLS support
  • Runs in chroot jail by default
  • Files or directories beginning with . or - are ignored
  • and more ...

Quick Start

Install the althttpd package:

# apk add althttpd

In a working directory, create a test index.html file with contents as follows:

Contents of index.html

<!DOCTYPE html> <html> <head> <title>Hello World!</title> </head> <body> <h1>Hello, World!</h1> </body> </html>

From the working directory, start althttpd:

~/althttpd-wiki $ althttpd . Listening for HTTP requests on TCP port 8080

Open up your browser and navigate to http://127.0.0.1:8080 and you should see your Hello World! page.

Running as a Service

Install the openrc service scripts:

# apk add althttpd-openrc

Review the startup options documented in /etc/conf.d/althttpd and edit $ALTHTTPD_OPTS as required for your environment.

Use the OpenRC commands as usual to start|stop|restart althttpd service:

# rc-service althttpd start

See Also