Live data from Hacker News

How I built this website on a Raspberry Pi

mirawelner.com

31–40 of 94 posts

Re: How I built this website on a Raspberry Pi

#31
post #29
post #25

I like how the author didn’t try to be overly clever with it. They could’ve used Docker to install and isolate dependencies, Caddy or Traefik to serve the site and manage SSL automatically, maybe even k3s to run a mini cluster for HA, Tailscale to avoid manual port forwarding, Terraform for future auto-provisioning without hassle, or Ansible to prepare the machine and all that jazz. Instead, they took the simplest po…

> installing the web server on bare metal, On top of a Linux distro is not what people usually call bare metal

I've heard it called bare metal as opposed to a docker container or VM.

Re: How I built this website on a Raspberry Pi

#32
post #29
post #25

I like how the author didn’t try to be overly clever with it. They could’ve used Docker to install and isolate dependencies, Caddy or Traefik to serve the site and manage SSL automatically, maybe even k3s to run a mini cluster for HA, Tailscale to avoid manual port forwarding, Terraform for future auto-provisioning without hassle, or Ansible to prepare the machine and all that jazz. Instead, they took the simplest po…

> installing the web server on bare metal, On top of a Linux distro is not what people usually call bare metal

I found that today "bare metal" is used equivalent to "non-cloud". I think this is pathetic.

Re: How I built this website on a Raspberry Pi

#33
post #22

Regarding private keys and computers going in for repairs... I know it's not strictly best practice but store your private key in your password manager. That way if the worst happens you aren't up a creek...

At least encrypt your private key and store it somewhere private, and then store the decryption key in your password manager. Then if either one is compromised you are still safe.

Re: How I built this website on a Raspberry Pi

#34

After using nginx and caddy for some time I can't fathom going back to apache config files.

Caddy is pretty good! Nginx does feel quite similar to Apache2 if you don’t try to do too much mod_rewrite.

To be honest, you can have both good and bad configuration in either.

I recently migrated one stack from Nginx to Apache2 (where an Nginx container would refuse to start when it was a reverse proxy for say 10 services and one of those took longer to start meaning that it had no DNS records, so Nginx would be in a restart loop and the other 9 would be unavailable) and it was fine.

Re: How I built this website on a Raspberry Pi

#35
post #29
post #25

I like how the author didn’t try to be overly clever with it. They could’ve used Docker to install and isolate dependencies, Caddy or Traefik to serve the site and manage SSL automatically, maybe even k3s to run a mini cluster for HA, Tailscale to avoid manual port forwarding, Terraform for future auto-provisioning without hassle, or Ansible to prepare the machine and all that jazz. Instead, they took the simplest po…

> installing the web server on bare metal, On top of a Linux distro is not what people usually call bare metal

Maybe it is, these days? As much as I appreciate all the functionality brought to us by these tools, when I started web-dev circa 2005, LAMP (Linux, Apache, MySQL + PHP) was the go-to for hobbyists.

As much as I look back at the simplicity (Apache config was not that difficult for a small site, at least with Apache 2.0), the part of me that operates production software these days gets anxiety the idea of it all.

And yet, when I wrote a small website to host my wedding website last year, it was indeed Linux, (some webserver), Postgres and PHP, with me copying files manually to FTP. It was probably nginx but you know what, I paid a company £50 for a large amount of storage, bandwidth, a domain and SSL certificate, for year, and everything went dandy. Horses for courses and all that.

Re: How I built this website on a Raspberry Pi

#36
> Step 5: Getting an HTTPS Certificate

If you’re using Apache2 you might also want to look at mod_md, not just certbot: https://httpd.apache.org/docs/2.4/mod/mod_md.html

Also, if you want to minimize the amount of JS, then just drop jQuery and use fetch, it’s reasonably pleasant too: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API

Lovely article!

Re: How I built this website on a Raspberry Pi

#37
post #16

Curious how well Caddy would run on an RPi. Not sure if it would come out ahead of Apache in practice. It's been my goto choice for a few years.

I'm running a small Caddy + Rust (Actix Web) service on my Raspberry Pi 2B. Not the snappiest service ever but usable. Part of the slowness might also be the fact that it's online using Cloudflare Tunnels.

What is Cloudfare Tunnels? Is this for not applying a firewall rule in the home router?

Re: How I built this website on a Raspberry Pi

#40
post #37
post #16

Earlier quoted context omitted.

I'm running a small Caddy + Rust (Actix Web) service on my Raspberry Pi 2B. Not the snappiest service ever but usable. Part of the slowness might also be the fact that it's online using Cloudflare Tunnels.

What is Cloudfare Tunnels? Is this for not applying a firewall rule in the home router?

https://developers.cloudflare.com/cloudflare-one/connections...

Basically, you can have a computer available online through Cloudflare without having to open any ports, as it makes the computer available through outbound connections. Should also make it possible to host behind CGNAT.

Post reply on HN