I’m trying to run caddy web server v2 for PHP development, How would I define multiple hostnames for local?
I tried to give random name in Caddyfile
When I tried to start.
I’m getting following error
➜ caddy git:(master) ✗ 2020/05/08 22:08:59 [INFO][testhost.com] Waiting on rate limiter...
2020/05/08 22:08:59 [INFO][testhost.com] Done waiting
2020/05/08 22:08:59 [INFO] [testhost.com] acme: Obtaining bundled SAN certificate given a CSR
2020/05/08 22:09:01 [INFO] [testhost.com] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/4451512286
2020/05/08 22:09:01 [INFO] [testhost.com] acme: Could not find solver for: tls-alpn-01
2020/05/08 22:09:01 [INFO] [testhost.com] acme: use http-01 solver
2020/05/08 22:09:01 [INFO] [testhost.com] acme: Trying to solve HTTP-01
2020/05/08 22:09:06 [INFO] Deactivating auth: https://acme-v02.api.letsencrypt.org/acme/authz-v3/4451512286
2020/05/08 22:09:06 [INFO] Unable to deactivate the authorization: https://acme-v02.api.letsencrypt.org/acme/authz-v3/4451512286
2020/05/08 22:09:06 [ERROR] error: one or more domains had a problem:
[testhost.com] acme: error: 400 :: urn:ietf:params:acme:error:dns :: DNS problem: SERVFAIL looking up A for testhost.com - the domain's nameservers may be malfunctioning, url:
(challenge=http-01 remaining=[tls-alpn-01])
2020/05/08 22:09:08 [INFO] [testhost.com] acme: Obtaining bundled SAN certificate given a CSR
2020/05/08 22:09:09 [INFO] [testhost.com] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/4451515366
2020/05/08 22:09:09 [INFO] [testhost.com] acme: use tls-alpn-01 solver
2020/05/08 22:09:09 [INFO] [testhost.com] acme: Trying to solve TLS-ALPN-01
2020/05/08 22:09:18 [INFO] Deactivating auth: https://acme-v02.api.letsencrypt.org/acme/authz-v3/4451515366
2020/05/08 22:09:19 [INFO] Unable to deactivate the authorization: https://acme-v02.api.letsencrypt.org/acme/authz-v3/4451515366
2020/05/08 22:09:19 [ERROR] error: one or more domains had a problem:
[testhost.com] acme: error: 400 :: urn:ietf:params:acme:error:dns :: DNS problem: SERVFAIL looking up A for testhost.com - the domain's nameservers may be malfunctioning, url:
(challenge=tls-alpn-01 remaining=[])
2020/05/08 22:09:21 [ERROR] attempt 1: [testhost.com] Obtain: [testhost.com] error: one or more domains had a problem:
[testhost.com] acme: error: 400 :: urn:ietf:params:acme:error:dns :: DNS problem: SERVFAIL looking up A for testhost.com - the domain's nameservers may be malfunctioning, url:
- retrying in 1m0s (22.809746938s/720h0m0s elapsed)...
When you go to create a new topic and choose the Help category, the template auto-fills into the textbox. Filling out a post without the template means that you deleted it first
As @tweeniev2 said, we’ll need your Caddyfile and some other information too. The template will make sure we get most of the basics covered.
Actually not, As I mentioned on title, I’m trying to create virtual host with multiple names on local for PHP Development purpose, I was trying with any arbitrary name to see how it works and get myself started with CaddyServer
for development purposes either you need a domain to use https or just go with php built-in server or non tls. then for production use php_fastcgi directive.
i basically got 1 domain, i create a subdomain and use it in caddy.
Say, I’ve a microservice in PHP that only accepts HTTPS and runs on HTTPS only.
Using nginx/apache I can create virtual host name and add https. For e.g. random.site and add https with local generated SSL Keys and everything works fine…
Please let me know if it’s possible with Caddy Server as well. If yes, then how would I do that?
I’m sorry if my question was not clear at first
I agree with how Caddy Server works. Also I found that I can work with any public domains as you’ve mentioned above.
Just wondering if it’s possible to setup https for non-public domain like random localhost names: abc.xys. with Caddy
Not extreme use case really, HTTPS default is the way of the internet, so to replicate production usage, it is common sense to replicate HTTPS usage on dev environment too.
If the domain names used aren’t valid domains and only for local dev testing, you can override both server and your PC’s DNS using /etc/hosts file on server and equivalent on your PC depending on OS. That is what I did at Caddy V2 tls internal only work when port 80/443 are free? just needed help with the internal SSL cert setup routine by setting http_port and htps_port for local SSL certs on ports other than 80/443 for my usage on domains on port 81/4444.
So for my virtualbox install, for invalid domains used for local testing, I edited my server’s /etc/hosts and my Windows 10 pc’s C:\Windows\System32\drivers\etc\hosts