RetroBSD Net
Title:
Serve files securely on NetBSD over HTTPS via bozotic-httpd
Authors:
Paolo Vincenzo Olivo
Date:
Topics:
Self-hosting, Server
Id:
139d0e

NetBSD's native web server is called <bozotic httpd>. That small piece of software is dead easy to configure and is perfect to serve files over the web. All you need to do in order to set up your server, is adding something like:

httpd=YES httpd_flags="-b -H -X -Z /usr/pkg/etc/letsencrypt/live/<mydomain.net>/fullchain.pem /usr/pkg/etc/letsencrypt/live/<mydomain.net>/privkey.pem -z ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256"

To your /etc/rc.conf.

Understanding options: - `-b`: daemon mode, detach from console - `-H`: treat files starting with a period as hidden files - `-X`: enables directory indexing; this is if you only want to serve files and omit creating a index.html file on your server dir (by default /var/www) - `-Z`: cert and private key paths - `-z`: list of acceptable SSL ciphers

Now put your files at /var/www and start the service. The default layout will look like that of https://cdn.netbsd.org Refer to <https://man.netbsd.org/httpd.8> for a more in-depth description.