如何在 AlmaLinux 8 上安装 Let’s Encrypt SSL with LEMP

Let’s Encrypt 是适合您的免费 SSL 选项。Let’s Encrypt 可以通过 Certbot 进行签名,Certbot 是一个免费的开源软件工具,用于自动颁发 SSL 证书。LEMP-linux

在 AlmaLinux 8 上安装 Let’s Encrypt SSL with LEMP

第 1 步。首先,让我们首先确保您的系统是最新的。

sudo dnf update
sudo dnf install epel-release mod_ssl

步骤 2. 安装 LEMP 服务器。

需要 AlmaLinux LEMP 服务器。如果您没有安装 LEMP,您可以在此处按照我们的指南进行操作。

步骤 3. 安装 Certbot。

现在我们安装用于创建 Let’s Encrypt 证书的 Certbot 客户端:

sudodnf installcertbot python3-certbot-nginx

要验证 Certbot 安装运行:

certbot --version

第 4 步:在 AlmaLinux 上安装免费的 SSL Let’s Encrypt。

现在我们使用 Certbot 命令来颁发 Let’s Encrypt 证书。将和替换为您的域名和电子邮件:your-domain.comadmin@your-domain.com

certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email admin@your-domain.com -d your-domain.com

在安装过程中,这将生成一组您需要回答的提示。如果一切顺利,您应该会收到以下消息:

Requesting a certificate for yourdomain.com
Performing the following challenges:
http-01 challenge for your-domain.com
Waiting for verification...
Cleaning up challenges
Subscribe to the EFF mailing list (email: admin@your-domain.com).

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/your-domain.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/your-domain.com/privkey.pem
   Your certificate will expire on 2021-08-25. To obtain a new or
   tweaked version of this certificate in the future, simply run
   certbot again. To non-interactively renew *all* of your
   certificates, run "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

此时,当您使用完 Certbot 后,您可以检查您的 SSL 证书状态。在您的网络浏览器中键入以下链接:

https://www.ssllabs.com/ssltest/analyze.html?d=your-domian.com

test-ssl

步骤 5. 配置防火墙。

现在添加防火墙规则以允许连接以及 HTTP(端口 80)和 HTTPS(端口 443)流量:

sudo firewall-cmd --permanent --add-port=80/tcp --zone=public
sudo firewall-cmd --permanent --add-port=443/tcp --zone=public
sudo firewall-cmd --reload

感谢您使用本教程在您的 AlmaLinux 8 系统上安装 Certbot。如需更多帮助或有用信息,我们建议您查看Certbot 官方网站

未经允许不得转载:统信UOS之家 » 如何在 AlmaLinux 8 上安装 Let’s Encrypt SSL with LEMP

相关文章