sorry for making a topic which it’s uncomfortable for anyone would help me.
I have never understood how caddy works since I have experience with Apache 2 and I’m thinking to replace HTTP service with Caddy.
It only worked that I typed “Caddy” with config files and it returned 404 not found
The biggest issue I was unable to do sudo "setcap cap_net_bind_service=+ep ./caddy"
Failed to set capabilities on file `./caddy’ (Invalid argument)
The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file
Anyway, is there a guide how to get started with Caddy and DigitalOcean with hosted domain?
First you’ll want to be root. In your terminal type: sudo su now the prompt will show root@.
Type caddy -version and see if it can find and show you the version you run. If it shows the version you can skip the installation step.
If its not installed download caddy and move it to a nice location like this. curl --silent --show-error --fail --location --header “Accept: application/tar+gzip, application/x-gzip, application/octet-stream” -o - “https://caddyserver.com/download/build?os=linux&arch=amd64” | tar --no-same-owner -C /usr/local/bin/ -xz caddy && chmod 0755 /usr/local/bin/caddy
curl https://getcaddy.com | bash
Next type whereis caddy. This will tell you the installed location of caddy. If you installed as above then it will show: caddy: /usr/local/bin/caddy
Now you can type: setcap cap_net_bind_service=+ep /usr/local/bin/caddy. Notice the last part is the place where caddy is located on your system. In the documentation example that is ./caddy (in the current directory).
^ That’s pretty good (thanks @slightfoot!), although I’d recommend curl https://getcaddy.com | bash to install Caddy instead of that much longer chain of commands; this one command will put Caddy into /usr/local/bin for you.
Im really curious how to activate domain with caddy like apache 2, I added IP hostname to domains in digitalocean. I will let you know what are errors.
The default port when you launch caddy is 2015. Instead you can specify port :80 HTTP in your configurations and :443 for HTTPS. I specify the port numbers because I’m old like that but these formats also work.
index.html should load by default. But it looks like you don’t have one in the root that you specified http://138.68.18.179:2015/index.html Perhaps you should check the permissions/ownership on the files. You can run cd /var/www/powerupware.com && ls -l and put the results in your next post if you want more help with that.