How to Setup Let's Encrypt SSL Certificate with Apache on AlmaLinux 10
Let's Encrypt is a non-profit certificate authority run by the Internet Security Research Group that provides free SSL/TLS certificates. In this guide, we will install and configure Let's Encrypt SSL on AlmaLinux 10.
Pre-requisites
root
user access to the server.Apache
Web server installed and running.- You may refer to our LAMP Stack Installation on AlmaLinux 10 if it's not already installed.
Install EPEL Repository and mod_ssl
dnf install epel-release mod_ssl -y
Install Certbot
dnf install certbot python3-certbot-apache -y
Configure Apache Virtual Host
Example domain:
blog.domainhere.info
— replace this with your actual domain name.
Create a new Apache configuration file:
nano /etc/httpd/conf.d/blog.domainhere.info.conf
Add the following configuration:
<VirtualHost *:80>
ServerName blog.domainhere.info
ServerAlias blog.domainhere.info
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options -Indexes +FollowSymLinks
AllowOverride All
</Directory>
ErrorLog /var/log/httpd/blog.domainhere.info-error.log
CustomLog /var/log/httpd/blog.domainhere.info-access.log combined
</VirtualHost>
Save and exit.
Restart Apache and Check Status
systemctl restart httpd
systemctl status httpd
Configure Firewall
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload
Generate Let's Encrypt SSL Certificate
certbot --apache
Follow the on-screen instructions. Example:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Which names would you like to activate HTTPS for?
1: blog.domainhere.info
Select the appropriate number: 1
Requesting a certificate for blog.domainhere.info
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/blog.domainhere.info/fullchain.pem
Key is saved at: /etc/letsencrypt/live/blog.domainhere.info/privkey.pem
Certbot will also configure your Apache SSL automatically.
Verify SSL Installation
Open your browser and visit:
https://blog.domainhere.info
You should see a lock icon, confirming that SSL is successfully installed and HTTPS is working.
Congratulations! You have successfully installed Let's Encrypt SSL Certificate with Apache on AlmaLinux 10.
CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME
for 10% off!
1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month
Available Locations: LAX | MIA | ATL | FRA | AMS