In this comprehensive guide, we will walk you through the process of installing Let’s Encrypt SSL with LAMP Stack on AlmaLinux 8. Let’s Encrypt is a non-profit certificate authority that provides free X.509 certificates for Transport Layer Security (TLS) encryption. By securing your website with Let’s Encrypt SSL, you can protect your users’ data and enhance their trust in your online presence.
Before we begin, make sure you have a system with AlmaLinux 8 installed and running, and you have root access to the system. Additionally, LAMP Stack (Apache, MariaDB, and PHP) should be installed and running. If you haven’t set up LAMP Stack yet, you can refer to our guide on How to Install LAMP Stack on AlmaLinux 8.
Now, let’s dive into the step-by-step installation and configuration process of Let’s Encrypt SSL on AlmaLinux 8.
Prerequisites
Before we proceed with the installation, let’s ensure that we have all the necessary prerequisites in place.
- AlmaLinux 8 installed and running.
- Root access to the system.
- LAMP Stack (Apache, MariaDB, and PHP) installed and running.
If you haven’t met these prerequisites, please follow the appropriate guides to set them up. Once you’re ready, we can proceed with the installation and configuration of Let’s Encrypt SSL.
Install Certbot
Certbot is a widely used command-line tool for managing Let’s Encrypt certificates. To install Certbot, follow these steps:
- Open the terminal and run the following command to install the necessary packages:
dnf install epel-release -y dnf install certbot python3-certbot-apache -y
Configuring Apache vHost
To configure Apache virtual host for your domain, follow these steps:
- Open the terminal and run the following command to create a new Apache configuration file for your domain:
nano /etc/httpd/conf.d/dev1.domainhere.info.conf
- In the newly created file, add the following code:
<VirtualHost *:80>
ServerName dev1.domainhere.info
ServerAlias dev1.domainhere.info
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options -Indexes +FollowSymLinks
AllowOverride All
</Directory>
ErrorLog /var/log/httpd/dev1.domainhere.info-error.log
CustomLog /var/log/httpd/dev1.domainhere.info-access.log combined
</VirtualHost>
- Replace
dev1.domainhere.info
with your actual domain name. - To save and exit the file, press the
Esc
key, type:wq!
, and press theEnter
key. - Restart Apache to apply the changes:
systemctl restart httpd systemctl status httpd
Enable Firewall
To allow HTTP and HTTPS traffic through the firewall, follow these steps:
- Open the terminal and run the following commands:
firewall-cmd --permanent --add-service=http firewall-cmd --permanent --add-service=https firewall-cmd --reload
Generating Let’s Encrypt SSL
Now, let’s generate Let’s Encrypt SSL for your domain using Certbot:
- Open the terminal and run the following command:
certbot --apache
- Follow the prompt to enter your email address and agree to the terms of service.
- Select the domain for which you want to generate the SSL certificate.
- Certbot will automatically configure Apache to use the SSL certificate.
- Restart Apache to apply the changes:
systemctl restart httpd
Congratulations! You have successfully installed Let’s Encrypt SSL with LAMP Stack on AlmaLinux 8. Your website is now secured with a valid SSL certificate, ensuring encrypted communication between your server and your users.
Remember to regularly renew your Let’s Encrypt SSL certificate to maintain the security of your website. Certbot provides automatic renewal options, so you don’t have to worry about manually renewing the certificate.
Additional Information
At Shape.host, we offer reliable and scalable cloud hosting solutions for businesses. Our Linux SSD VPS plans provide high-performance hosting environments that are optimized for speed and security. With our exceptional 24×7 in-house customer support, we ensure that your hosting experience is smooth and hassle-free. Visit Shape.host to explore our services and find the perfect hosting solution for your needs.
Now that you have successfully installed Let’s Encrypt SSL with LAMP Stack on AlmaLinux 8, your website is ready to provide a secure browsing experience to your users. Enjoy the benefits of enhanced security and build trust with your audience.