I wanted to know if there was a neat playbook or tutorial set that one can refer to if they’re trying to set up their own static website from home?

So far I have done the following:

  1. Got a raspberypi (Raspberry Pi 2 Zero W) and raspberrypi OS installed with fail2ban ready.
  2. Installed nginx (I have not configured anything there).
  3. Written the HTML and CSS files for the website.
  4. Purchased a domain.

How do I complete the remain pieces of this puzzle?

My purpose: I want an online profile that I can share with my colleagues and clients instead of relying on LinkedIn as a way to connect. Eventually, I will stop posting on LinkedIn and make this my main method of relaying information and disseminating my works and services.

  • @vegetaaaaaaa
    link
    English
    14 hours ago

    Sometimes you need to understand the basics first. The points I listed are sysadmin 101. If you don’t understand these very basic concepts, there is no chance you will be able to keep any kind of server running, understand how it works, debug certificate problems and so on. Once you’re comfortable with that? Sure, use something “simpler” (a.k.a. another abstraction layer), Caddy is nice. The same point was made in the past about Apache (“just use nginx, it’s simpler”). Meanwhile I still use apache, but if needed I’m able to configure any kind of web server because i taught me the fundamentals.

    At some point we have to refuse the temptation to go the “easy” way when working with complex systems - IT and networking are complex. Just try the hard way first, read the docs, and if it’s too complex/overwhelming/time-consuming, only then go for a more “noob-friendly” solution (I mean we’re on c/selfhosted, why not just buy a commercial NAS or use a hosted service instead? It’s easier). I use firewalld but I learned the basics of iptables a while ago. I don’t build apache from source when I need to upgrade, but I would know how to get 75% there - the docs would teach me the rest.

    • @[email protected]
      link
      fedilink
      English
      14 hours ago

      I get your point in general, but I think some points are odd.

      For example, Apache overly complicates a simple task. A web server is simple, the only moving parts in a web request are:

      • TLS - mostly just a cert pair and some config if you want to restrict what clients to support (security concerns)
      • HTTP headers
      • URL routing

      You can learn the details of HTTP in about 15 minutes on Wikipedia, whereas you probably won’t get past the introduction in Apache docs in that time. It’s like learning to drive on a big rig with double clutches. Why do that if you don’t need to?

      With a typical self-hosted setup, you can keep it simple and only have your webserver handle the first and pass the rest on to the relevant service. You’re unlikely to need load balancing, malicious request detection, etc, you just need to trunk TLS and route things.

      You’re not gaining anything by learning a complex tool to accomplish a simple task.

      I’m a developer and I’ve written tons of web servers, and I see zero point in apache or even nginx for a home lab setup when I could (and have) write a simple reverse proxy in something like Go in about 30 minutes. It’s easy, handle TLS and HTTP (both built in to standard library), then send it along to the relevant service. It’s probably easier to build that than learn nginx or Apache syntax.

      There’s certainly more to it if you consider high load systems like in an enterprise, but the average home user doesn’t need all that.

      Caddy does everything I need:

      • renew Let’s Encrypt certs
      • proxy based on subdomain

      I’ve done it the hard way, and I don’t feel like I gained anything. Everything involved is simple:

      • TLS - keypair; server needs both, clients just need the pub key
      • HTTP - one line with HTTP verb, URL, and version, then lines with headers as key/value pairs (to route, you only need the URL)
      • renewals - most will copy paste an acme client invocation anyway

      I’ve done it “the hard way” by scripting up cron and configuring Nginx, but what’s the value of learning that when your web-server can do it automatically for you? Gate keeping?

      I agree in general that people should learn how things work. Learn what TLS, HTTP, and whatnot are and do so you can debug stuff. But don’t feel obligated to learn complex software when you just need something simple.

      In other words, YAGNI: You Ain’t Gonna Need It. Or KISS: Keep It Stupid Simple. Don’t copy paste “magic” Apache or Nginx incantations from the internet, use something simple and focus on learning fundamentals.