我正在尝试使用 certbot 为运行 nextcloud(raspi 上的 archarm)的 http 服务器获取证书。当我运行: 时$ sudo certbot --apache
,我得到:
$ sudo certbot --apache
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
No names were found in your configuration files. Please enter in your domain
name(s) (comma and/or space separated) (Enter 'c' to cancel):
然后我输入我的域:example.duckdns.org
我得到:
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for example.duckdns.org
Cleaning up challenges
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.
虽然我确实有这样的example_duckdns.conf
情况/etc/httpd/conf/extra
:
<Directory /var/www/html/nextcloud>
Require all granted
</Directory>
<VirtualHost *:80>
DocumentRoot "/var/www/html/nextcloud"
ServerName example.duckdns.org
ServerAlias example.duckdns.org
ServerAdmin [email protected]
ErrorLog "/var/log/httpd/error_log_example_duckdns_org"
CustomLog "/var/log/httpd/access_log_example_duckdns_org" combined
</VirtualHost>
我得到:
$ apachectl configtest
Syntax OK
我有什么错吗?
使用:Apache/2.4.43
答案1
当然,您/etc/httpd/conf/extra
看起来是正确的,但是您的主 Apache 配置文件(或它包含的任何文件)Include /etc/httpd/conf/extra
是否IncludeOptional /etc/httpd/conf/*
在任何地方都有类似的内容?