httpd
http
/etc/httpd.conf:
server "www.example.cz" {
alias "example.cz"
listen on * port 80
root "/htdocs/www.example.cz"
}
Use the alias option if you want to both www.* and .*
The website is now in /var/www/htdocs/www.example.cz (root). This can be anything you want.
# rcctl enable httpd # rcctl start httpd
https
DNS records:
www.example.cz. 300 IN CAA 0 issue "letsencrypt.org"
/etc/acme-client.conf:
authority letsencrypt {
api url "https://acme-v02.api.letsencrypt.org/directory"
account key "/etc/ssl/private/letsencrypt.key"
}
domain www.example.cz {
alternative names { example.cz nein.example.cz }
domain key "/etc/ssl/private/www.example.cz.key"
domain certificate "/etc/ssl/www.example.cz.crt"
domain full chain certificate "/etc/ssl/www.example.cz.pem"
sign with letsencrypt
}
# mkdir -p -m 700 /etc/ssl/private # mkdir -p -m 755 /var/www/acme
Add https variant to /etc/httpd.conf
server "www.example.cz" {
alias "example.cz"
listen on * tls port 443
root "/htdocs/www.example.cz"
tls {
certificate "/etc/ssl/www.example.cz.pem"
key "/etc/ssl/private/www.example.cz.key"
}
location "/.well-known/acme-challenge/*" {
root "/acme"
request strip 2
}
}
# rcctl restart httpd # acme-client -v www.example.cz # crontab -e
0 0 * * * acme-client www.example.cz && rcctl reload httpd
If you add subdomains to your httpd.conf, you only need to
add them to the "alternative names" block in /etc/acme-client.conf" and run:
# acme-client -vF www.example.cz