Live data from Hacker News

Static site hosting hurdles

notes.volution.ro

161–170 of 183 posts

Re: Static site hosting hurdles

#161

Static hosting on VPS cite is easy as hell. Get a VPS with Ubuntu 22.04 for as low as 3 Euros/Month, execute the following commands: ``` sudo apt-get install -y nginx python3-certbot-nginx certbot sudo ufw allow "Nginx Full" sudo unlink /etc/nginx/sites-enabled/default sudo mkdir -p /srv/https/website sudo chown -vR $MYUSER:$MYUSER /srv/https/website echo "I've created my website here." > /srv/https/website/index.htm…

Yeah but what about SSL? You’ll need a handful of more lines of nginx, plus a script that runs once a month or so to get a new LetsEncrypt cert. Supposing that script you write or copy/paste works, now you’re good. Until your site gets mentioned on HN or other social media. If you are in fact using a 3 euro/month VPS you’re almost certainly sharing 1-2 CPU cores with some other colocated VPSes. If your site gets a su…

> Yeah but what about SSL? You’ll need a handful of more lines of nginx, plus a script that runs once a month or so to get a new LetsEncrypt cert. Supposing that script you write or copy/paste works, now you’re good.

The setup might be a bit more involved, but nothing that can’t fit in a single Bash script.

> Until your site gets mentioned on HN or other social media. If you are in fact using a 3 euro/month VPS you’re almost certainly sharing 1-2 CPU cores with some other colocated VPSes. If your site gets a sudden surge in demand (and particularly if you have any images or video on your site) you’re either going to get hugged to death, or worse, people will complain that your site loads slowly and accuse you of writing too much JS.

An HN “hug of death” is a laughably small amount of traffic for a static file web server. Nginx can serve hundreds of static HTML/JS/CSS files per second even on a cheap VPS.

> My recommendation is to use Github/GitLab pages with a free Cloudflare in front for caching and SSL. That’s the setup I use for my site (https://chrisuehlinger.com, but grumps beware: it is absolutely soaked in JS). It’s free/month, doesn’t require moving parts like a manually rolled LetsEncrypt bot, and holds up when my site gets traffic.

I’m sure that setup works well for you, but it’s overkill for serving static files. Unless you’re a truly special case, literally everything you need can be handled in a single VPS, which is dead simple to manage and very easy to move around if needed.

Re: Static site hosting hurdles

#162

I'd be nice to run a self-hosted site from a home server. Currently paying a third party for a static site, but space is so limited. Storage space isn't that expensive, until you have to pay monthly for it. Mostly just want to host my own pictures. Would really like a hands on workshop to learn to do it (how to get a static IP, setup everything correctly, how to use https).

I do this and have been for years. If you're really interested we could Zoom through it.

Re: Static site hosting hurdles

#163

Earlier quoted context omitted.

Git for static site versioning? Why not just copy the HTML into a new folder? Takes seconds. Zero complexity. Gets backed up with your regular system backups. Git is great for collaborative or complex projects, but for a static site, you're using a freight train to bring a single tomato to market.

Well, even though I can reinvent `git diff` I still don't want to. GIT gives me good diffs and I don't view it as an unnecessary overhead. ¯\_(ツ)_/¯

I'm fairly certain that was a joke

Re: Static site hosting hurdles

#164
I wonder if HTTP exchanges / Web Bundles (from the Web Packaging proposal) would bring the approach of statically generating request-response pairs more to the mainstream.

If I understand correctly, then with both hosting and browser support for Web Packaging proposal, one could even statically pregenerate the whole signed exchange or bundle and skip the server-side TLS part as well.

The whole certificate renewal process will probably make that last part nonviable.

Not considering other potential effects on the web if the proposal gets adopted of course.

Re: Static site hosting hurdles

#165

Quick but important note: for those who don't know already, Volution sells a square space-esque managed site builder with hosting, which means this post does have a minor conflict of interest (although these days I guess it's called content marketing). Haven't seen it mentioned yet in the comments.

[the author here] Where do I sell a "square space-esque managed site builder with hosting"? I need to get on some of that revenue! :) :) :) Under the name of "volution" I own the following: * volution.ro -- where this article was posted, which contains no products or hosting services, or even advertising to anything; (it does contain links to my GitHub projects, all of which are purely open-source; and links to my bu…

Ah, my apologies! This is the one I thought you were associated with; one letter makes a big difference: https://www.volusion.com/

I figured it was one of those "founder-has-a-blog-with-very-similar-name-to-capture-new-users" situations. Nothing wrong with it, just something I feel it's important to be aware of. Sorry for the mixup!

Re: Static site hosting hurdles

#166

Earlier quoted context omitted.

Another DreamHost fan here. I host dozens of hybrid sites on both the shared hosting and VPS and the service is great. My setup is pretty simple, a Perl-based SSG which generates static HTML on-demand if it happens to be missing from the tree. I've had a few minor issues over the years, often self-inflicted, and whenever I use the support panel, I get a helpful human response within an couple of hours, usually with a…

What you're describing is a caching system, not a static site generation system.

It's both, and can run in several different modes.

In dynamic mode, you are correct that the HTML files act as a cache.

In static mode, the on-demand layer (and any related hooks in the web server) are turned off, with all the pages being pre-generated.

There is also a hybrid mode, where the access log (and content store) is scraped for updates and they're integrated into the static HTML on a schedule.

Each of these has its own advantages and drawbacks in terms of security, accessibility, performance, and convenience.

Re: Static site hosting hurdles

#167

Earlier quoted context omitted.

> what's wrong with shared hosting? You answered that yourself: > It costs less than $10/month That’s a lot of dollars for a static website. There are a myriad of free options and there have been for years. Kinda disappointing that they weren’t mentioned. Anyone wanting to deploy a static website knows the big 4, completely free: Netlify, Vercel, CloudFlare Pages, GitHub Pages.

There are still some limits to these (for example Netlify limits the bandwidth you can use each month), but yeah, for most practical purposes the free tier should do just fine. On a side note, I'm wondering if one can host one site simultaneously on e. g. Netlify and Vercel and load-balance those (for example, with round-robin DNS) to stay within free limits for longer.

You could also just throw a CDN in front of Netlify (I do this with Cloudflare) and it will be extremely hard to reach that limit.

Re: Static site hosting hurdles

#168
post #23

Uh what's wrong with shared hosting? I use Dreamhost but there are dozens of others. It costs less than $10/month and I've used it since 2009. I think the industry (or part of a generation of programmers) somehow collectively forgot that it exists. I don't see any mention of it in the article -- it solves the problem exactly. It easily serves and survives all the spikes from Hacker News that my site gets. Shared host…

[the author here] Indeed didn't mention anything about the shared webhosting solutions, just as I didn't mention anything about S3 + CloudFront, or Backblaze B2 + a CDN in front, or Cloudflare + WebWorkers, or AWS Lambda, or any other thousand ways to do it... (Like for example there is https://redbean.dev/ > which I find just so intriguing, and not far from my own https://github.com/volution/kawipiko > proposal.) Al…

The point I was trying to make is that if you want to deploy a professional (as in performant) static web site, just throwing some files in a folder and pointing Apache or Nginx at them isn't enough

Shared hosting is basically where somebody configures and runs Apache or Nginx for you ... they know how to do this, and it definitely works!

Re: Static site hosting hurdles

#169
post #23

Uh what's wrong with shared hosting? I use Dreamhost but there are dozens of others. It costs less than $10/month and I've used it since 2009. I think the industry (or part of a generation of programmers) somehow collectively forgot that it exists. I don't see any mention of it in the article -- it solves the problem exactly. It easily serves and survives all the spikes from Hacker News that my site gets. Shared host…

[the author here] Indeed didn't mention anything about the shared webhosting solutions, just as I didn't mention anything about S3 + CloudFront, or Backblaze B2 + a CDN in front, or Cloudflare + WebWorkers, or AWS Lambda, or any other thousand ways to do it... (Like for example there is https://redbean.dev/ > which I find just so intriguing, and not far from my own https://github.com/volution/kawipiko > proposal.) Al…

> I don't think it's still a common choice for today.

Not true at all. About 37% of the web hosting market is shared hosting. Just do a simple web search for the size of the web hosting services market to find this information. It's one of the 3 most common choices today – and it's always been that way.

Re: Static site hosting hurdles

#170

Are there any static hosts that provide HTTP logs? I know it’s not perfect, but I want to have some sort of analytics without trackers.

You could just use GoatCounter https://www.goatcounter.com/ >; it's simple to deploy it yourself (it's open-source), but it's also free to use it hosted, and it seems to be quite privacy friendly (if one could call a web analytics solution as such). If you are already using CloudFlare, they have a (free and) simple enough web analytics solution. (They say they are also privacy friendly, but given it's not open-source…

I forgot to specify my goal when asking about HTTP logs: I want to get some basic analytics without adding anything to my HTML.

I love Goat Counter, but I still have to add a tracker (a privacy friendly one, but a tracker nonetheless).

Cloudflare looks like it might actually provide what I'm looking for, but the price is a bit too high for my low traffic hobby projects (looks like it starts at $20/month). I could just host my site on a VPS for cheaper than that (although I'd prefer some sort of managed/hosted offering under $10/month, if I can find one).

Post reply on HN