无法在亚马逊 linux2 nginx 上安装 certbot [英] cannot install certbot on amazon linux2 nginx

查看:89
本文介绍了无法在亚马逊 linux2 nginx 上安装 certbot的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注 本指南 安装 certbot 并创建 ssl 证书.

I am following this guide to install certbot and create ssl cert.

但是当我运行 wget https://dl.eff.org/certbot-auto 时,错误显示:

But when I run wget https://dl.eff.org/certbot-auto, error shows:

--2021-07-09 02:16:27--  https://dl.eff.org/certbot-auto
Resolving dl.eff.org (dl.eff.org)... xxx.xxx.xx.xxx, xxxx:xxxx:xx::xxx
Connecting to dl.eff.org (dl.eff.org)|xxx.xxx.xx.xxx|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2021-07-09 02:16:27 ERROR 404: Not Found.

如何解决?

推荐答案

  • 来自 https://certbot.eff.org/docs/install.html#certbot-auto
  • certbot-auto 脚本 "不再支持."

    certbot-auto script " is no longer supported. "

    Ubuntu 上的解决方案示例:Cerbot + Nginx:

    Example of SOLUTION on Ubuntu : Cerbot + Nginx :

    **install snapd**
    
    sudo apt update
    sudo apt install snapd
    

    在机器上的命令行执行以下指令,确保您拥有最新版本的snapd.

    Execute the following instructions on the command line on the machine to ensure that you have the latest version of snapd.

    sudo snap install core; sudo snap refresh core
    

    删除 certbot-auto 和任何 Certbot OS

    如果您使用 apt、dnf 或 yum 等操作系统软件包管理器安装了任何 Certbot 软件包,则应在安装 Certbot snap 之前将其删除,以确保在运行命令 certbot 时使用的是 snap,而不是从安装你的操作系统包管理器.执行此操作的确切命令取决于您的操作系统,但常见示例是 sudo apt-get remove certbot、sudo dnf remove certbot 或 sudo yum remove certbot.

    If you have any Certbot packages installed using an OS package manager like apt, dnf, or yum, you should remove them before installing the Certbot snap to ensure that when you run the command certbot the snap is used rather than the installation from your OS package manager. The exact command to do this depends on your OS, but common examples are sudo apt-get remove certbot, sudo dnf remove certbot, or sudo yum remove certbot.

    如果您之前通过 certbot-auto 脚本使用过 Certbot,您还应该按照此处的说明删除其安装.

    If you previously used Certbot through the certbot-auto script, you should also remove its installation by following the instructions here.

    • 安装 Certbot

    在机器的命令行上运行这个命令来安装 Certbot.

    Run this command on the command line on the machine to install Certbot.

    sudo snap install --classic certbot
    

    准备 Certbot 命令在机器上的命令行执行以下指令,确保certbot命令可以运行.

    Prepare the Certbot command Execute the following instruction on the command line on the machine to ensure that the certbot command can be run.

    sudo ln -s /snap/bin/certbot /usr/bin/certbot
    

    选择您希望如何运行 Certbot获取并安装您的证书...

    Choose how you'd like to run Certbot Either get and install your certificates...

    运行此命令以获取证书并让 Certbot 自动编辑您的 Nginx 配置以提供服务,只需一步即可开启 HTTPS 访问.

    Run this command to get a certificate and have Certbot edit your Nginx configuration automatically to serve it, turning on HTTPS access in a single step.

     sudo certbot --nginx
    

    或者,只需获得证书

    如果您感觉更保守,并希望手动更改 Nginx 配置,请运行此命令.

    If you're feeling more conservative and would like to make the changes to your Nginx configuration by hand, run this command.

    sudo certbot certonly --nginx
    

    测试自动续订您系统上的 Certbot 软件包带有一个 cron 作业或 systemd 计时器,它们会在您的证书到期之前自动更新您的证书.除非您更改配置,否则您无需再次运行 Certbot.

    Test automatic renewal The Certbot packages on your system come with a cron job or systemd timer that will renew your certificates automatically before they expire. You will not need to run Certbot again, unless you change your configuration.

    您可以通过运行以下命令来测试证书的自动续订:

    You can test automatic renewal for your certificates by running this command:

      sudo certbot renew --dry-run
    

    如果该命令正确完成,您的证书将在后台自动更新.

    If that command completes without errors, your certificates will renew automatically in the background.

    • 确认 Certbot 正常工作

    要确认您的网站设置正确,请在浏览器中访问 https://yourwebsite.com/并在网址栏中查找锁定图标.

    To confirm that your site is set up properly, visit https://yourwebsite.com/ in your browser and look for the lock icon in the URL bar.

    它有效!享受并捐赠给 Certbot 和 EFF

    It works ! enjoy and donate to Certbot and EFF

    这篇关于无法在亚马逊 linux2 nginx 上安装 certbot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆