I've just recently started setting up my own Ubuntu v16 server on 100tb.com. I'm using Caddy to serve my webpages and give my website an SSL certificate for https
. I've installed the Cloudflare version of Caddy on set up and have everything configured according to this article. I have a friend who walked me through setting up Cloudflare so I'm certain it's configured right as well.
The error I'm getting when I restart Caddy is:
caddy[14965]: Activating privacy features...2018/01/17 17:10:18 CloudFlare credentials missing
And then Caddy enters a failed state and my website will not show up. I've tried many things. I've manually put the CLOUFLARE_EMAIL
and CLOUDFLARE_API_KEY
into my environment
file. I've used both env
and export
to add the credentials to my path variable. When I run echo $path
they show up in my path (maybe I put them in wrong tho?). When I run echo $CLOUDFLARE_EMAIL
it prints it out to the command line like myemail@example.com
and same for echo $CLOUDFLARE_API_KEY
.
I've looked at Caddy's documentation and other people's questions but none had the answer. I'm not sure why I keep getting this error, I feel like I've done everything correctly. Thanks in advance for any help/insights you have.
Here is my CaddyFile:
www.example.com {
root /var/www
gzip
log /var/www/access.log
errors /var/www/errors.log
tls {
dns cloudflare
}
}
I fixed this by editting the caddy.service file under /etc/systemd/system/caddy.service
adding Environment=CLOUDFLARE_API_KEY=xxxxx
and Environment=CLOUDFLARE_EMAIL=xxxxx
below the already existing Environment=CADDYPATH=xxxxx
and did a sudo systemctl daemon-reload
followed by sudo systemctl restart caddy
. Running sudo systemctl status caddy.service
shows caddy is running and successfully obtained a ssl certificate, making my website https.