Friday, November 30, 2007

Installing a home server

One of the things that I am the most proud of in my technical life has not been anything I have done at work (though there is quite alot of stuff I have done at work that I am proud of). Nope, one of the most things that I am proud of is my home server. There is alot of talk about Windows Home Server , but in my opinion, this kind of implementation is just the tip of the iceberg. It's a file server, a glorified NAS box. My home server fulfills many roles like:


  • webserver

  • ftp server

  • shared media drive

  • NAT router (yes router)

  • firewall

  • video encoder (from command line no less)

  • WiFi AP

  • streaming music server

  • remote bittorrent downloader

  • mail server

  • group ware server

  • database server

  • DNS Server

  • DHCP Server



My server fulfills all of the roles above, and can be remotely administered through ssh. The entire thing runs on commodity hardware. In fact it runs on a nearly seven year old Celeron 1GHZ with 384Megs of ram and a 17GB and 120GB hdd. That, combined with an Ethernet switch, is one powerful little network. Regardless of being a "home" server, learning how to build and use one can teach principles of large servers and corporate networks. You can even expand to include other servers and have your own little cluster.

When building a server like this, first, ask yourself WHY you want to build it. What do you need it for, what do you want it to do, are there better alternatives? Before you ask, "because it would be cool and I can learn all sorts of things" IS a perfectly viable answer as to why you want to build your own server. What you want it to do however, is something you want to spend more time on. You should try to plan a little bit for this. What role is this machine going to fulfill? Is it going to just be a firewall/router? Then perhaps m0n0wall is for you. Just an NAS device? Try Freenas . For versatility and growth however, you may want to stick with a full OS like Linux or FreeBSD . It's even possible to use some versions of Windows.
In fact, my server started as a windows 2000 server and it ran great for a few years. I'd recommend using one of the *nixes, because I find them more robust for a server, and keep in mind, even if your desktop clients are all Windows, you can still use Linux or BSD for your server. They do play nice together with a little work.

In subsequent weeks, I will take a look a closer look and give more of a how-to for setting up some of the particulars of home servers, but I'd like to make some reccomendations here on what to decide in the planning stage.

One, decide how you are going to interact with your server on a regular basis. You will most likely need a mouse, keyboard, and monitor when you set up your server, but one of my goals was to have a box that was a mere appliance, and that meant headless. All administration on my box is done remotely through SSH. I can do this from work or from my home desktop. The caveat about this is that you really need to learn how to use the command line and command line tools. But you CAN load the Xorg gui or using windows remote desktop. You are going to want to keep your box running efficiently though, and you will find that graphical interfaces take up more overhead than most of you are going to want.

Two, decide what sort of hardware you are going to run on. Even Windows 2000 can run on some pretty thin hardware. FreeBSD and Linux headless machines can run on almost a pocket calculator (ok well not THAT thin, but you will be surprised). The processing power and memory are not the only considerations. Do you want to run RAID to handle your files? How much storage are you looking at? Will you have a separate drive for the operating system than you do for storage? If you are running as a router, you will need at least two network cards. If it's also going to be an access point, you will need a compatible WiFi card. Is it going to be in a little box in the closet, or will it be on your desk? How far away are you going to be running? Do you need to run Ethernet cables? Do you want to upgrade your network hardware to gigabit speed? I personally find that 100Mbps is fine for serving video and audio, but you may want to run multiple clients and feeds. Do you have plans to backup your data on an external drive?

Three, try and figure out some of the roles that your machine will be performing? Do you already have a hardware firewall/router? Do you need a DNS? Do you want to keep everything static, or use DHCP? Do you understand the basic theory behind IP addressing, subnets and NAT? Are you going to need a database for anything (if you plan on running php web pages, the answer to that is yes)? Is it going to be on all of the time? How are you going to secure the system or your shares?

Fourth, there are some miscellaneous considerations to think about. What kind of internet connection are you going to use? How is your internet connectivity? When I first set up my servers, my ISP had blocked incoming ports 80 and 25, which are the standard web server and mail server ports. I had to run both of those services on non-standard ports. See I learned something almost right off the bat. Then there is a time factor to be considered. My server grew and evolved over time to the machine that it is now. Don't try to do everything at once. It can take quite a while to install the various things on the machine. Give yourself time. Remember, this is a project. If you need this to be a mission critical machine, you may want to familiarize yourself with commercial server technologies. This is also beyond the scope of this article.

So get prepared, think about what you want, and next week, I will give a step-by-step guide to setting up a Windows based server, and for the two weeks after that, we'll look at using Fedora and FreeBSD for a similar purpose. I'm splitting the open source version into two weeks worth, and since many of the princples are the same for FreeBSD and Linux.

No comments: