openbsd-web-server.txt (838B) [raw]
1 OpenBSD Web Server 2 ================== 3 Tues Sept 21, 2021 4 5 tags: openbsd www 6 7 One of the first things I do when I set up a machine is set up 8 httpd(8) and grab a HTTPS cert via acme-client(8). 9 10 Here's a quick rundown (though reading the man pages is worth 11 the time!). 12 13 # sed 's/example.com/<MY HOSTNAME>/g' \ 14 /etc/examples/httpd.conf > /etc/httpd.conf 15 # sed 's/example.com/<MY HOSTNAME>/g' \ 16 /etc/examples/acme-client.conf > /etc/acme-client.conf 17 18 Then go in and edit the files to add aliases if needed! 19 20 To get the certs for the first time: 21 22 # rcctl enable httpd 23 # rcctl start httpd 24 # acme-client -v <MY HOSTNAME> # get certs 25 # rcctl reload httpd # load certs 26 27 Finally, to keep the certs up to date, add the following to the 28 crontab: 29 30 # crontab -e 31 ... 32 ~ * * * * acme-client <MY HOSTNAME> && rcctl reload httpd