In this comprehensive guide, we will walk you through the process of installing Let’s Encrypt SSL with LAMP Stack on Rocky Linux 8. Let’s Encrypt is a non-profit certificate authority that provides free X.509 certificates for Transport Layer Security encryption. By following the steps outlined in this article, you will be able to secure your website with a trusted SSL certificate.
Prerequisites
Before we begin, make sure you have the following requirements in place:
- A system with Rocky Linux 8 installed and running.
- Root access to the system.
- LAMP Stack (Apache, MariaDB, and PHP) installed and running. If you haven’t installed LAMP Stack yet, refer to our guide on How to Install LAMP Stack on Rocky Linux 8.
Now that you have met the prerequisites, let’s proceed with the installation and configuration of Let’s Encrypt SSL.
Step 1: Install Certbot
Certbot is a popular tool that simplifies the installation and management of Let’s Encrypt certificates. To install Certbot, open your terminal and run the following commands:
sudo dnf install epel-release -y sudo dnf install certbot python3-certbot-apache -y
Step 2: Configure Apache vHost
Next, we need to configure the Apache virtual host (vHost) for your domain. Open the Apache configuration file using your preferred text editor. In this example, we will use nano
:
sudo nano /etc/httpd/conf.d/dev1.domainhere.info.conf
Inside the file, add the following configuration for your domain:
<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.comainhere.info-error.log
CustomLog /var/log/httpd/dev1.comainhere.info-access.log combined
</VirtualHost>
Make sure to replace dev1.domainhere.info
with your actual domain name. Save and exit the file by pressing Ctrl+X
, followed by Y
, and then Enter
.
Restart Apache to apply the changes:
sudo systemctl restart httpd
Step 3: Enable Firewall
To allow HTTP and HTTPS traffic through the firewall, run the following commands:
sudo firewall-cmd --permanent --add-service=http sudo firewall-cmd --permanent --add-service=https sudo firewall-cmd --reload
Step 4: Generate Let’s Encrypt SSL
Now it’s time to generate your Let’s Encrypt SSL certificate. Run the following command to launch the Certbot wizard and automatically configure SSL for your domain:
sudo certbot --apache
Follow the on-screen prompts to select the domain you want to secure and provide a valid email address. Certbot will automatically handle the certificate generation and installation process for you.
Step 5: Restart Apache
To ensure that your changes take effect, restart the Apache service:
sudo systemctl restart httpd
Congratulations! You have successfully installed Let’s Encrypt SSL with LAMP Stack on Rocky Linux 8. Your website is now secured with a trusted SSL certificate.
Conclusion
In this article, we have covered the step-by-step process of installing Let’s Encrypt SSL with LAMP Stack on Rocky Linux 8. By following these instructions, you can secure your website and provide a safe browsing experience for your users. Remember to regularly renew your SSL certificate to maintain its validity.
If you are looking for reliable and scalable cloud hosting solutions, consider Shape.host’s Linux SSD VPS services. Shape.host offers high-performance virtual private servers with SSD storage, ensuring fast and efficient hosting for your website or application.