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).

Customizing Windows

I just thought today I might share with you some of the customizations I’ve made to my Windows Vista installation to make it a bit more friendly.

Last week I stumbled upon this blog post from LifeHacker, and I’ve since implemented it’s suggestions fully (click for full size):

taskbar

Basically the idea is to double the size of the taskbar and then create groups of icons for the most commonly used programs. Instead of having to click twice to get into Outlook or PuTTY, I now only have to click once. The hardest part is working out which icons are the best to put onto the taskbar. The image above is missing Notepad2 and Firefox, since I originally left them off. They have since been placed on the taskbar as well.

The instant messsaging client I use is Pidgin, and apart from Skype (which it doesn’t handle), it’s the only IM client I ever use. Since about 50% of my time on my computer is wasted in chatrooms and such, Pidgin has a high importance for me. Thus, I’ve made the Buddy List window dock into the side of my screen, so it’s never behind any other window, even when the other window is maximised. It’s best explained with a screenshot.

What happens is that when the Buddy List is the approximate height of the screen, floating, and is then dragged to either side of the screen (I used to have it on the left), it will snap into place and become sort of a taskbar as far as other windows are concerned. To do this with Pidgin, you’ll have to enable this functionality:

  1. Go to the Tools menu, and select Plugins.
  2. Scroll down the window until you see ‘Windows Pidgin Options’. If it’s not enabled (the tickbox on the left), enable it.
  3. Otherwise, click on it once to highlight it and click ‘Configure Plugin’.
  4. In the window that comes up, click the tickbox next to ‘Dockable Buddy List’, and click Close twice.
  5. You can now drag your Buddy List to either side of the screen and have it docked, ready and waiting to start a new conversation.

If you’re the type that notices such things, you’ve probably noticed that I’m not using the Aero interface (the see-through window effect). And for good reason too. As far as I can tell, all it does is hog memory and CPU, and make my machine very sluggish. Here is a good tutorial on how to do it.

Those are the three biggest changes I’ve made to the user interface in Vista, and all have made me much more productive. If only my laptop had a second screen…

IMAP, Webmail, and the pain of Sysadmin

Last night I succeeded in setting up on my server the IMAP protocol (with the help of my sysadmin friend Hamzah). It turned out not to be too difficult, once I fixed my silly configuration mistake (setting the mail directory to /var/mail instead of /var/spool/mail). I’ve still got a bit of configuration to do, mainly editing a few security settings and such. It seems Debian comes almost configured correctly out of the box. This seems to happen with quite a few packages.

Before setting up IMAP (which is, for those not in the know, an email protocol), I was accessing the mail on my server using POP3. POP3 works well, but only if you are always using the same computer all the time. Since the email messages are stored on the local machine using POP3, it is hard to track them across computers. IMAP stores the emails on the server, and each local machine uses the IMAP server as a reference.

Now that I am using IMAP, I can access my mail from virtually anywhere, without having to drag around my laptop. In the near future, I’m hoping to set up webmail on the server as well. I might even write my own, depending on how adventurous I feel. I mean, how hard can it be?

Review: PreSonus AudioBox USB

Since July last year I’ve owned a nice laptop, and haven’t been using a desktop computer much at all. Laptop computers are great, but as I pointed out in my review of the one I bought, the onboard speakers suck. I can wear headphones with my laptop, which produces quite reasonable sound, but unfortunately wearing headphones all day becomes a pain (literally). So in January I bit the bullet and bought a new external audio interface for my laptop. There were a number of considerations for my purchase:

  1. It needed to sound good (or rather, not sound like anything at all). I have plans to do a bit of audio recording via this hardware, and it is important that as little of my audio equipment as possible taints the sound.
  2. It needed to be portable. Although I don’t often move my laptop outside my bedroom, the option to do onsite recordings would be very handy. This means no external power supply, and no large rackmounted equipment, no matter how sexy it was.
  3. I wanted it to connect via USB. I have all the external devices on my laptop connected via a USB hub, and a single Firewire device would mean a second cable. While true recording engineers might scoff at the idea of putting the sound hardware on the same USB hub as any other device, in practise I haven’t seen any difference, and it sure makes it a lot easier to manage.
  4. MIDI would definitely be a bonus, though with most MIDI controllers today coming with USB connections, this wasn’t crucial. Besides which, I don’t have a MIDI controller, and can’t play the keyboard anyway.

After a bit of research, the two options I found were the Tascam US-122L and the PreSonus AudioBox USB. Both of these interfaces did roughly the same thing, though the Tascam device did not have balanced outputs (although I don’t currently have an amplifier with balanced inputs, I may do in the future). In addition, the Tascam device only had one intrument (high impedance) input, whereas the PreSonus device had two. And the price? The Tascam box was $370AUD, and the PreSonus box $365AUD. After twisting the salesman’s arm, I managed to get the PreSonus for $345AUD, and get a bonus Rode T-shirt and three year warranty as well.

Included in the (relatively small) box were the following contents:

  • The AudioBox USB itself.
  • USB cable.
  • Drivers CD.
  • Cubase LE4 CD.
  • Several installation manuals, one for the drivers and one for Cubase.
  • Some foam.

Close inspection of the front of the AudioBox reveals two inputs on the left hand side, each of which can be used for either a microphone or a instrument input. The power LED and button are in the top right of the front of the device. Also on the front are 5 knobs, two for input gain, one for headphone volume, one for main output volume, and one to mix between computer output and the inputs (in real use, one would expect to keep this set to computer output most of the time). On the rear of the device are found the USB connector, MIDI input and output, two 1/4″ balanced outputs, and a headphone out.

The device itself is quite heavy (around 2.5kg) for the size, mostly due to being manufactured out of large pieces of steel. Negative points for enviromentalism here, but when you’re constantly picking up and moving it, like would be expected from a portable unit such as this, I can see that this is a great idea. I haven’t been game enough to try and scratch the unit, but I don’t think you could ever remove more than a thin layer of paint.

The first thing I can report on is that the drivers for this device suck. I was told by the salesperson in the shop that it would be supported on my Vista x64 machine, and if it didn’t, I could always use ASIO4All. The drivers on the CD don’t support Vista x64. And after a bit of thought I realised that ASIO4All wouldn’t help at all, since I’d need WDM drivers anyway before that would work. In the end I reformatted my machine to use Vista x86, and installed the drivers included on the CD. Unfortunately, those drivers only support ASIO or WDM, but can’t do both at the same time. So I could use iTunes, and that would work, but any attempt to open Cubase would crash the machine. I’ve since downloaded the newer drivers off the Internet, and everything seems to be working fine for the moment. One thing to note is that PreSonus do not digitally sign their drivers. In this day and age, that is a very poor performance.

On to sound quality (which is the most important thing, really). It has to be said I’m very impressed with the audio quality for both recording and playback. There is no distortion of the sound that I can hear (playing back songs I know well, such as Time by Pink Floyd or Boulevard of Broken Dreams by Green Day). I don’t have the equipment to say whether it produces a perfect sound, but then again, that’s relative anyway. As for recording, I’m also quite impressed. There is very little noise added to recording above that from the room I’m in. The converters are obviously quite high quality, and very clear. PreSonus’ specs state a >95dB signal to noise ratio for digital to analog conversion, which is comparable with most devices in this lower-end range.

Summing up, this unit is a mixed bag. I love the features, I love the hardware, but the drivers that come with this machine are utter crap. If you have an older operating system such as Windows XP, I can imagine it would be a bit less painful, but if you own a newer machine running Vista 64bit, I’d consider buying a different audio interface. Once you’ve got that sorted out though, you’ve got a powerful and hard-to-kill unit that performs quite well. 3.5 Stars.