The Ubuntu installer makes it easy to do a clean and minimal server setup.
The Debian distribution has a well-deserved reputation as being extremely well suited for use in the datacenter, and Ubuntu builds on that by providing simplified installation and official commercial support, making it ideal for mission-critical server deployments.
Minimal Installation
A good principle when building servers is to install as few packages as possible, minimizing the number of things that can go wrong as well as the potential for security flaws. The Ubuntu installer offers a special "server" mode that makes it simple to create a basic server platform onto which you can install the software you require.
Before you perform the actual installation, boot up the server and enter the BIOS setup screen. Because servers typically run without a monitor attached, you will need to find the BIOS setting that tells the computer which errors it should consider fatal and make sure it won't fail on a "no keyboard" or "no monitor" error. The actual setting varies depending on the specific BIOS, so consult the manual for your computer or motherboard if necessary.
Save the BIOS changes and then boot the computer from the Dapper install CD, but don't proceed with the usual installation procedure. If you get a graphical menu, select Install a Server; otherwise, type server at the first prompt. Then, go through the installation procedure. This will give you a minimal selection of packages installed on the system. The server-mode installation doesn't include X or any services at all, giving you a clean platform to configure as you see fit.
One of the first services you will want to install is probably SSH, allowing you to use a secure shell to "Administer Your Server Remotely"
Static Network Configuration
You may have a DHCP server on your network already, in which case your server has been assigned an IP address, but most servers need to have static addresses assigned so they can be found on the network.
Open /etc/network/interfaces (as root) in your favorite editor and find a section that looks like this:
# The primary network interface
auto eth0
iface eth0 inet dhcp
The dhcp argument tells Ubuntu to use a DHCP server to assign the configuration to this interface, so change it to a static configuration and specify the address, netmask, and gateway (router) addresses. Here's an example:
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.0.3
netmask 255.255.255.0
gateway 192.168.0.1
You can now manually force networking to restart with the following command, but be warned that if the static address you have assigned the server is different from the current address, any SSH sessions will be dropped. You will then be able to log back in at the new address:
$ sudo /etc/init.d/networking restart
UPS-Triggered Shutdown
A uninterruptible power suppy (UPS) will keep your server running during a short power failure, but batteries don't last forever, and you risk corrupted filesystems if the batteries go flat and the server stops abruptly. Connect your server to your UPS with a null-modem serial cable and install a program to monitor UPS status and begin a clean shutdown in the event of a blackout. Different brands of UPS have different communication methods, and there are a variety of UPS-management packagesincluding genpower, apcd, apcupsd, powstatd, and nuteach of which supports different types of UPS. If you run multiple servers on a single UPS, then nut (Network UPS Tools) is a good choice because it can initiate a shutdown of all your servers at once via the network:
$ sudo apt-get install nut
The exact setup process will depend on your UPS type, so start by looking through /usr/share/doc/nut/README.Debian.gz for general background information, and then look at the example configurations in /usr/share/doc/nut/examples/.
Network UPS Tools also has a number of supporting packages available:
nut-cgi
Web interface subsystem
nut-dev
Development files
nut-snmp
Meta SNMP Driver subsystem
nut-usb
USB Drivers subsystem
Remember that if your server is shut down by the UPS-management software, it won't restart automatically when power returns.