Lets-Encrypt

尋找讓 certbot 在 Amazon Linux 2 上執行的方法

  • January 16, 2018

亞馬遜推出了一款名為“Amazon Linux 2”的新 Linux

當我嘗試讓 certbot 執行時….

wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
./certbot-auto

給出這個錯誤

Sorry, I don't know how to bootstrap Certbot on your operating system!

You will need to install OS dependencies, configure virtualenv, and run pip install manually.
Please see https://letsencrypt.readthedocs.org/en/latest/contributing.html#prerequisites for more info.

然後我嘗試了:

yum install pip
yum install python-pip
pip install cryptography 
pip install certbot
yum install python-urllib3
yum install augeas
/usr/bin/certbot

我收到了這條資訊

Traceback (most recent call last):
 File "/usr/bin/certbot", line 7, in <module>
   from certbot.main import main
 File "/usr/lib/python2.7/site-packages/certbot/main.py", line 19, in <module>
   from certbot import client
 File "/usr/lib/python2.7/site-packages/certbot/client.py", line 11, in <module>
   from acme import client as acme_client
 File "/usr/lib/python2.7/site-packages/acme/client.py", line 34, in <module>
   import urllib3.contrib.pyopenssl  # pylint: disable=import-error
 File "/usr/lib/python2.7/site-packages/urllib3/contrib/pyopenssl.py", line 50, in <module>
   from ndg.httpsclient.ssl_peer_verification import SUBJ_ALT_NAME_SUPPORT
ImportError: No module named ndg.httpsclient.ssl_peer_verification

我不知道從這裡去哪裡。任何建議將不勝感激!

我也遇到了麻煩,因為 Amazon Linux 2epel-release的儲存庫中沒有,但我發現你可以安裝 EPEL RPM 包本身,然後你就可以安裝certbotcertbot-nginx從那里安裝。

  • 下載 RPM
curl -O http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
  • 然後安裝它
sudo yum install epel-release-latest-7.noarch.rpm
  • 現在您可以安裝 certbot
sudo yum install certbot
  • 然後像往常一樣執行它
sudo certbot

之後查看certbot 頁面以獲取配置詳細資訊。

引用自:https://serverfault.com/questions/890212