Click here for "Safe Air Conditioner Repair and Proper Freon Recovery".(Japanese Version)

Debian10.13 ; Let's Encrypt WEB , Mail SSL

1. Obtaining a Certificate(Let's Encrypt)

1.1 advance preparation

①Enable mod_ssl

②Install client tool to obtain Let's Encrypt certificate

1.2 Obtaining a Let's Encrypt Certificate

It is assumed that a web server such as Apache httpd or Nginx is running.
If the web server is not running on the server where the work is to be performed, follow the steps※ below.
It is also assumed that the server on which the work is to be performed (the server with the FQDN from which you want to obtain the certificate) is accessible from the Internet at port 80.

#Use the directory under the public directory of the running Web server as a temporary area for authentication by specifying [--webroot].
# -w [document root] -d [FQDN to obtain certificate]
# FQDN (Fully Qualified Domain Name) : Hostname. Domain name without abbreviation
# Document root is specified for the appropriate host definition if multiple host definitions exist for a virtual host
# Registration of e-mail address and agreement to terms of use are required for the first time only.
# Specify an email address to receive

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): [Mail address]

Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.3-September-21-2022.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory

(A)gree/(C)ancel: A

Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom

(Y)es/(N)o: y
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for [FQDN]
Using the webroot path /var/www/html/[FQDN] for all unmatched domains.
Waiting for verification…
Cleaning up challenges

IMPORTANT NOTES:
Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/[FQDN]/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/[FQDN]/privkey.pem
Your cert will expire on 2023-05-11. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew all of your certificates, run
"certbot renew"

Your account credentials have been saved in your Certbot
configuration directory at /etc/letsencrypt. You should make a
secure backup of this folder now. This configuration directory will
also contain certificates and private keys obtained by Certbot so
making regular backups of this folder is ideal.
If you like Certbot, please consider supporting our work by:

Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le

We were unable to subscribe you the EFF mailing list because your
e-mail address appears to be invalid. You can try again later by
visiting https://act.eff.org.

Success if displayed"Congratulations! Your certificate and chain have been saved at:"
# The following certificate is obtained under [/etc/letsencrypt/live//] as described in the message

# cert.pem ⇒ SSL server certificate (including public key)
# chain.pem ⇒ intermediate certificate
# fullchain.pem ⇒ File containing cert.pem and chain.pem combined
# privkey.pem ⇒ private key

※ Obtaining a Let's Encrypt certificate when the web server is not running

It is a prerequisite that the server on which the work is to be performed is accessible from the Internet at port 80.

#Use the simple Web server function by specifying [--standalone].
# -d [FQDN from which you want to obtain a certificate]
# FQDN (Fully Qualified Domain Name) : Hostname. Domain name without abbreviation
# If there are multiple FQDNs for which you want to obtain certificates, specify multiple -d [FQDNs for which you want to obtain certificates

Renewing certificates already obtained
# Renew all certificates with an expiration date of less than 30 days
# If you want to renew regardless of the number of days remaining on the expiration date, specify [--force-renewal] as well.

2. SSL/TLS (Let's Encrypt) configuration for Apache2

①Edit Apache2 SSL-related configuration files

②Reflecting and activating the configuration file

③http to https redirect

One of the following methods

④Reflection of settings and startup

3. SSL/TLS (Let's Encrypt) settings on the mail server

3.1 Obtaining a certificate for the mail server

Obtain a certificate for the mail server, but it cannot be obtained in the same way as above, so the following with the "--standalone" option fails.

f I stop the web server once and then do it, it succeeds as follows

3.2 Postfix Configuration

3.3 Dovecot Settings

Allow Port 587 in the firewall

3.4 Thunderbird Settings

Receiving server

Port  :  143
Connection security   :  STARTTLS
Authentication method  :  Normal password

Sending server

Port   :  587
Connection security   :  STARTTLS
Authentication method  :  Normal password

Copied title and URL