如何在 AlmaLinux 8 上安装 Certbot

Certbot 是一个客户端,它从 Let’s Encrypt 机构获取SSL证书并自动安装和配置。这消除了手动完成整个过程的痛苦和喧嚣。letsencrypt-ssl-logo

在 AlmaLinux 8 上安装 Certbot

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

sudo dnf update
sudo dnf install epel-release

步骤 2. 在 AlmaLinux 8 上安装 Certbot。

  • 为 Apache 安装 Certbot。

运行以下命令以安装 Certbot for Apache:

sudodnf installcertbot python3-certbot-apache mod_ssl
  • 为 Nginx 安装 Certbot。

运行以下命令为 Nginx 安装 Certbot:

sudodnf installcertbot python3-certbot-nginx

要验证 Certbot 安装,请运行:

certbot --version

步骤 3. 在 AlmaLinux 上安装 SSL 证书。

成功安装后,使用 Certbot 获取 SSL 证书。指定或取决于您的 Web 服务器。也可以使用其他选项,但这是最常见的两种。我们将在本例中使用 Apache:--apache--nginx

sudo certbot --apache

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

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

步骤 4. 配置防火墙。

现在添加防火墙规则以允许连接以及 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 上安装 Certbot

相关文章