我有一个这样的服务器文件
server {
listen 80;
server_name subdomain.example.com;
return 301 https://$server_name$request_uri;
location /.well-known/acme-challenge {
root /var/www/letsencrypt;
}
}
Run Code Online (Sandbox Code Playgroud)
现在当我尝试sudo letsencrypt renew
. 它抛出并错误说 can't find .well-known/acme-challenge
。但是一旦我评论该return 301
行就重新启动了服务器并且它起作用了。
现在我想重新测试它把位置放在第一位而不是评论返回 301 语句,但它说certificate not due for renewal
。所以问题是读取文件的顺序,重要吗?并且不会因为我这个原因自动更新,那些更新的你如何处理这种情况?
我需要使用虚拟主机配置 nginx。但是当我尝试启动 ngnix 时,它失败,提示进程已在使用端口 80。我如何找出哪个进程正在使用端口 80 并杀死它,以便我可以启动 nginx?
更新:
vehico@metaiot:~$ netstat -tulpn
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp6 0 0 :::22 :::* LISTEN
Run Code Online (Sandbox Code Playgroud)