如何在ec2-instance Linux(Apache Web Server)上安装Certbot SSL?

时间:2019-10-17 10:16:07

标签: amazon-ec2 ssl-certificate lets-encrypt

当我尝试在ec2-instance linux(Apache Web服务器)上安装Certbot时遇到了这个问题。我已经安装了PuTTY(用于访问实例)和WinSCP(用于传输文件)。但是当我运行某些命令时,请参阅AWS指南,它显示如下错误:

Exiting abnormally:
Traceback (most recent call last):

File "/opt/eff.org/certbot/venv/bin/letsencrypt", line 11, in <module>
      sys.exit(main())

File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/main.py", line 1378, in main
      return config.func(config, plugins)

File "/opt/eff.org/certbot/venv/local/lib/python2.7/site- 
      packages/certbot/main.py", line 1133, in run certname, lineage)

File "/opt/eff.org/certbot/venv/local/lib/python2.7/site- 
      packages/certbot/main.py", line 121, in _get_and_save_cert lineage = 
      le_client.obtain_and_enroll_certificate(domains, certname)

File "/opt/eff.org/certbot/venv/local/lib/python2.7/site- 
      packages/certbot/client.py", line 405, in obtain_and_enroll_certificate
      cert, chain, key, _ = self.obtain_certificate(domains)

File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/client.py", line 348, in obtain_certificate
      orderr = self._get_order_and_authorizations(csr.data, self.config.allow_subset_of_names)

File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/client.py", line 384, in _get_order_and_authorizations
      authzr = self.auth_handler.handle_authorizations(orderr, best_effort)

File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/auth_handler.py", line 69, in handle_authorizations
      resps = self.auth.perform(achalls)

File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot_apache/configurator.py", line 2304, in perform
      http_response = http_doer.perform()

File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot_apache/http_01.py", line 76, in perform
      self._mod_config()

File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot_apache/http_01.py", line 111, in _mod_config
      for vh in self._relevant_vhosts():

File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot_apache/http_01.py", line 166, in _relevant_vhosts
      " {0}.".format(http01_port))

PluginError: Unable to find a virtual host listening on port 80 which is currently needed for Certbot to prove to the CA that you control your domain. Please add a virtual host for port 80.

1 个答案:

答案 0 :(得分:1)

我认为错误输出的最重要的一行是最后一行。它告诉您,certbot找不到在端口80上侦听的虚拟主机。我假设您正在使用Apache Webserver。确保您已正确配置服务器。

也许还会发布您的apache配置,以在需要时获得更多帮助。

相关问题