Why I Have A Home Server

Home Server
My current HP Microserver and ADSL gateway.

It’s pretty much impossible to use a computer these days without also using the Internet. It’s also pretty much impossible to use the Internet without using a cloud service of some kind. Most people I know depend on cloud services entirely, but not me. There are several good reasons I have my own servers, including my own home server.

It’s a learning experience. This is certainly one for the geeks, but hey, I’m a geek. By running my own servers  I learn about the building blocks of the Internet. I’m a professional systems administrator, and my own home environment is a good place for me to try out things that I don’t get to try at work, or don’t have time to. Part of IT is constantly learning, and that’s what I try to do.

I can run whatever software I want. I’m not limited by whatever Google decides to put into Gmail. I can run my own Exchange server if I want (I do). It may not be free software, but it gives me huge advantages in syncing between devices. If I want to try something out, I just can.

My own privacy is assured. I don’t have to trust my email provider that they aren’t reading my emails or looking through my online backups. I only have to trust myself with my data, and if you can’t trust yourself, who can you trust? I don’t have anything to hide, but I think we should value privacy far more than most people currently do. After listening to Jacob Appelbaum at linux.conf.au in January 2012, I’m assured of this.

I run backups to my own server, and for geographic protection send self-encrypted files to the cloud. I use GPG to encrypt my data, and so should you. I know DropBox and other like services say they encrypt your data so they can’t read it, but how would you ever know?

I will admit that running a home server can be more expensive than trusting the cloud with all my data, as I have to pay for hardware (I spend about $500 a year just on server hardware, but you could spend much less), for power, for a static IP address, and for software licensing (I spend $450 a year here, but with free software I could spend much less).

All in all, running my own home server gives me great satisfaction, confidence in my own abilities, more freedom and more privacy, at the expense of some time (though now it’s up and running, I probably do 10 minutes of maintenance a month) and a bit of cash. Not a bad deal.

Nullshells Networks

About a month or so ago I investigated replacing my extensive collection of virtual private servers, free web hosting accounts, SSH shell accounts, and so on with a single managed server account. The reason for this is that the time taken up with managing these various accounts and servers was starting to chew up more time than the money I was saving.

A couple of friends had free accounts with Nullshells, and had positive things to say, so I thought I’d give them a go. I chose the “Value” ($7 USD / month) web hosting plan based on the number of domains I planned on hosting. All my websites are fairly low bandwidth and low disk usage, so this was the only one of the listed specifications I really cared about.

I have to report that the signup process was fairly simple, and the setup process was completed quickly. The only thing I found slightly confusing was that (for some odd reason I can’t quite fathom), there seems to be a separate user account for the billing system and the system logons. While this doesn’t really matter (I set them both to the same password and just ignore the fact), it does puzzle me.

The web hosting plan I chose gave me access to one of Nullshell’s servers on the East Coast of the USA. I have had no problems so far with the speed of the server, nor with the speed of the connection. I live in Australia (basically the other side of the world), and was getting ping replies in 250msec. Not quick, but that’s not the fault of Nullshells. Transfer, however, was no problem. It fully saturated an ADSL2+ connection I tried a transfer speed test on. I have no doubt it’s a lot faster than that too.

As with all modern hosting plans, a user control panel is included. The one Nullshells uses is called ISPManager, and everything about it is very nice. It’s a lot easier to work with than CPanel, and makes a lot more sense.

As for the actual plan’s features, well, they’re pretty nice too.  $7 a month buys me 1GiB of disk space, 5GiB of data transfers, 10 MySQL databases, and 100 email accounts. As well as that there is the previously-mentioned 5 domain limit. Available for use are PHP, Python, Ruby on Rails and Server-Side Includes. Compared to the larger ISP hosts, this is brilliant value. Even for some of the comparable smaller hosts, it’s still rather outstanding. But there’s one surprise up Nullshells’ sleeve that I haven’t talked about yet.

The service is amazing. I’m yet to have a problem resolved in an unsatisfactory way. The staff are always ready to help. In addition to this (and this is the first time a commercial company has impressed me in this way), I’m asked occasionally if things are working fine and given notice of recent improvements the company has made (I’m interested in such things, which is why they tell me).

Overall, I’m really pleased with Nullshells. For the cost of 3 bottles of Coke a month, I have a web hosting service that’s much more reliable than anything I could do myself, with great service and more features than I’ll ever use. 5 stars.

ExpanDrive for Windows

Recently I found a quite awesome piece of software, and I thought I’d share it with you.

ExpanDrive is basically an SFTP file system driver for Windows. What it does in plain English is turn an SFTP share on a remote computer (say, for instance, my virtual server on the other side of the world) and turn it into a drive letter on my laptop. Like so:

My Computer using ExpandDrive
My Computer using ExpandDrive

This is the first piece of software I’ve found that does this, and does it well enough that I can just click on the drive, click on any file inside the drive, and it automatically copies and opens in the appropriate application. Saving inside the application also works. For instance, I had a word document lying around on my server, so I thought I’d test it out. I opened it up just like a normal file, edited it, saved it, and so on, and it just all worked normally.

The only difference from a local drive or a Samba share is the speed at which things happen. There is a noticeable difference (to be expected, it going over several ADSL connections). Opening a text file took about half to one second, saving it about the same.

The people who make this software say that it’s “rediculously simple”. They are very right, it is. Anybody who has used WinSCP would be familiar with that software’s connection screen. ExpanDrive’s is very similar:

ExpanDrive Main Window
ExpanDrive Main Window

One bug I have noticed is that the drive usage is wrong. I know for a fact my vserver doesn’t have 12TB of storage space available (as shown in picture above). I’m actually using about 30% of 12GB, so I’m guessing they just checked total disk space wrong.

The only downside is to this software is cost. It’s $39.95USD for a single license (a license can be used for multiple SFTP shares). While it’s not a huge amount, it’s more than I’d like to pay for something like this (in my mind, this sort of thing is worth about $20USD). I haven’t bought it yet, I’m still using the trial (which lasts for 30 days). But I think I will.

[ad#post-footer]

Setting up a Home Server on (almost) nothing

There are any number of reasons you might want to set up a home server. Serving a website for cheap may be it. You might want to compile software, or backup your files onto another computer for safe-keeping. Whatever the reason, here’s how to do it.

Assuming you already have an Internet connection, it’s surprisingly easy. First, you’ll need a computer. For a server destined for a single user, you don’t need a lot of processing power (or a lot of RAM). This makes the whole process a lot easier.

The first place I would look is the local computer shop (preferably one that repairs computers). Ask them if they have any spare old computers you could have. Most would be willing to palm off any old computers they have lying around from upgrades (usually their customers don’t want the old computers back) for either free or a very low price. I used to work at a computer store as a technician. We had old computers lying around everywhere. Most of them were working fine. They may not give you the hard drive, but you can pick up one of those for cheap as well.

If you have a friend of family member working in a larger company (especially in an IT department), asking them for a computer might be fruitful. Most larger companies replace all their computers every 3 or 4 years, and as such usually have quite a few old ones lying around doing nothing. You can get amazingly good systems (usually with no faults or blemishes to be seen) if you ask around.

The next place to look would be a tip (or dump) shop. These are places (usually run by charities or co-operatives) that scavenge off the tip face and then sell what they find for incredibly low prices. You might think that all you’ll end up with is a 386 computer that’s been lying in bacon fat for the last month, but you’d be wrong. It’s amazing what people through away. My entire sound system (including high quality (albeit aged) speakers, amplifier, tuner and so on) was picked up at a tip shop for less than $20. All working perfectly.

The final place I would suggest looking for cheap computers (or the missing parts you weren’t able to find from a computer shop or tip shop) is eBay. You’ll be looking for incredibly cheap postage on the items (on computer cases this is a killer), so limit the search to places nearby that allow picking up the item. Don’t get carried away with bidding high for the ‘perfect’ server. Used computers are a dime a dozen on eBay, especially if you live in a more populated city.

Once you have a computer, it’s time to start installing some software on it. For this, you’ll need a monitor, a keyboard, a mouse, and an Internet connection. Once the base software is installed you’ll no longer need the keyboard, mouse or monitor, so you can borrow these from your main computer temporarily if you have to.

First though, you’ll need to get your hands on the software. The up side is that it’s all free. The down side is that there is no support line (though there are thousands upon thousands of sites where you can ask for help from other users). You’ve probably heard of an operating system called Linux (more formally known as GNU/Linux). Server environments are where it shines.

There are hundreds upon hundreds of Linux distributions (collections of standard software packaged up in a particular way). Each one has its own advantages and disadvantages, and I won’t dictate to you which is the best to use for a particular use. That said, there are a few that are worth your first attention. Names such as Fedora, SUSE, Debian and Ubuntu are well-known, and have been around for a decade or more (and as such, can be assumed to not be going anywhere anytime soon). If all you’re going to use your server for is storing files, a particular distribution (technically a different operating system, but the difference for most practical purposes is nil) called FreeNAS pops up. Check this out if all you want is to store files and nothing else.

The installation of most Linux distributions works thus (check the particular distribution’s website for details):

  1. Download an image (known as an ISO) of the operating system installer.
  2. Burn the image to a CD using image-burning software. For Windows, one I particularly like is called IsoRecorder.
  3. Insert the disc into the drive on the server, and turn on or restart the server (whichever is applicable).
  4. The disc will take a few minutes to start up, and after that just follow the instructions on the screen. Note that during the installation process the machine will probably want to configure network access. It’s best to already have the server connected to your modem or router before the installer starts.

After the installer is finished, you’ll end up with a bare server, ready for more software and configuration to take place. Read the manual of the distribution for details, but in general you’ll want to install some or all of the following software:

  • SSH. I recommend installing this so you can access the server remotely over the Internet. Port 22.
  • Apache or Lighttpd. These are web servers. Only install one of them. Port 80.
  • Samba. File sharing with Windows machines.

Note that I’ve listed these things called ‘ports’ in the list above. Why is this? These are configuration changes you’ll need to make to your router in order to let the Internet traffic see your server. If you’re confused, Google ‘port forwarding’ and the model number of your router for instructions.

You’ll also want to set up something called Dynamic DNS, which you can do at dyndns.org. This allows you to use a name to access your server (such as example.dyndns.org) instead of a dynamically changing IP address (such as 218.214.200.21, which can change every 24 hours or so).

There’s a lot to read and understand here, but once you’ve set all this up, it’s likely you’ll have a much greater understanding of how computers, computer networks, and the Internet all work. Oh, and you have a home server.

Building a Network – The Physical Connection

I’ve spent a lot of time creating and fixing computer networks, both professionally (as a computer technician for a local computer shop) and in my private life (long time readers will know of my affinity for acquiring servers). So I thought it might be a good idea (prompted by a suggestion from one of my friends Michael) to give a few tips to those just starting managing small networks. Note: I have no real experience with medium to large-size networks. Some of my advice may still apply (and I have done a bit of research), some of it won’t. I’ll leave it up to the experts in those fields. But here are my tips on physically connecting computers in a small network.

Colour-coded Cables

This is the really big, obvious, thing to do. Whether you colour code for uses (blue for main cables runs, red for patch cables, etc) or for type (blue for Cat5e, red for Cat6, beige for telephone, orange for fibre, etc) doesn’t matter, as long as the cables all follow the same pattern, and you (and anybody else likely to work on the network) can understand the code. I myself code by type, as I believe it will be useful in allowing me to see if I need to upgrade cable in the future. I *could* go through and read the writing on all the cables, but in a darkly-lit room or under-floor cavity, this is a lot harder than looking for a colour.

It pays to remember that most network cable that comes in large rolls is blue Cat5e or Cat6, and to allow for this when designing a colour code system.

Labelling things

Once a network gets past a certain size (of about 2 or 3 network devices, not including client machines) it becomes important to have a good labelling system in place. It doesn’t really matter what this system consists of. I used to use masking tape and a felt-tip pen, and I now use a Dymo labelwriter (not purchased specifically for the job, but it does it brilliantly). As for what I label and what the label says:

  • On network cables (of all sorts) I generally label each end with where the other end connects. So on the switch end of network cables, I write which device the cable connects, usually using a hostname (like “router” or “lounge-pc”).
  • On network devices (such as routers) I usually label the device with its IP address, and if it is unlikely to be seen by visitors, also the password to access the device. Writing down the password on the device may seem like a bad idea, and can be in some situations, but it does save headaches. For most home or small office networks, the most likely threats to network security are likely to be hackers on the Internet, not those inside the building with access to the devices.
  • On client machines (and servers) I write the hostname and the IP address (if statically assigned) on the front of the machine. Most people are unlikely to have enough computers that they can’t remember which one is which, but occasionally it does happen, especially when developers such as those writing operating systems need test beds for as many pieces of hardware as they can.

Naming Machines

Give all machines a decent, understandable name. If you’re only going to have one of something in your house, name it after the function. I used to have ‘server’, ‘lounge-pc’, ‘jack-laptop’ and so on in my house. If you’re going to have more than one server or one lounge PC, there are a couple of ways of going about it:

  • Pick random names following a theme. I’m now using planet names for servers and moon names for desktops, and my network router is called Sol.
  • Build up a name for the machine using a standard pattern. In this case, ‘pc273-1’ might mean the 1st PC in room 273. It’s more useful for large numbers of computers.
  • Something else entirely.

This isn’t really related to the physical network, but it does have an influence, and is important to get right. Changing it can be a bitch for larger numbers of computers.

Get a rack!

Once you get past two or three routers, modems or access points (or whatever it is you have than doesn’t stack well), in my opinion it’s time to start looking at rackmounting some of the equipment. Face it: if you have this much stuff, it’s unlikely that you’re ever going to have less of it. So best figure out a way to keep it all neat and tidy. A solution to this problem has been available to the masses for a few years now, thanks to the wonders of eBay.

It’s possible to buy the rackstrip and bolts you will need online, and then build the enclosure yourself. For all the cases where you only need a single rack, I’d recommend going this way. You’ll end up with a custom solution that the right size for your needs, and it’ll end up cheaper (trust me). Just remember to add a bit more space than you need now, for any future expansion. It’s not cheaper if you have to build it anew every 3 months.

A note: it is possible to make the rackstrip yourself as well, but unless you are very skilled with metal and drill presses, I wouldn’t bother. It’s too much of a time investment.

A rack allows you to keep all your networking equipment in one place, and hide it out of the way. You can even buy shelves to put non-rackmount equipment on. If you want to rackmount your servers too, go for it. A decent 2U or 4U ATX rackmount case is not a lot dearer than a decent tower ATX case. More expensive, granted, but not by a lot once you consider quality.

Doing things properly

If you’re reading this article, chances are you’re interested in networking. And if you’re interested, make it enjoyable. To make it enjoyable, do things properly. Why? Because doing them a second time is a lot less enjoyable. I took the time to run the network cables from my switch through to most rooms in the house under the floor, and used proper terminators and wall blocks at each end. Compared to the alternative (stringing cables through the house, fastened down with duct tape) it’s a lot better to look at, and less things can go wrong. Apply the same to all areas of networking.

Patch panels and the like

If you’ve already got a rack (or are now thinking about getting one), think also about getting a patch panel. It allows you to bring all the cables from areas of the house into one area of your rack, which you can label and keep track of.

Conclusion

Those are pretty much all the things I’ve kept in my head as I built my network. I’d love to hear more of your suggestions on what to do and consider as your network goes. If you’d care to leave abuse for me suggesting the use of an expensive rackmount setup, that’s also fine (but one day, you will think the same).