Is there a good alternative to github pages? I need just a static website up.

  • I have a domain.
  • I have my site (local machine)
  • And that’s all I have.
  • I have a machine that could be running 24/7 too.
  • K3CAN@lemmy.radio
    link
    fedilink
    English
    arrow-up
    8
    arrow-down
    2
    ·
    23 hours ago

    I’m guessing you want to selfhost, rather than use a hosting service?

    When you say you have your site already, do you mean it’s hosted on a local webserver, or just that you have the files?

    If it’s just the files, you’ll need to choose a webserver. I like NGINX myself, but lighttpd is another option (there’s quite a few options, really, but sticking to a well known option is generally more secure).

    Configuration will depend on the server you choose, but then you’ll put the files into three “root folder” used by the webserver. This isn’t the system root ( ‘/’ ), but a different folder specified as the root of your web page, usually ‘/var/www/html or /srv/www/html’.

    Once the files are in place, you can test the site by using the web browser on another PC and entering the local IP address of the server. If everything looks good, you can set up port forwarding on your router to forward public port 80 to port 80 on the local server.

    Lastly, you will need a DNS provider which will point your domain to the IP address of your router. Assuming you have residential service, you will need to determine whether your IP address is static or dynamic, or if your ISP is utilizing CGNAT. Depending on those factors, you may need to do some additional setup.

    Once it is working, your next step will likely be to set up SSL and port forwarding on 443. That will allow your website to be accessed over https, which is the standard for the modern Internet.

    I have hosted my own website and a blog for a while, and there are definitely some additional steps I would recommend to take, but the above is your basic starting point.

    • iveseenthat@reddthat.comOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      5 hours ago

      This is what I was looking for! I have the files and currently I am serving it locally with python -m http.server.

      The part that I don’t understand is how to make it available to the world.

      How do I check the characteristics of my ISP? Do I just call them? I just use the internet in a shared setup, I am not the account owner.

      To setup port forwarding, do I need access to my router, right? Coz these guys just “installed the box and left it there” I cannot login to it.

      thanks!

      • K3CAN@lemmy.radio
        link
        fedilink
        English
        arrow-up
        3
        ·
        3 hours ago

        Python’s webserver is meant to be a quick option for testing, and shouldn’t be used for a publicly accessible website. You’ll want a proper webserver for that.

        You would need access to the router for the port forwarding, so if you can’t access it, you’ll need an alternative option. The next best option is a commercial reverse proxy, most commonly that’s Cloudflare’s “tunnel” product. Essentially, Cloudflare acts as a man-in-the-middle, forwarding from a public address directly to your local server. It’s pretty easy to set up and it takes advantage of common router settings to open ports from the inside, where the router’s firewall rules are typically quite lenient. This also works with CGNAT, so no need to figure that out. The downside is that Cloudflare gets access to all the data that passes through them, even passwords. So if your website happens to have a lot of sensitive data, you’ll need to decide whether you trust them with that data. They do not get access to your normal web browsing or anything, just the data passing between the public address and your local server. Another potential downside is that they prohibit media streaming, so if your website serves a lot of videos, you’ll want a different option.

        Google Cloudflare tunnels homelab and cloudflared for more info. There’s a bunch of YouTube videos and tutorials on setting it up. It’s not perfect, but it’s a free and easy way to selfhost from a limited network environment.