首页 > 解决方案 > 我无法为我的域获取证书

问题描述

我在 Ubuntu Focal 机器上安装 Peertube 服务器,因此遵循官方指南。

在配置网络服务器时,我必须根据需要为我的域生成证书,以使 https 工作,输入以下命令:

sudo certbot certonly --standalone --post-hook "systemctl restart nginx"

但是当我这样做时,会发生此错误:

Error output from post-hook command systemctl:
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.

我想看看会发生什么,但我真的不明白(我还在学习,并且很难做到这一点)。systemctl status nginx.service返回这个:

     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2021-04-12 14:19:47 UTC; 9min ago
       Docs: man:nginx(8)
    Process: 16306 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

avril 12 14:19:47 vc-tvdelyonne systemd[1]: Starting A high performance web server and a reverse proxy server...
avril 12 14:19:47 vc-tvdelyonne nginx[16306]: nginx: [emerg]  cannot load certificate "/etc/letsencrypt/live/tv.virtuacenter.fr/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen:No such file or directory:fopen('/etc/letsencrypt/live/tv.virtuacenter.fr/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
avril 12 14:19:47 vc-tvdelyonne nginx[16306]: nginx: configuration file /etc/nginx/nginx.conf test failed
avril 12 14:19:47 vc-tvdelyonne systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
avril 12 14:19:47 vc-tvdelyonne systemd[1]: nginx.service: Failed with result 'exit-code'.
avril 12 14:19:47 vc-tvdelyonne systemd[1]: Failed to start A high performance web server and a reverse proxy server.

似乎我缺少证书和目录,但我不知道是哪些或为什么会发生。

谢谢 !

标签: nginxcertificate

解决方案


推荐阅读