Urgent.News

What's breaking now, across thousands of outlets.

Tech

Simple NetBSD webserver

In a world filled with complex and overwhelming online resources, there may be a need for a simple, reliable server to meet basic web requirements. Among the few trustworthy operating systems available, NetBSD 11 stands out as a viable choice for hosting a web server. This article will outline the straightforward process of setting up a web server using NetBSD 11 and bozohttpd, a minimalistic web server that requires just one additional package for HTTPS support.

Prior to diving into the installation process, one must have access to a VPS, local machine, or virtual machine, alongside a terminal emulator and a web browser (although curl can suffice for basic checks). The author recommends netcup as a hosting service, appreciating its affordability and the availability of a preloaded NetBSD 11 AMD64 ISO.

NetBSD includes a basic web server, bozohttpd(8), which, while somewhat limited, offers flexibility through marker files and command line options. A popular alternative to bozohttpd is inetd(8), but the author found the latter to be less desirable due to its resource-intensive nature. Instead, bozohttpd can function as a standalone daemon. Configuration is achieved through command line options, which can be conveniently stored in /etc/rc.conf with self-explanatory keys.

To serve files from a specific directory, ensure their existence in /var/www/my_magical_domain/index.html. After starting bozohttpd with /etc/rc.d/httpd, your webpage will be accessible via plain HTTP. For added security, obtain an SSL certificate from Let's Encrypt using the acme-client package (installed via pkgin). This involves creating the necessary directories for challenge files and certificate storage, and configuring acme-client.conf to obtain the required certificates.

Once the certificate is in place and the domain's A record is updated, restart bozohttpd to enable HTTPS support on port 443. To maintain certificate validity, set up a cron job that periodically renews the SSL certificate and restarts bozohttpd using acme-client(1).

While bozohttpd is a straightforward web server, it does offer additional features such as virtual hosts, CGI support, and http basic authorization. More advanced functionalities like Lua scripting and URL rewrites may also be explored for enhanced functionality. For those seeking further alternatives to NetBSD, 9front and TempleOS are other options, though the latter lacks network support.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at bsandro.tech →

More in Tech

The most expensive phrase in cloud: we'll clean it up later

The most expensive phrase in cloud infrastructure is "we'll clean it up later" I've heard it in every account I've worked with A dev environment gets created for a sprint.

  • "We'll clean it up later" mindset drives high cloud costs
  • Developers deploy with debug logging, intending to reduce later
  • Effective approach integrates cleanup into initial setup

Photos in a folder, product live in WooCommerce: a Make.com + n8n pipeline for a refurbished-tools shop

A shop that sells refurbished professional power tools has a problem that new-goods shops don't: there are no manufacturer photos. Every unit is different, so every unit has to be photographed, cleaned up and listed by hand. Per product that is a few minutes.

  • Slovak refurbished tools shop automates product photography with Make.com + n8n pipeline
  • Photos automatically uploaded to Google Drive and processed for WooCommerce listing
  • Social media posts generated from product images using official APIs

More from Sunday 25 October →