Jake Charman

Resident Geek of Nitrous Junkie Racing

Building A Reliable Backup Server From Everyday Parts

Mon 4 Sep 2017

It’s no secret that most of the server work I do is currently on lab networks that are for my own use where downtime has no real implications. However, with university coming up scarily fast I decided to build a backup server to keep at my mum’s house to keep a copy of my work and other files off-site after learning the hard way (during A-Levels) how much losing work sucks.

The first step of the process was choosing the software, I had played with OwnCloud before so naturally leaned towards it for this purpose. However, after some research, I found NextCloud. NextCloud is essentially OwnCloud but with some added features and entirely open source. It has a web interface and mobile app similar to those of Google Drive and Dropbox as well as supporting WebDAV which allows mounting as a remote location in Windows, Linux and Mac. If you want to find out more about what NextCloud does click here.

I had a few requirements for the hardware. The server itself is going to sit in a guest bedroom so it needs to be physically small and has to be quiet. As well as this, it mustn’t be overly power-hungry during day-to-day use. Being a student I also wanted the server to be cheap to build. Thankfully, also being a cross between a hoarder and a nerd, I have plenty of hardware lying around not in use. After some consideration, I chose a Dell Dimension 3100C Dell Dimension 3100C to be the base for the server, mostly due to its small size and distinct lack of fans. My particular machine contains an Intel Pentium 4 running a single core at 3.00Ghz which I stuck with along with the stock Dell motherboard. I did, however, steal 4GB of DDR2 memory out of one of my Lab servers to greatly improve on the 512MB the machine had originally to greatly improve the speed of the machine in tasks vital to its duties such as file handling tasks. I also installed a 1Gbps network card, only because I had one spare, while this will improve performance whilst on the same LAN as the server, my puny British ADSL internet connection is nowhere near fast enough to take advantage of a faster NIC.

Using a machine this old did present some challenges when it came to the final stages of building and beginning to install an OS. The machine is from the days where SATA was still fairly new and for that reason, the motherboard has one SATA port for the boot drive and the DVD drive used is an old IDE variety. I decided to invest in an IDE hard drive from Amazon to act as the boot drive from the server.

If you can avoid this, do. While this approach is fine for now, should that disk fail, I’m going to have an increasingly hard time finding replacements. Another challenge to this is that the machine really doesn’t want to boot from IDE, the cable even has “Optical Only” written on it. However, with enough BIOS tweaking, I did manage to get it booting from the IDE drive. I also bought a drive bay from Amazon to house the SATA drive since the machine is only designed to house one hard drive.

Server with hotswap bayThis replaces the DVD drive with a hot-swap style drive bay. As you can see I’m only using one drive so the drive is not truly hot swappable as it would be in something like a RAID5 array where a dead disk can be removed and replaced with a new one which will automatically rebuild itself. Because of this, it’s crucially important with this setup to keep the bay locked and the keys out of the hands of anyone who isn’t technically minded.

Now that the hardware is built, I can begin to cover the software choices I made. First of all, I decided against virtualization due to the low power CPU and lack of hardware virtualisation features on the old PC. I decided to install Debian which is the OS I tend to default to in my Lab VMs and is the server OS I’m most familiar with. Any Linux distro would’ve worked fine for this purpose. As for the actual backend software, I decided on Apache2 and MySQL, again because these are the tools I’m most familiar with for this purpose. A whole range of similar tools will work.

The NextCloud installer is similar to that of other hosted services like WordPress where you set up the basics manually and the installer guides you through wiring everything up to the application. Some knowledge of web servers, Linux file systems and SQL servers is required but nothing the average person couldn’t Google their way through. For added security, I’ve added an SSL certificate from Let’s Encrypt and have set up CloudFlare to watch for dodgy looking traffic.

Since my ISP provides a dynamic IP and this server needs to be accessible from the internet and not just the local network, I’ve set up a No-IP account and installed the DUC on the server to automatically update the DNS record when the external IP changes.

The server has now been running for about two months and is proving very reliable and very convenient. I’ll go over the use case of the server more when I begin using it at University later this month.