8 ms·
Speaking as someone who hosts multiple websites, email, etc. in the corner of a room > [it should] be reliable if I kick a cable out of the wall Right, if you
by lucb1e 4y ago
Speaking as someone who hosts multiple websites, email, etc. in the corner of a room
> [it should] be reliable if I kick a cable out of the wall
Right, if you want it to be reliable but also be able to cut its cables, then you will need a secondary host outside the home.
> or in the unlikely event that I get a bunch of traffic.
Are you serving media (music or video of more than a few seconds)? If not: DSL or mobile data (if your data cap allows) is fine for HN front page. Judging by the current page weighing 100KB, you can have 10 visitors every second at 1 MiB/s upload. (HN reaches that rate only in spikes, even at a top three position.)
> I’d also like it to be quick!
It's currently not quick at DigitalOcean (2 seconds for TLS setup, 12 seconds for HTML, 8 seconds for JavaScript, etc... 27 seconds total). It can only get better!
I can recommend something beefier than a raspberry pi, though, or at least than than the pi 1-3 speeds that I'm used to. I personally use an old laptop which is plenty fast for, well, anything you'd also ask of a daily driver, except it now doesn't need to render a GUI which speeds things up a lot. They can peak up to 100W depending on the model, but are usually very low power when nothing is being asked of them.
> Oh, and I don’t want to have my home network hacked.
Then install unattended-upgrades, put admin panels (phpmyadmin, wp-admin) behind basic authentication, don't host things you don't trust (random code written by 'someone on the internet' that has never been tested by anyone), put it in a VLAN if you want to be extra cautious, and you'll be fine. It never hurts to keep your phone and other systems on the LAN up-to-date anyhow so they should be secure as well, even if someone does get in.
- adhoc_slime 4y agoPretty much! As engineers we all sweat sleepless nights mulling over five 9's and we conflate these valid business needs with our hobbies and personal art/projects. It doesn't have to be this way! Put it on a pi and have fun, if not for your sanity at the very least do it for your second most valuable resource, your time. If all a person wants to do is have a website that plays a piezo buzzer when someone visits on your RPi, just write that damned code, they shouldn't feel the need to worry about all the nitty gritty when all that they wanted to do is have fun!
- marginalia_nu 4y ago89.9999% has five nines too, just sayin' ;-)
- BizarroLand 4y ago0.99999% as well
- NaturalPhallacy 4y ago~3.65 days of a year. I suspect a lot of small projects nail this.
- ohgodplsno 4y agoHey, that's my Raspberry Pi when I find this one thing that looks fun, try it out and give up a few days later. Extremely efficient uptime, it's 100% when i need it.
- imhoguy 4y agoLook how much electricity we would save if many unused servers would turn on only when users actually need them. We need WoL via browser. https://en.wikipedia.org/wiki/Wake-on-LAN https://en.wikipedia.org/wiki/Wake-on-LAN
- RealStickman_ 4y agoYou mean spinning up resources as needed? I think I've heard of some services like that...
- marginalia_nu 4y agoThat's more like billing resources as needed, rather than actually spinning them up. The resources are always spinning.
- 4y ago
- iso1631 4y ago> I personally use an old laptop which is plenty fast If connected on wifi to your router this of course solves the "kick a cable out" problem too, even if the battery is really old you'll almost certainly still have a few minutes. > Then install unattended-upgrades, put admin panels (phpmyadmin, wp-admin) behind basic authentication I'd go as far as protecting the directory to only allow access from local network, and use wireguard to reach the machine. It's likely a server in the corner of the room will cost more than a VPS, certainly in my country. A server drawing 25 Watts cost more than the $3/month I pay. (That said I also have a pihole running on a 1B - my parasitic house load is about 100W for the fridge, router, wifi, etc)
- LeifCarrotson 4y ago> I'd go as far as protecting the directory to only allow access from local network, and use wireguard to reach the machine. Or, you know, only allow access from the attached hardware and reach the machine the old-fashioned way: By walking. Regarding costs, it's useful to know the cost of a watt: For my electric rates, the equation runs: $0.11/Watt-month = $0.162/kWh x 730 hours/month / 1000 kilowatts/watt So at least in my area the 25W server would not quite cost more than $3/month.
- makapuf 4y agoI roughly equate 1W ~ 1$ / year, a bit more now.
- lucb1e 4y agoI thought I had made a mistake when I calculated the cost of 100W incandescent lighting to be the awfully coincidental number of almost exactly 100€/year. Finding this to be correct was quite the revelation: makes estimating the cost of anything in the house so easy because I already knew the wattages :) (The landlord had installed these sensor-activated ancient bulbs in the hallway, where I pass through to to the cellar / power meter, and I was trying to track down this mysterious 100W that seemed to be always running, without fail. Turns out, it was only running when I was checking the meter! We then did the math with a better runtime estimate and still went out to buy LED bulbs at our earliest convenience. They're brighter than before (we erred on the high side), just as warm light, and use 2.5x less power.)
- shadowgovt 4y agoHow did you solve the problem of getting a stable mapping from DNS name to IP address? For me, that's the big challenge; all I have is home internet on a dynamic IP provided by one of the big cable monopolies in the US.
- quest88 4y agoddns tools like noip.
- belval 4y agoHere are several things that you can do (from more to less affordable): - Setup public IP updating. You server runs a daemon that updates the DNS record automatically. You can do that with NameCheap. ($) - You can pay 5$ to have a digital ocean droplet that acts as a reverse proxy that just forwards traffic to your real server. ($$) - You can pay for "entreprise" service and get a static IP. ($$$)
- HuwFulcher 4y agoYou can use something like dynamic dns updaters[0]. They run on the box and when they detect that your ISP has changed your IP will update the DNS records accordingly. [0] https://github.com/timothymiller/cloudflare-ddns https://github.com/timothymiller/cloudflare-ddns
- mdorazio 4y agoMost ISPs offer a static IP address as an add-on or higher-cost service. Might vary depending on where you live, though.
- jvolkman 4y agoDynamic DNS as others have mentioned. Or, many ISPs will provide static IPs for an additional cost, but you may need to switch to their business service.
- pak9rabid 4y agoPersonally, I host my DNS with dyn.org, and use something like ddclient (which runs on my Linux firewall/router) to update my DNS records with Dyn in the rare event it changes. I've never had issues with it.
- pak9rabid 4y agoI second the isolated VLAN approach. I host all my public-facing sites in a VLAN specifically made for that, which grants no access to anything private.
- bonestamp2 4y agoI third. I've got our computers and phones on one VLAN, everything else is on a separate VLAN (streaming boxes, cameras and other smart home crap, guest devices, etc).
- znpy 4y agoI did but a /slightly/ more expensive but web-managed switch with the precise idea of playing with vlans... Needless to say, I never "found time" to actually do it :) One day I will. In the meantime, could you please drop some links to some good introductory pages ? Thanks!
- bonestamp2 4y agoI'm using a ubiquiti managed switch and three ubiquiti access points. Basically, you setup VLANs in the Unifi management software and then you can assign ports on the switch and Wi-Fi profiles to a particular VLAN. From there, any device that connects to one of those ports or wi-fi networks will use the assigned VLAN. The access points are great because you can create several wi-fi networks and then the software provisions them to how ever many access points and switches you have, so you don't have to login to each one and set them up separately. Any links I sent would be specific to Ubiquiti, but happy to do so if you plan to use their hardware.
- Melatonic 4y agoOld laptop at your own place + second old laptop at a home lived in by family or friend would probably work great for this. Hell now I want to try this with two old but decent android phones - they would sip power and have a built in UPS and would blow a RPI out of the water speed wise. Throw a USB-C to Ethernet adapter on each and setup for HA (or if you were really lazy just a simple round robin DNS setup). Put one at a friend house and have them both setup with the free Cloudflare proxy thing and you would not even need to open any ports on your firewall.
- benplumley 4y agoThe problem with using old phones is that the battery swells up after a few months left continuously on charge. You could extend the life using Tasker and a smart plug, but you'd lose a lot of the UPS's potential.
- BatteryMountain 4y agoOld phones don't get security/kernel/driver updates, careful...
- Haegin 4y agoTo solve the redundancy problem I wonder if running something like Hashicorp's Nomad on a few raspberry pis split across some friends houses could work nicely. Each site gets hosted at multiple houses for redundancy but no one person needs multiple devices.
- lucb1e 4y agoNot familiar with Nomad; how does that work under the hood? Do you proxy all traffic through this third party who then load balances with a regular old http proxy, or is it actually self-hosted by the set of friends? With multiple DNS A records, this shouldn't work (it'll just fail in 1/N cases if 1 of the N IPs is down), so I'm curious how this is different from just hosting with Hashicorp directly.
- acaloiar 4y agoEach friend's Nomad "client" (a node in the cluster) would accept a "job" which is the HTTP server. The missing piece is communicating back to some authority which clients are running the service, and on which ports. This could be done with DNS SRV records. Most commonly, Consul is used for DNS in a Nomad cluster. This article is likely to give you a good idea of the architecture: https://developer.hashicorp.com/nomad/tutorials/load-balancing/load-balancing-haproxy https://developer.hashicorp.com/nomad/tutorials/load-balanci...
- lucb1e 4y agoSo if I understand it correctly, this haproxy they suggest is the new central point of failure? Sorry for being skeptical but I'm not really understanding the advantage.
- joeblubaugh 4y agoYou can also run multiple haproxies with identical config. One machine goes down? Your existing proxies still balance load to jobs.
- Manu40 4y agoHi there. I have a R-pi vs 2, and I'm wondering how well you think that would hold up for a basic blog site. It doesn't need to be super fancy, but I would like it to at least be a little nicer looking and just a little more complex than for example Ycombinator. Is this worth while to do? I'm concerned about using a pi, because micro-sd cards seem to be notoriously bad for corrupting data in less than ideal power situations.
- joeblubaugh 4y agoYou can always plug in a spinning disk. I used an RPi Model A to stream HD video off an HDD for around a year and it worked just fine. Keep an image of your SSD in case it gets corrupted and you need to reinstall.
- Manu40 4y agoOkay, so forgive me if this is a dumb question, but I thought the R-pi 2 requires the OS to be on the micro-sd to boot and can't use USB or PCI adapter connected drives?
- violetsy 4y agoIt's possible to keep just a bootloader on the SD card, and have everything else on USB storage, so if the SD fails the data is safe and you just need to set up the bootloader again.
- joeblubaugh 4y agoYes, that’s true. What I was suggesting: * put the OS on the sd card. * Put all the data on an external drive that is more reliable. * Take a snapshot image of the sd card when setup is complete. If your sd card is ever corrupted you can use the image to restore the server.
- Manu40 4y agoOh, okay. Thanks.
- selcuka 4y ago> I can recommend something beefier than a raspberry pi, though, or at least than than the pi 1-3 speeds that I'm used to. Thin clients are perfect for such tasks. More powerful than a Pi, fanless, uses little power, and comes with a proper network card. Second hand HP T620s are cheap.
- Gasp0de 4y ago> Then install unattended-upgrades, put admin panels (phpmyadmin, wp-admin) behind basic authentication, don't host things you don't trust (random code written by 'someone on the internet' that has never been tested by anyone), put it in a VLAN if you want to be extra cautious, and you'll be fine. Also default security measures such as disabling root login via SSH, disable password login via ssh, use fail2ban (also works for wp-admin and the likes!), install/use firewall and only open services which you want to access from the outside.