【问题标题】:Error creating apache certificate创建 apache 证书时出错
【发布时间】:2017-12-05 22:46:36
【问题描述】:

我有一个 CentOS 服务器,我正在尝试使用以下命令安装 Apache 证书:

certbot --apache -d myDomain.com

但我收到以下错误:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
Obtaining a new certificate
Performing the following challenges:
tls-sni-01 challenge for myDomain.com
Error while running apachectl graceful.

Job for httpd.service invalid.

Cleaning up challenges
Error while running apachectl graceful.

Job for httpd.service invalid.

Encountered exception during recovery
Error while running apachectl graceful.

Job for httpd.service invalid.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/certbot/error_handler.py", line 100, in _call_registered
    self.funcs[-1]()
  File "/usr/lib/python2.7/site-packages/certbot/auth_handler.py", line 284, in _cleanup_challenges
    self.auth.cleanup(achalls)
  File "/usr/lib/python2.7/site-packages/certbot_apache/configurator.py", line 1945, in cleanup
    self.restart()
  File "/usr/lib/python2.7/site-packages/certbot_apache/configurator.py", line 1834, in restart
    self._reload()
  File "/usr/lib/python2.7/site-packages/certbot_apache/configurator.py", line 1845, in _reload
    raise errors.MisconfigurationError(str(err))
MisconfigurationError: Error while running apachectl graceful.

Job for httpd.service invalid.

Error while running apachectl graceful.

Job for httpd.service invalid.

我检查 Apache 是否正在运行:

ps aux|grep httpd
root     16569  0.0  0.0   9064   920 pts/1    S+   14:44   0:00 grep --color=auto httpd

我没有运行 apache 的实例。

你们中的任何人都知道我该如何解决这个错误或者是否有解决方法?

非常感谢您的帮助。

【问题讨论】:

    标签: apache https openssl centos7


    【解决方案1】:

    certbot 显然正在尝试启动/重新启动 apache,但失败了。这可能有很多原因,我会首先查找 apache 错误日志并查看它的内容。 (可能不止一个,所以请检查时间戳。)

    知道apache是​​否可以启动也很有趣。一个普通的旧 apachectl start 会发生什么?

    【讨论】:

    • 我运行了以下命令。 httpd -k stopapachectl start 之后我运行了 certbot --apache -d myDomain.com 但现在我收到了这个错误:Failed authorization procedure. myDomain.com (tls-sni-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: 有什么想法吗?
    • 听起来 LE 方无法读取您的挑战。这可能是配置文件中的目录错误,文件被某些访问规则阻止,位置从 http 重定向到 https 等。确保您可以使用 curl 从知名目录中获取文件而无需重定向.
    • 怎么能这样?
    • 我“教人钓鱼”的细节是有限度的。阅读 curl 文档(或使用您喜欢的 curl 替代品;wget 可能会这样做)。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-02-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-27
    相关资源
    最近更新 更多