本文介绍了Certbot更新:nginx:[错误] open()"/run/nginx.pid";失败(2:无此类文件或目录)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Certbot和Nginx版本:

Certbot and nginx versions:

certbot.

  • Certbot版本:0.22.2
  • Nginx版本:1.10.3

获得ssl证书可以正常工作:

Getting ssl certificates works fine:

certbot --nginx

但是,在cerbot认证的续签中

But, in renewal of cerbot certificated

certbot renew --dry-run

nginx无法开始导致:

nginx fails to start causing:

nginx: [error] open() "/run/nginx.pid" failed (2: No such file or directory)

nginx: [error] open() "/run/nginx.pid" failed (2: No such file or directory)

我尝试更改/etc/letsencrypt/renewal/*com.conf/

  • 评论installer=nginx
  • 将身份验证器更改为nginx和独立

/etc/letsencrypt/renewal-hooks/pre//etc/lestencrypt/renewal-hooks/post/中添加post和pre挂钩,以停止和启动nginx服务.

Adding post and pre hooks in /etc/letsencrypt/renewal-hooks/pre/ and /etc/lestencrypt/renewal-hooks/post/ to stop and start nginx service.

似乎nginx无法正常启动或未正确停止.续订完成后,nginx失败,并显示(code = exited,status = 1/FAILURE)

Seems nginx is not starting properly or isn't stop properly.after renewal completes nginx fails with (code=exited, status=1/FAILURE)

Nginx错误日志显示:

Nginx error log show:

certbot续订时出错:

Error while certbot renew:

推荐答案

我在Ubuntu 16.04上遇到了相同的问题

I had the same issue on Ubuntu 16.04

我刚刚删除了/etc/letsencrypt/renewal/*.conf中的post和pre挂钩,并将身份验证器更改为nginx-我有两个条目standalone.

I've just removed post and pre hooks in /etc/letsencrypt/renewal/*.conf and changed authenticator to nginx - I had in two entries standalone.

现在可以正常工作了.

推荐的方式以更新续订config将使用以下命令重新颁发新证书:

Recommended way to update renewal config is to reissue new certificate using:

certbot -i nginx -d example.com -d www.example.com certonly

这篇关于Certbot更新:nginx:[错误] open()"/run/nginx.pid";失败(2:无此类文件或目录)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 03:24