8 ms·
Am I the only one who still hosts my own static sites on a plain old virtual machine? It's pretty simple to configure nginx for static sites, and by doing it y
by NateEag 7y ago
Am I the only one who still hosts my own static sites on a plain old virtual machine?
It's pretty simple to configure nginx for static sites, and by doing it yourself you reduce vendor lockin to just about nil.
Even if S3 is massively cheaper, $5/month for a tiny VM seems like a small price to pay for being vendor-abstract.
I suppose S3 is way less likely to suffer a meaningful outage than my little VM, but how many 9s do my personal websites actually need?
- mevile 7y ago> you reduce vendor lockin I don't know why anyone cares about vendor lock in. It's either trivial to move an aws lambda to a google cloud function because you don't have a lot going on, or it's not trivial to move stuff from even your own servers to other servers because it's under huge load and you have considerable amount of data you'd have to migrate under complex conditions. Moving around is either hard or easy based on things that don't really have anything to do with vendor lock in.
- codegladiator 7y agoNo, vendor lock in can mean a lot, from lets say even a simple plain API implementation, where one vendor might implement something(storage for eg) in a way where its not possible for the other vendor. I recently moved one of my k8s cluster from gc to aws, even terminology change can introduce a lot of awkwardness.
- shshhdhs 7y agoI disagree with encouraging people to do this. You are not accounting for a CDN here, like the post. A website on the HN front page went down yesterday on a $5 VM. And S3 just holds your HTML files, for super cheap. There’s no lock-in concern there. You can easily migrate to nginx in the future if you really want, but start with S3
- danpalmer 7y agoHN won't take a static website on a $5 VM down if it's set up even remotely correctly. Traffic to a popular link on HN is likely to get on the order of ~100rps max (more likely 1-10rps). Nginx will handle that with no problem. CDNs may make a site a bit faster, but for a static site it's unlikely to make much difference if you're on a good host in US/EU or central Asia. If you're hosting in Australia or Japan, maybe it might be a little slower than expected, but still totally usable.
- tyre 7y agoCompletely agree. I think many people here regularly work on larger web applications in dynamic languages with heavy JS front-ends piling on dependencies. Nginx is unbelievably fast by itself, not to mention the optimizations that are completely unnecessary for a static blog. It's not going to be your blocker. If you're serving up 20MB of JS and inlined images on each page load, yeah, you may want to rethink that. But we don't need to get wild. My homepage is 9.2KB. Longer blog posts (e.g. [1]) can clock in at 20KB. HN won't take that down. [1] https://maddo.xxx/thoughts/what-the-hell-are-you-doing.html https://maddo.xxx/thoughts/what-the-hell-are-you-doing.html
- type0 7y agoNot to mention that most VPS providers to even speak about nowdays use SSDs For a personal site who the heck even needs a CDN, the only reason I might use that if I put photography website with huge shots or if there's a bunch of videos as well.
- tty2300 7y ago
- tomschlick 7y agoPutting Cloudflare in front of a VPS is pretty simple and gives you the same result so long as you are sending the correct cache headers.
- herbst 7y agoI have front paged on HN and Reddit several times. Often 'only' using 5$ vms. However i was using cloudflare or at least nginx and proper caching settings. I run several hundred dollars monthly of infrastructure but my websites are nearly all on a simple VM for about 20€/month on Vultr right now. Web hosting only is expensive when people run badly optimizer infrastructure
- pushpop 7y agoIf it’s a static site and you own the domain then vendor lock-in isn’t really a problem regardless of if you use cloud services or not. Because you can just dump those files on a different provider and change your DNS entry. It’s not even remotely the same level of complexity as other services when people normally talk about vendor lock-in.
- tyre 7y agoyes. I host my personal website (maddo.xxx) on a single EC2 instance with just nginx. It's easy. It's fast. When I want to over-engineer the shit out of it for fun, it's ready. Deploys? One line of `scp` scp -r -i ./certs/maddoxxxnginx.pem ./app/* ubuntu@13.52.101.21:/var/www/maddo.xxx/ (that deploy script just bulk uploads everything, but that's fine for now. The whole site is measured in KB.)
- WhiteOwlLion 7y agoThere are some low end VPS providers too that go as low as $1/mo. I usually stick to $2/mo or higher just for stability, reliability. Even you even got hosts like Hetzner Cloud, Scaleway (see European hosts) that provide great service, bandwidth, and VPS. I don't know why people use Amazon... I don't find their value proposition very good unless you need dynamic scaling for unpredictable demand.
- mises 7y agoThat last unless is what the value prop is. Personal site is indeed just fine on a cheap vps (and I can also put up the occasional file), but AWS has better reliability and much better scaling. When you consider the opportunity cost of time, AWS can come out cheaper.
- clintonb 7y agoMaintenance is my primary concern. I deal with software for a living. I want my blog to just work without me having to worry about maintaining the VM. Netlify makes this dead simple. I used to host Wordpress sites for myself and family members. I've now moved nearly all of those sites to Netlify (for hosting) and Forestry (for editing/CMS). I no longer have to worry about malicious hacking attempts, Wordpress updates, or anything else outside of the site content. Here is my post on this transition for those interested: https://dev.clintonblackburn.com/2019/03/31/wordpress-to-jekyll/ https://dev.clintonblackburn.com/2019/03/31/wordpress-to-jek....
- ehonda 7y agoapt-get install nginx goaccess cd website cp * /var/www/html Yearly maintenance required: apt-get update, apt-get upgrade View traffic stats: goaccess -f /var/log/nginx/access.log I'd say its just as easy and seamless to do it yourself on a cheap VPS for a static website. HTTPS isn't that much extra work either.
- clintonb 7y agoThat's great that you have enough time and experience to consider all of this easy. As someone who works a bit higher up the stack, I rarely go as deep as configuring Nginx. This setup may take you a few minutes, but I usually end up spending an entire Saturday on stuff like this. Having done this for a few years, I would rather spend my free time on other things.
- mises 7y agoMaybe I'm just a security nut, but I would probably also relegate ssh to a non-default port, allow key-only authentication, narrow ciphers, close all other ports (except 80, 443, and 53). Also fail2ban, sysctl tweaks (networking, disable coredumps), and a whole bunch of other things I have in a script. I've seen way too many people get their boxes trashed to leave an internet-accessible one exposed and unsecured.
- KingFelix 7y ago
- jakelazaroff 7y agoHow is there vendor lock-in for static websites, though? Can't you just take your files and go somewhere else?
- NateEag 7y agoYep, you certainly can, which is part of their the beauty. Last I looked, though, you couldn't deploy to S3 without using tools that work specifically with it. I guess it's really not that big a deal, but I prefer the genericness of "I'm configuring a webserver and pushing my files to it." That process can be just about fully automated, even including HTTPS setup if you want that, and then you can use with whatever server provider you like.
- jakelazaroff 7y agoDepends on the tools! If you're manually copying files, there are clients (e.g. Transmit, which is what I use) that just treat it like any (S)FTP server. If you're using the command line, yeah, you need to use Amazon's CLI, although it's still basically a one-liner to sync the directory you want to publish.
- NateEag 7y agoAh, yes, that does make sense. Thanks for explaining. I'm a fairly aggressive automator, so I forget that doing it by hand is actually an option.
- jniedrauer 7y agoI served a static website off nginx from a docker container for a while. At some point there was a breaking change and it would have taken 3 minutes to fix, but I didn't bother. Static hosting is a solved problem and there's not really a reason to do it yourself unless you just want to learn.
- dmitriid 7y agoI’m old enough to serve my static site from nginx running on my server :) No virtual machines.
- wolco 7y agoI do. I'm surprised more don't on hn perhaps it speaks to something bigger.
- Symbiote 7y agoI host my site on Apache running on an ARM board in my garage. I'll consider moving to a VM if/when the ARM board eventually fails, but it's been running for 6 years so far. I have 6TB of storage, which mostly serves as a NAS but includes about 200GB of photos for the website. There is no deployment process; the web root is mounted by NFS on my desktop. I can share large files with people just with "mv" or "ln -s". > how many 9s do my personal websites actually need? My router seems to crash every 3-4 months, and I need to reset it. There's around 15-30 minutes of power failure every year. I don't worry about this.
- MarvelousWololo 7y agoSorry about the ignorance but how do you run it from your garage? What about bandwidth? Could you share the url? Also would you recommend me any guide to get started?
- tty2300 7y agoThe usual roadblock in this process is getting ports exposed to the internet. In the best case this can just be done on your router configuration. In the unfortunately common case the ISP blocks you from doing this and the only solution is to change ISP.
- Symbiote 7y agoI've heard of ISPs blocking ports, but not in Europe. I just forward ports 80 and 443 to the server (and pinhole the IPv6 ports) and it's done. The upstream bandwidth is about 60Mb/s, which is fine for almost everything.
- MarvelousWololo 7y agoHow can I do such thing? I'm in Europe as well. Do you have any guide to get me started?
- 7y ago
- klodolph 7y agoI switched from S3 to a $5/month VM a while back and it is massively better.