Apache with Let's Encrypt Certificates on CentOS 8

h‮w//:sptt‬ww.lautturi.com
Apache with Let's Encrypt Certificates on CentOS 8

To install and configure Apache with Let's Encrypt certificates on CentOS 8, you can follow these steps:

  1. Install the Apache web server by running the following command:
sudo dnf install httpd
  1. Enable the Apache service to start automatically on boot:
sudo systemctl enable --now httpd
  1. Install the Certbot client, which is used to obtain and manage Let's Encrypt certificates, by running the following command:
sudo dnf install certbot
  1. Use Certbot to obtain a certificate for your domain by running the following command, replacing example.com with your domain name:
sudo certbot certonly --standalone -d example.com
  1. After obtaining the certificate, you can configure Apache to use it by modifying the /etc/httpd/conf.d/ssl.conf file. Locate the <VirtualHost> element for the default HTTPS server, and set the SSLCertificateFile and SSLCertificateKeyFile directives to the paths of your certificate and private key files, respectively. These files are typically located in the /etc/letsencrypt/live/example.com directory, where example.com is your domain name.

  2. Restart Apache for the changes to take effect:

sudo systemctl restart httpd

After completing these steps, Apache should be configured to use your Let's Encrypt certificate for HTTPS connections. You can verify this by accessing your website using HTTPS in a web browser.

Created Time:2017-10-16 14:38:36  Author:lautturi