Running your own webserver

16 October 2017 7:31 pm

Ticking away in the depths of my cellar, inside a home-built wooden server rack covered in bits of peeling plaster and spiderwebs sits my server; the actual machine being used to transmit this website to your machine. It's not a computer sat in a specially air-conditioned server farm, or some sort of virtual Amazon S3 instance running wordpress. It's a home-managed machine in every sense of the word.

Why would I even go to the effort of keeping my own machine up and running, bothering to buy a giant 4U high UPS, being even more bothered to find a new pair of batteries so the UPS can last for more than 30 seconds when the once-a-year powercut happens? Mostly for the learning process and experience of figuring out how the infrastructure of the Internet works.

Sure, it'd be easier to offload this to someone else, and my power bill would certainly be less but there is a certain amount of nerdy fun in figuring out how to make my server function in a way that - to the rest of the Internet - makes it seem like a Real Server, and not a £150 Core i3 PC plugged into a home VDSL connection. Actually, that's the entire point. It's the actual point of the Internet itself... the only company I rely on for the upkeep of my website is my ISP, and having switched ISPs twice it actually doesn't matter what ISP I have so long as they give me a static IP address. It used to be that anyone could run a website and publish online - except you needed to have someone host the data for you. Now, our home connections are so fast that you really can run your own server - completely. Nobody in the middle.

And that freedom is important in a world where governments are trying to monitor what we do, and where giant data corporations are harvesting our information to build giant advertising-based relation trees. In the 80s we thought Big Brother would be trying to mind control us, it actually turns out they just want to more effectively sell us new TVs and cars. Even dystopian futures are less exciting than we thought. Anyway...

Providing you pay your broadband bill each month, and remember to pay your domain registrar yearly, everything works. Providing you know what to do, that is. And it's a pretty vertical learning curve. I've screwed up so many times doing this, that I'm getting rather good at recoving from screwups, rather than learning how to not make them to begin with. Let's see, what's happened when running this system?

Ah yes, there was the time the hard disk died, that was awkward. Fortunately I had a backup and could recover reasonably quickly. Then there was the time I forgot to pay my domain hosting fee and my DNS entry just dropped off the Internet (and then came back as quickly the instant the PayPal payment went through - the Internet is magic like that). Oh, software needs updating, so yeah... that breaks things, like your carefully crafted config settings and the slightly dubious software stacks that even after 15 years still don't seem to have progressed beyond version 1.0 at the best. The server has been running for about 250 days since last reboot, the next time I restart I'll be stood next to the thing with a monitor plugged into check nothing breaks.

So should you manage to accumulate the skills to beat Apache into submission, and gain enough knowledge of MySQL to find Little Bobby Tables funny it's possible to duct-tape a server together well enough to serve things to spambots and the Google search crawler. Don't leave an experimental installation of Drupal on your machine with default usernames still enabled, that ends in trouble in the form of a rather stern notice from your ISP - "Your machine is sending spam. Please investigate and report back within 48h otherwise we terminate your connection". Was kind of fun figuring that one out, and let me nail shut some tiny holes in the way mail is delivered in my system and my ability to monitor what's going on. Hint - Wireshark is your best friend when "something on your network is sending thousands of emails".

Ah screw it, go sign up for GoDaddy or Wix and make a LEGO-template style website in an afternoon ;-)