4 ms·
Thanks you for all that! It does look like it simplifies stuff in that there are no more config files! So that's really cool. I will need to read the docs a bi
by geokon 5y ago
Thanks you for all that! It does look like it simplifies stuff in that there are no more config files! So that's really cool.
I will need to read the docs a bit later b/c from the landing page it's all still confusing. This is probably a function of the tech "debt". It has example commands like
caddy file-server --domain example.com
- If it's a file server.. shouldn't it be something like FTP/FTPS? Everything on the webpage keeps saying HTTPS .. which is Hyper Text Transfer Protocol.. ie HTML webpages. So is it serving files or webpages? (I guess webpages are a type of file.. but in practice the two aren't the same)
- Do I need to stick this into my .profile? Or I need to configure a systemd service?
- What is it even serving out..? Is it just serving out everything in the immediate directory I'm in where I run the command?
- How is it "hooking into" example.com? How does the registrar know to point at my IP after I run this command? (or if that's done separately - say on the registrar website, why do you need to specify the URL locally at all?)
In any case, these are just immediate questions that come up. It's all stuff that probably makes sense if you know it already :)
And again.. i need to rtfm - so I'm not complaining or shooting the messenger here haha. Thanks for the info
- alin23 5y agoFile server in this context only means a HTTP(S) server that serves static files (which can be webpages like index.html, but not limited to that). When you run `caddy file-server` in a folder it just starts serving all the files in that folder. You can serve MP3 files if you want, or .txt files, it doesn’t have to be webpages. It just happens to serve them over the HTTP protocol because that’s what the browser speaks. Keep in mind that caddy doesn’t allow a user to get out of the folder you ran the command in, and it also doesn’t allow the user to list the files in your folder if you don’t explicitly allow that using: caddy file-server -browse For example, I use the `-browse` option to allow users to download any previous release of my Lunar app here: https://releases.lunar.fyi https://releases.lunar.fyi The domain option is not for pointing that domain to your IP address. That can only be done from your DNS provider (e.g. Cloudflare, or even Freenom which I pointed in the last comment) What the domain option does is allow you to serve multiple websites on different domains from the same computer, and it also automatically generates SSL certificates for them so that you have encrypted `https:// https://` support by default. A few years ago, you would have had to buy SSL certificates from someone like Verisign, download those certificates, figure out where to put them securely and configure Apache or Nginx to use them for each domain. Caddy does all that automatically now. Also keep in mind that if you run a file server like that: `caddy file-server -domain example.com` … then caddy will only serve those files if you access them using that domain. If you try using your IP address directly, or any other domain instead of example.com, it won’t respond with your files. In this way you could have multiple domains serving different files from the same computer.
- geokon 5y agoWoah - thank you for taking the time to explain everything. It's challenging to find all the info so concisely in one spot. This has been really useful and educational :)