I’m sure this is a typical scenario, but I can’t find the appropriate sequence of steps.
I have an existing www_dot_example_dot_com server at (say) 1.1.1.1 running Apache. I am building a new server at 2.2.2.2 using Caddy. For testing, I put 2.2.2.2 www.[details=Summary]This text will be hidden[/details]example.com in my local /etc/hosts. Once all is working, I will repoint the www_dot_example_dot_com DNS entry from 1.1.1.1 to 2.2.2.2.
The problem is I can’t start Caddy on 2.2.2.2 to serve www_dot_example_dot_com.
I get
[wwwdotexampledotcom] failed to get certificate: acme: Error 403 - urn:acme:error:unauthorized - Invalid response from wwwdotexampledotcom/.well-known/acme-challenge/6Xc4_oq6r0de25CtrYIw59YeVHvUWQ9Ag6H3XbGx8y0:
which I assume is caused by the DNS entry for www_dot_example_dot_com pointing to 1.1.1.1, not 2.2.2.2
So how do I get certs and start Caddy so I can test www_dot_example_dot_com on 2.2.2.2 before updating the public DNS entry?