4 ms·
If opening the 80/443 port is such a nuissance in your setup, I would not bother with hosting from home and I'd just drop the website folder in Netlify Drop (ht
by alin23 5y ago
If opening the 80/443 port is such a nuissance in your setup, I would not bother with hosting from home and I'd just drop the website folder in Netlify Drop (https://app.netlify.com/drop https://app.netlify.com/drop)
That's what I did for the first few iterations of https://lunar.fyi https://lunar.fyi and it really helped with giving people the right information fast while I could keep spending time on the real work (developing the Lunar app)
But if hosting from home is what matters the most, there is an easier way nowadays using Caddy (https://caddyserver.com https://caddyserver.com) and ngrok (https://ngrok.com https://ngrok.com).
For example, I just hosted this website (https://af62-2a02-2f0e-d00f-e100-f513-b43-fbc1-cf5d.ngrok.io https://af62-2a02-2f0e-d00f-e100-f513-b43-fbc1-cf5d.ngrok.io) using the following commands:
caddy file-server -listen 0.0.0.0:6001
ngrok http localhost:6001
If you want to go the extra mile and have a nice custom domain, Freenom provides you with a 1-year free domain for the following TLDs:
.gq .tk .ml .cf. ga
For example, I just registered geokon.gq for 1 month and forwarded it to the ngrok endpoint: http://geokon.gq/ http://geokon.gq/
- CraigJPerry 5y agoHey - awesome work on that lunar page, i know it's a landing page and the goal is conversion but it was genuinely enjoyable to read, fun even. Fantastic.
- alin23 5y agoWell thanks! Lately I’ve been afraid of the page becoming too information-dense because there are so many features and edge-cases I need to let people know about. I’m really glad to hear that from you!
- geokon 5y agoThanks 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 :)