I once inherited one such system, it was running on 2.5.1.. My job was to move it to a zone on s10.. It actually pretty much worked, I had to port it forwards to S8, but then word got around that someone had done 'something' to this ancient pile of tech debt and feature requests started coming in so I rewrote it all in perl in an afternoon.. I didn't even try to understand the code, I just used tcpdump to look at the requests/responses and treated it as a black box.
You can also coax gawk into being a web server itself, albeit a bit brain-dead. I wish they would tweak the way it does server sockets so that you could make a decent forking server. As it stands now, you don't get the socket until after the listen() and accept().
I have several servers running it, and I’ve been pretty pleased with it. If you want to try it out you can get an OpenBSD VM at Vultr or OpenBSD.amsterdam for about $6/month.
I also highly recommend Michael W Lucas’s book Relayd & Httpd Mastery.
One thing keeping me on Apache I stead of NGINX or obhttpd is how easy it is to do overrides for particular directories. I use this A LOT for generating dynamic content.
Example: Let's say I want to generate an RTF doc for a power of attorney. I'll tell Apache via .htaccess to treat .rtf documents in that directory as CGI scripts. poa.rtf then is a Python script to process the QUERY_STRING or POST parameters into an RTF template and spit it out. End result is that browser requests poa.rtf and gets a file called poa.rtf -- generated on the fly.
Do you have an idea how you'd accomplish the same trickery in obhttpd? I guess you'd have to have the per-directory config in the main config file?
I replied to someone on Twitter about this as I mistakenly thought they were the author, but the interpreter line in the example script should be #!/usr/bin/awk rather than #!/bin/awk.
I just wanted to point out typo. I'm aware of the env idiom, though that wouldn't work in the chroot environment described in the article. Short of also copying it to the chroot which would be a bit redundant.
totally unrelated to the topic but here I am following this blog now because of very much in common. That is, 1. i3, 2. emacs, 3. sync'ing git repos accross machines.
23 comments
[ 3.0 ms ] story [ 59.6 ms ] threadI don't miss this kind of work ;)
https://news.ycombinator.com/item?id=22085459
I also highly recommend Michael W Lucas’s book Relayd & Httpd Mastery.
Example: Let's say I want to generate an RTF doc for a power of attorney. I'll tell Apache via .htaccess to treat .rtf documents in that directory as CGI scripts. poa.rtf then is a Python script to process the QUERY_STRING or POST parameters into an RTF template and spit it out. End result is that browser requests poa.rtf and gets a file called poa.rtf -- generated on the fly.
Do you have an idea how you'd accomplish the same trickery in obhttpd? I guess you'd have to have the per-directory config in the main config file?
Edit: nevermind, you're right, just checked it again and the author put the copied awk under /usr/bin inside the chroot
sample index.html.tawk which can generate index.html
```` <p> {{! cat /proc/cpuinfo }} </p>
````
https://box.matto.nl/sparkleshare-to-sync-org-files.html
E.g. dump form posts for later (offline) processing: https://codeberg.org/mro/form2xml/src/branch/master/dump.cgi