92
edits
mNo edit summary |
mNo edit summary |
||
| Line 171: | Line 171: | ||
fi | fi | ||
[ ! -f "/etc/letsencrypt/live/< | [ ! -f "/etc/letsencrypt/live/<CERT_NAME>/fullchain.pem" ] || certbot certonly --non-interactive --cert-name <CERT_NAME> --dns-rfc2136 --dns-rfc2136-credentials etc/<DNS_CONF_DIR>/dns-auth.conf --domain "$FQDN" --domain "*.$FQDN" --deploy-hook /usr/share/<PKG_NAME>/bin/cert-deploy | ||
</pre> | </pre> | ||
This block registers Certbot, checks for an existing certificate, and if none exists, requests a new certificate using DNS authentication with the specified dns-auth.conf file. The --deploy-hook option calls the cert-deploy file after each certificate issuance or renewal. We will create the cert-deploy in a further step. | This block registers Certbot, checks for an existing certificate, and if none exists, requests a new certificate using DNS authentication with the specified dns-auth.conf file. The --deploy-hook option calls the cert-deploy file after each certificate issuance or renewal. We will create the cert-deploy in a further step. | ||
In the case of our guide with the kaboom-api example, <code>< | In the case of our guide with the kaboom-api example, <code><CERT_NAME></code> is <code>kaboom-elearning</code>, again it's up to you to select the right naming for your case. | ||
==== c. Generating Diffie-Hellman Parameters for SSL ==== | ==== c. Generating Diffie-Hellman Parameters for SSL ==== | ||
| Line 193: | Line 193: | ||
<pre lang="bash"> | <pre lang="bash"> | ||
cat >/etc/nginx/sites-available/< | cat >/etc/nginx/sites-available/<CERT_NAME> <<CONF | ||
server { | server { | ||
root /usr/share/<PKG_NAME>/public; | root /usr/share/<PKG_NAME>/public; | ||
| Line 213: | Line 213: | ||
listen 443 ssl http2; | listen 443 ssl http2; | ||
ssl_certificate /etc/letsencrypt/live/< | ssl_certificate /etc/letsencrypt/live/<CERT_NAME>/fullchain.pem; | ||
ssl_certificate_key /etc/letsencrypt/live/< | ssl_certificate_key /etc/letsencrypt/live/<CERT_NAME>/privkey.pem; | ||
ssl_dhparam etc/<DNS_CONF_DIR>/ssl-dhparams.pem; | ssl_dhparam etc/<DNS_CONF_DIR>/ssl-dhparams.pem; | ||
| Line 227: | Line 227: | ||
CONF | CONF | ||
[ -L /etc/nginx/sites-enabled/< | [ -L /etc/nginx/sites-enabled/<CERT_NAME> ] || ln -s /etc/nginx/sites-available/<CERT_NAME> /etc/nginx/sites-enabled | ||
nginx -q -t && service nginx reload | nginx -q -t && service nginx reload | ||
</pre> | </pre> | ||
edits