Disclaimer: Note that likely this is completely unsupported by Apache httpd project. I'm just posting what worked for me, take this as an approximate guide. Also, it may or may not work with Apache httpd source versions other than 2.4.18. I make no guarantees as to whether this will work for you and I can't provide support for this. Proceed at your own risk.
[/disclaimer]
Trying to set up the nginx on my new server like I had apache2 set up on my prior server, but discovered that the way to generate password files pretty much requires htpasswd and/or htdigest... but installing those required installing significant parts of Apache2, which I didn't want to do. So I grabbed the sources for Apache httpd 2.4.18 to see if I could build statically-linked htdigest & htpasswd standalone executables. And yes it is possible but it requires some hackery. So here is what I figured out from digging around in the Apache httpd build system code.
1) Download Apache2 httpd source code from https://httpd.apache.org/download.cgi#apache24: click "Other Files" and grab BOTH httpd-2.4.18 AND httpd-2.4.18-deps
2) extract both of them to the same place (they will write into each other)
3) Follow Apache's build instructions for the configure stage (https://httpd.apache.org/docs/current/p ... igure.html). We want these options:
Code: Select all
./configure --with-static-htpasswd --with-static-htdigest --with-included-apr
Code: Select all
make -C srclib
Code: Select all
htpasswd_LTFLAGS = -static
htdigest_LTFLAGS = -static
Code: Select all
make htpasswd htdigest