![](/img/trans.png)
[英]After Redirecting tomcat to open in apache port 80 unable to access phpmyadmn
[英]How to fix Cerbot error 'Unable to find a virtual host listening on port 80' after Apache Update?
我最近將 Apache 從 2.4.6 更新到 2.4.5x。
certbot renew --dry-run
告訴我 Apache 沒有監聽端口 80來自/var/log/letsencrypt/letsencrypt.log
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.
2022-04-27 13:00:18,010:ERROR:certbot._internal.renewal:All renewal attempts failed. The following certs could not be renewed:
2022-04-27 13:00:18,011:ERROR:certbot._internal.renewal: /etc/letsencrypt/live/co2-avatar.com/fullchain.pem (failure)
但是我的 apache 配置中有一個<VirtualHost>
,其中包含所有請求的域作為ServerName/ServerAlias 。 我用netstat
仔細檢查了 Apache 正在偵聽端口 80。
這是配置文件:
# redirect everything from http to https
<VirtualHost *:80>
DocumentRoot "/var/www/html/"
ServerName co2-avatar.com
ServerAlias sustainable-data-platform.de
ServerAlias co2-avatar.de
ServerAlias co2-avatar.eu
ServerAlias co2-avatar.org
ServerAlias co2avatar.com
ServerAlias co2avatar.de
ServerAlias co2avatar.eu
ServerAlias co2avatar.org
ServerAlias git.sustainable-data-platform.org
ServerAlias gitlab.sustainable-data-platform.org
ServerAlias hp-cockpit.com
ServerAlias hp-cockpit.de
ServerAlias hp-cockpit.eu
ServerAlias hp-cockpit.org
ServerAlias hpcockpit.com
ServerAlias hpcockpit.de
ServerAlias hpcockpit.eu
ServerAlias hpcockpit.org
ServerAlias stop-fossil.de
ServerAlias stop-fossil.org
ServerAlias stopfossil.de
ServerAlias stopfossil.org
ServerAlias sustainable-building-platform.com
ServerAlias sustainable-building-platform.de
ServerAlias sustainable-building-platform.eu
ServerAlias sustainable-building-platform.org
ServerAlias sustainable-data-platform.com
ServerAlias sustainable-data-platform.eu
ServerAlias sustainable-data-platform.org
ServerAlias sustainabledataplatform.com
ServerAlias sustainabledataplatform.de
ServerAlias sustainabledataplatform.eu
ServerAlias sustainabledataplatform.org
ServerAlias test.co2avatar.org
ServerAlias test.hp-cockpit.org
ServerAlias wp-cockpit.de
ServerAlias wp-cockpit.eu
ServerAlias wp-cockpit.org
ServerAlias wpcockpit.eu
ServerAlias wpcockpit.org
<Directory "/var/www/html/">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog "/var/log/httpd/webServer-error_log"
CustomLog "/var/log/httpd/webServer-access_log" combined
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !\.well-known/acme-challenge
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
RewriteCond %{REQUEST_URI}.\.well-known/acme-challenge
(來自此處)可能有問題,但我該如何調試呢? certbot或letsencrypt是否有更詳細的日志文件。
當運行renew
或當我想將一些域添加到我的證書時,我確實沒有在我的 Apache 日志文件中看到任何訪問。 所以我不確定,我在這里做錯了什么以及如何檢查,他們這邊實際發生了什么(模擬更新 sustainable-data-platform.org 和 40 個以上域的現有證書)。 當我在我的機器上運行curl -v -X GET http://co2-avatar.com/.well-known/acme-challenge
時,情況有所不同。 為此,我至少得到了一個 301 以及我服務器上 Apache 日志文件中的一個條目。
在 Apache 4.2.53 中使用certbot是否還有其他提示?
嘗試啟用您的站點,然后嘗試重新安裝證書
sudo a2ensite [站點配置名稱]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.