Chimer web server
The chimer web server is a homegrown HTTP/1.1 server, written in C++, whose initial scope was to supports as much of the protocol that I need to host this website. Features are still being worked on, as web servers are a topic of intersest of mine.
Hosting strategy
One of the goals in writing chimer was to be able to develop and host services on Linux, Windows, and MacOS. However, this wasn't always the case. During initial development, my thought was fewer dependencies were for the better. And because I was developing on a Mac, the networking concepts to target were unix sockets and kqueue. The original plan, then, was to develop on Mac and deploy on FreeBSD, where kqueue was the eventing mecahnism. There was a version of chimer that was fully implemented using kqueue, but after I learned the concepts of eventing, I felt comfortable using a library to paper over the differences between platforms as I'm much more familiar with Linux and Windows as a whole from personal and work experience.
This website is hosted on a Ubuntu 24.04 $5/month server from Linode. I have used many a linux distro, but I am most comfortable administering deployments in the Debian family. On Ubuntu, I love the simplicity of ufw when it comes to configuring a firewall. There aren't many things that I need to do: it's a few commands to allow ssh and HTTP, and probably most important of all, it's the firewall application that I learned first so it's just the what I'm used to. If I ever have more of a complex need then I'm open to using something else. Unattended upgrades are the other thing that I love about Debian/Ubuntu. Automatic and in-place upgrades of packages are incredibly nice to have when it's likely that at some point in a year I will not touch a deployment for a couple weeks at a time.
There are only a couple of things configured on this tiny server. I currently have apache installed as the main entry point for HTTP requests that reverse proxies to the chimer web server. This is for a couple reasons. First, I haven't implemented TLS termination in chimer (yet! This is on a long list of todos) and apache can dutifuly fulfill that role. Second, apache keeps me honest about the responses encoded and returned by chimer. If there is an egregious issue or bug, apache logs help me determine what went wrong and why the response was not acceptable. If the reverse proxy weren't there, that malformed response would go straight back to the client and I would have little insight into how to fix issues, let alone that there was problem at all! The only other packages installed are build-essential, cmake, and conan to actually build chimer. These don't necessarily have to be on the production hosting server, but the simplicity of scp-ing a release of the source code to the server, building, and running outweighs the complexity of building on a separate box for now.
Dependencies
- libuv (cross-platform I/O eventing)
- zlib (compression)
- CLI11 (command line argument parser)
- fmtlib (fast and safe alternative to C stdio and C++ iostreams)
- nlohmann_json (JSON for modern C++)