
MySQL/MariaDB Installation on Linux Servers (AlmaLinux, Ubuntu, CentOS with SSH)
İçindekiler
Introduction
SSL (Secure Sockets Layer), or more accurately TLS (Transport Layer Security), ensures secure communication between clients and servers. On modern Linux distributions like AlmaLinux 8, enabling SSL is crucial for securing web applications and services. This guide explains how to install a Let's Encrypt SSL certificate using Certbot, and how to configure it on both Apache and Nginx servers.
Prerequisites
Before you begin, ensure you have the following:
-
AlmaLinux 8 system with root access
-
A registered domain name pointing to your server's IP address
-
Apache or Nginx installed
-
Firewall rules allowing ports 80 and 443
Step 1: Install EPEL and Certbot
Certbot is the official Let's Encrypt client. To use it, first enable the EPEL repository:
For Apache users:
For Nginx users:
Step 2: Obtain SSL Certificate
Apache:
Run the following command to obtain and install the certificate:
Certbot will automatically:
-
Obtain a certificate from Let’s Encrypt
-
Edit your Apache config files
-
Reload Apache
Nginx:
If you're using Nginx:
This command will do the same for Nginx: obtain the certificate, modify the configuration, and reload the service.
Step 3: Test SSL Configuration
After the setup:
-
Visit
https://yourdomain.com
in your browser. -
Use SSL testing tools like SSL Labs to check the configuration.
Step 4: Set Up Automatic Renewal
Let's Encrypt certificates expire every 90 days. To renew them automatically, add a cron job:
Add the following line:
This will run daily at 3:00 AM and renew certificates if needed.
Optional: Manual SSL Configuration
If you need to configure SSL manually (e.g., custom virtual host):
Certificate paths:
-
Certificate file:
/etc/letsencrypt/live/yourdomain.com/fullchain.pem
-
Private key:
/etc/letsencrypt/live/yourdomain.com/privkey.pem
Apache example:
Nginx example:
Redirect HTTP to HTTPS
Apache:
Nginx:
Step 5: Check Certificate Status
To verify which certificates are installed and their expiration:
Conclusion
Installing SSL on AlmaLinux 8 is a straightforward process thanks to Certbot and Let's Encrypt. Whether you're using Apache or Nginx, a few commands are all it takes to secure your site with HTTPS. Don’t forget to enable automatic renewal to keep your certificates up-to-date.
Yorumlar