To secure an Apache web server with Let's Encrypt certificates on RHEL 8/9, you can follow these steps:
certbot
tool. You can install the certbot
tool by running the following command:dnf install certbot
This will install the certbot
tool and its dependencies.
systemctl stop httpd
certbot
tool to obtain a certificate. You can run the certbot
tool to obtain a certificate by running the following command:certbot certonly --standalone -d example.com -d www.example.com
Replace example.com
and www.example.com
with the domain names you want to secure. This will obtain a certificate for the specified domain names.
/etc/httpd/conf/httpd.conf
.Add the following lines to the configuration file to configure Apache to use the certificate:
SSLEngine on SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
Replace example.com
with your domain.