我有这个cmd:
sudo certbot --apache -d pushupteam.dev -d www.pushupteam.dev
这是。我得到了什么:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for pushupteam.dev
http-01 challenge for www.pushupteam.dev
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. www.pushupteam.dev (http-01): urn:ietf:params:acme:error:un
authorized :: The client lacks sufficient authorization :: Invalid response from http://www
.pushupteam.dev/.well-known/acme-challenge/j4gaJn6vX6tvEGu0HQagjT69Oc3R7l_VJ8CgaluAnLk [34.
89.161.114]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>40
4 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p", pushupteam.dev (http-01): urn:
ietf:params:acme:error:dns :: No valid IP addresses found for pushupteam.dev
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: pushupteam.dev
Type: None
Detail: No valid IP addresses found for pushupteam.dev
- The following errors were reported by the server:
Domain: www.pushupteam.dev
Type: unauthorized
Detail: Invalid response from
http://www.pushupteam.dev/.well-known/acme-challenge/j4gaJn6vX6tvEGu0HQagjT69Oc3R7l_VJ8C
galuAnLk
[34.89.161.114]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML
2.0//EN\">\n<html><head>\n<title>404 Not
Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p"
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.
我拥有Namecheap的域名,并且我使用Google Cloud dns。
是什么问题?我只对ipv4感兴趣,所以没有AAAA记录;
也禁用了我的ufw(与所有Google VM一样)
编辑:
我的etc / apache2 / sites-available / srv.conf
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/
ServerName pushupteam.dev
<Directory /var/www/html/>
Options +FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/codeigniter-error_log
CustomLog /var/log/apache2/codeigniter-access_log common
</VirtualHost>
我使用Ubuntu 18.04 LTS和Apache
编辑2:
pushupteam.dev. NS 3600 ns-cloud-b1.googledomains.com.
ns-cloud-b2.googledomains.com.
ns-cloud-b3.googledomains.com.
ns-cloud-b4.googledomains.com.
pushupteam.dev. SOA 3600 ns-cloud-b1.googledomains.com.
cloud-dns-hostmaster.google.com.
1 21600 3600 259200 300
www.pushupteam.dev. A 60 34.89.161.114
我应该重新配置我的DNS吗?
编辑3:
在ServerName
之后在Apache配置文件中添加一行;
ServerAlias *.pushupteam.dev
然后重试。
如果不起作用,也将“ A”类型的记录从www.pushupteam.dev
更改为pushupteam.dev
。
为了运行此命令:
sudo certbot --apache -d pushupteam.dev -d www.pushupteam.dev
然后您需要在DNS服务器中添加DNS A资源记录:
pushupteam.dev A 3600 34.89.161.114
注意:请勿为NS记录设置简短的TTL值。通常,这应该是一天(86,400秒)。对于A记录,一小时(3600秒)是正常的。您可以将这些值设置为几乎任何值。考虑性能,缓存超时和成本。
对于Apache配置文件:/etc/apache2/sites-available/srv.conf
添加以下行:
ServerAlias www.pushupteam.dev
并重新启动Apache服务器:
sudo systemctl restart apache2
我假设您通过运行类似于srv.conf
的命令正确启用了a2ensite srv
。通常,配置文件名是主机名。
要仔细检查已启用的虚拟主机,请运行此命令:
apache2ctl -S
确保主机名pushupteam.dev
和www.pushupteam.dev
都响应正常的Web浏览器请求。