Hi,
First off, I’m completely new to Caddy, but loving the simplicity so far. However, for the love of everything I’ve tried, I can’t get this simple set-up to work what so ever. I hope I’m just doing something silly and that this can be solved easily.
On my VPS, I host my applications (websites) in /var/www/<domain_name>/web.
My previous setup was a simple LAMPP-stack with vhost files for all my domains, pointing to the “web” directory as shown in the path above.
How would you do this with Caddy?
I’m running Caddy 0.9.5. (freshly installed today on Ubuntu 14.04 LTS, everything fully updated)
I’m trying to use import
to load a Caddyfile per host, so I’ve tried the following:
# /etc/caddy/Caddyfile
import /var/www/*/Caddyfile
import caddy-php.conf
# /etc/caddy/caddy-php.conf
fastcgi / /var/run/php/php7.1-fpm.sock php
# /var/www/harold.info/Caddyfile
harold.info
root /var/www/_default
tls harold@iedema.me
# /var/www/joii.harold.info/Caddyfile
joii.harold.info
root /var/www/joii.harold.info/web
tls harold@iedema.me
When running caddy, I’m presented with the following error:
2017/04/07 19:05:47 Caddyfile:2 - Parse error: Wrong argument count or unexpected line ending after 'root'
So I thought, maybe I need to put brackets around the directives in each file? In my head, that totally makes sense…
So, I did this for each Caddyfile in each “project”:
# /var/www/harold.info/Caddyfile
harold.info {
root /var/www/_default
tls harold@iedema.me
}
However, now I’m getting this error:
Activating privacy features...2017/04/07 19:07:14 [INFO][fastcgi] acme: Obtaining bundled SAN certificate
2017/04/07 19:07:14 [fastcgi] failed to get certificate: acme: Error 400 - urn:acme:error:malformed - Error creating new authz :: DNS name does not have enough labels
I’m guessing the brackets are parsed “as part of the domain name” ?
I could be totally wrong and just doing something silly…
please help