業務用エアコン関連の技術情報、エラーコード、環境問題対策に関する別サイト「エアコンの安全な修理・適切なフロン回収」

CentOS Stream10 : Let's Encrypt , Apache・Mail Server SSL/TLS

1.Obtain SSL Certificate( Let's Encrypt )

1.1 advance preparation

1.Install the latest open ssl

2.Package management system Snappy installed
Since the SSL certificate issuing tool "certbot" of Let's Encrypt is recommended to be installed using "snap" after 2021, install Snapd first.(Can also be installed the traditional way with dnf or yum)

Enable systemd unit to manage the main snap communication socket

Enable Classics Snap support

Bring snapd version up to date

If the above fails, run the following command instead (the core package will be installed along with the package called hello-world)

Update core package

Version Check

Log out and log in again or reboot the system to ensure that the snap path is updated correctly

3.certbot package install

Create symbolic link to /snap/bin/certbot

Confirmation

1.2 Obtaining Certificates

Registration of e-mail address and agreement to terms of use are required for the first time only.
Specify an email address to receive

Success if displayed"Successfully received certificate".
The following certificate is obtained under [/etc/letsencrypt/live/<FQDN>/] 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

1.3 Automatic renewal of certificates(Let's Encrypt)

Pre-registration testing
First, test the automatic update using the following --dry-run option.
With this option, certificates are not renewed, only checked, so there is no need to worry about getting stuck with a limit on the number of times a certificate can be obtained.

➁Automatically renew SSL certificates using cron (run at midnight on the 1st of each month)

2. Apache https

Install the following

2.1 Edit ssl.conf file

Apache restart

Allow https in Firewall

2.2 Redirect HTTP communications to HTTPS

Add the following to /etc/httpd/conf.d/vhost.conf

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

3.1 Obtaining a Certificate for 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.

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

3.2 Postfix Configuration

3.3 Dovecot Configuration

Allow Port 587 in 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