Over the next few weeks, Leo Maxwell will be
describing how to build and configure various types of server on an Ubuntu base
system. This week he lays the hardware and software foundations
What you need
Load factor: 0.01
Packages required: Ubuntu Server ISO, SSH
Hardware required: PC with optical drive or
USB stick.
Command count: 5
As my day job, I manage a
small but quite complex company network
of around 30 computers, and support our customers in the field. I work on a mixture of Windows, Mac, Linux and BSD systems, as well as devices based on all of
them. So no two days are the same.
![Description: Ubuntu Server](http://programming4.us/image/082012/The%20Ubuntu%20Server%20Project_8.jpg)
Ubuntu
Server
Like most Windows users, I lean towards
graphical tools, even in Linux.
However, these days, the command line and scripting are becoming more common, even in the Windows server world.
I started this project as a sort of personal
training course, determined to force
myself out of my comfort zone and really learn how to manage a server at a low level, and document it along the way as a sort of aide-memoire.
I was surprised by how easy it actually was. I
learned that there are several ways
of using graphical interfaces with a headless box, some of
which you may find surprising, and I ended up with a nice
little home server as a bonus.
The fact that we’re using a headless box means
that the command line is unavoidable.
The tools that we’ll be using are very
powerful, but I will be keeping it to a limited subset for you to get a taster of what they can do, perhaps to
encourage you to experiment further
yourself. I’ll also be posting the commands on the Micro Mart forum (forum.micromart.co.uk), so they can be cut and pasted into a terminal. The command line is
often quicker and more effective than
point and click tools, and in the server world, it’s frequently more reliable.
Why a home server?
There are many types of server that can be
used in a home. This week we’ll be
laying the foundations - the hardware and operating system - but over the coming weeks we’ll look at web
servers, file servers, media streamers,
security managers, etc., all of which can be built on this
foundation, without too much typing.
![Description: My mini server. Unfortunately the piano-black finish makes it quitedifficult to get a good photo. The 23” monitor above it is showing the MythTV menu](http://programming4.us/image/082012/The%20Ubuntu%20Server%20Project_9.jpg)
My
mini server. Unfortunately the piano-black finish makes it quitedifficult to
get a good photo. The 23” monitor above it is showing the MythTV menu
As we go along, you will notice that
components are often reused. Many of
the projects use MySQL, Apache and PHP or Perl. These building blocks are the basic foundations of the World Wide Web, many websites depend on them. All of these
projects will happily coexist on the
same hardware, simply incorporating themselves into the existing software base. For example, installing Zoneminder (a camera manager) on top of MythTV (a TV and media
server) will simply insert the
Zoneminder database structure.
All of these projects have been tested in a
virtual machine as well as on
hardware, and in different configurations, but I cannot guarantee that they will always behave consistently on different distros or hardware.
Step one: Select and assemble the hardware
For the purposes of this series, I will assume
that you have a network (or the
server wouldn’t be much use!) and also a broadband router that gives out IP addresses automatically. This is by
far the most common scenario in the
UK. A 100Mbit network is the minimum requirement for many of these ideas, and gigabit is probably more desirable for some. Older wi-fi and Powerline adaptors tend to
struggle, especially when shifting
large media files around.
This server is intended to sit quietly
somewhere in your home, serving as a
central store for your files and media and, as such, after
initial configuration, it does not require a screen,
keyboard or mouse.
![Description: The interior of the mini-ITX server, showing the motherboard with its passive heatsink (power cable unplugged for clarity)](http://programming4.us/image/082012/The%20Ubuntu%20Server%20Project_10.jpg)
The
interior of the mini-ITX server, showing the motherboard with its passive heatsink (power cable unplugged
for clarity)
A virtual machine was used for initial
testing, and I chose to use a new
mini-ITX PC for my server, but you could easily use a retired desktop machine, because the resources required
aren’t great.
If you want to stream HD video to multiple
machines, a gigabit network is
advisable, and if you want the server to assume some of the more demanding roles, a dual-core processor might be in order.
Obviously, if you want to use it as a file
server, disk space is important, and
as it is going to be on constantly, you probably want a low energy system. The video card, as long as it works long enough for the installation, is unimportant. An optical
drive is useful for installation, and
possibly for ripping media discs to the hard drive, but it’s not essential.
For this series, I used an Intel D2700MUD
mini-ITX board, which has an Atom
D2700 dual-core processor, running at 2.13GHz, with 2GB of RAM and a 500GB SATA disk in a compact case. The total cost was less than $300.
The D2700 has such a low power draw that it
can operate without a fan. The case
does have a small fan, but I found that the processor heatsink only got slightly warm in use, so it could probably be dispensed with.
Step two: Install the os
‘The server OS is the
basic foundation on which the various server roles can be built’
![Description: The Ubuntu installation menu. Perhaps the most exciting screen-shot of the entire article](http://programming4.us/image/082012/The%20Ubuntu%20Server%20Project_11.jpg)
The
Ubuntu installation menu. Perhaps the most exciting screen-shot of the entire article
The server OS is the basic foundation on which
the various server roles can be
built. I have opted for the free Ubuntu Server OS as the base for our experiments, running as the sole OS on a
hard drive, which will be wiped
during the installation. You could use a small SSD for the
operating system and turn over the whole of the hard drive
to storage.
A graphical environment is quite a resource
hungry application, which is unused
on a headless server, so Ubuntu Server is by default CLI only.
‘Using the command line
is far more flexible and gives you an
insight into the system workings that you can never really
get from waving a mouse around’
If you wish, you can follow these articles
with a full Ubuntu desktop installed,
but that increases the resources required and is quite unnecessary, as you’ll see. Some of these tasks might initially seem easier using a GUI, but using the command line is
far more flexible and gives you an
insight into the system workings that you can never really
get from waving a mouse around.
First, we need to download the Ubuntu
server .iso image from tinyurl.com/62tyqf. You can burn it to a CD or install
it on a USB stick. My case does not have an optical drive, so I used
Unetbootin, a tool for creating bootable USB drives. This can be downloaded
from tinyurl.com/pjkp3s, where you can also find instructions for its use.
![Description: The package selection menu, where we need to select the SSH server](http://programming4.us/image/082012/The%20Ubuntu%20Server%20Project_12.jpg)
The
package selection menu, where we need to select the SSH server
Boot from the CD or USB drive on your
target PC, and select ‘Install Ubuntu server’. By default, this will wipe the
hard disk and install a basic server system.
The initial screens ask you for your
location and keyboard type, etc., much like a Windows installation. You
navigate the menus using the up and down arrow keys, select using the space
key, exit a menu with the Tab key, and continue by using the Enter key. Most of
the options will just need you to hit Enter, apart from selecting a UK
keyboard. You will also be asked for a username and password.
Installation time will vary depending on
the speed of your system and your internet connection. On my test PC it took
about 20 minutes.
![Description: The first login screen, from where we can get the IP address](http://programming4.us/image/082012/The%20Ubuntu%20Server%20Project_13.jpg)
The
first login screen, from where we can get the IP address
Towards the end of the installation, after
the base system is installed, you can select from a range of preset packages.
The most important of these to add is the SSH server, which we will use to gain
remote access.
Once installation is complete, you will be
asked to reboot, and then you can log
in. When logged in, you will be able to see the automatically configured IP address of the server on the screen. Mine was 192.168.0.14 (addresses beginning 192.168.
are reserved for ‘private’ networks,
and should not appear on the internet).