Elemental Linux Server Installation


System requirements and limitations

The Elemental Linux Server (ELS) is a niche distribution and is not intended to run on every imaginable hardware configuration. Specifically, it is designed to run on standard x86 PC architecture using SATA or IDE hard drives and CD-ROMs.

ELS will not coexist with other operating systems. It expects to have full control over all hard drives it detects. You cannot configure ELS to dual-boot another OS using the included setup utility.

On the positive side, ELS has very low system requirements. It can easily run on older, discarded hardware, newer "value PCs" or minimally configured virtual machines. Minimum recommended requirements are Pentium II with 128M RAM and a 2G hard disk. Anything exceeding these specs should make a very capable system indeed.


Installation

The most straightforward way to install ELS is from a bootable CD-ROM. Visit the ELS home page, download the latest .iso image and burn it to CD. The instructions in the following sections are centered around CD-ROM based installation.

Note

The default action for the CD-ROM is to boot the operating system on the hard drive after a 30 second delay. You must manually select "Install Elemental Linux Server" from the CD's bootloader menu to access the installer.

Initial install

Upon booting from the ELS CD-ROM you will find yourself at a login prompt. To begin installation, log in as root and type setup to launch the installer script.

When the installation script is finished you will be returned to a shell prompt with a message instructing you to reboot using CTRL-ALT-DELETE. After restart, the system will boot into single-user mode. At this point you can log onto the server console as root and begin configuration.


System configuration

ELS does not have any specialized system administration tool. Everything is done by issuing standard commands at the shell prompt or editing files in the /etc directory. Methods for performing common tasks are detailed below.

Initial configuration

The system is not very useful after the initial installation. If you want to do anything interesting, you'll need to configure the system further. A checklist for getting started is provided below.

  1. Change the root password and set up at least one non-privileged user.
  2. Configure the system time.
  3. Create a swap file.
  4. Create filesystems for additional software and home directories.
  5. Configure IP networking.
  6. Configure system startup.
  7. Install additional software if desired.

Setting up users and passwords

One of the first steps you should take to secure the system is to set the root password and get in the habit of logging in as a non-privileged user.

To set the root password simply issue the passwd command while logged in as root.

Any non-privileged users can be created by using the following procedure:

  1. Use the groupadd command to create a new group for general users if one does not exist already.
  2. Create a new user account with the useradd command using the man page or example below to determine appropriate command-line options.
  3. Set the initial password for the user by issuing the command passwd username.

Example

The following example show the commands you could use to set the root password and then create a non-privileged user named "Joe Smith".

passwd

groupadd -g 500 users
useradd -c "Joe Smith" -g 500 -m -s /usr/bin/bash joe
passwd joe

Notes

Configuring system time

There are two steps in setting the system time. First, you must set the CMOS clock to Coordinated Universal Time (UTC). Next, you need to set the time zone for your location.

To set the clock, you can use either the hwclock command or your PC's BIOS setup utility. If you choose to use hwclock, it is a two step process.

  1. Set the CMOS clock to Coordinated Universal Time.
  2. Tell the Linux kernel to update its time by reading the CMOS clock.

Here are the steps to set the time zone:

  1. Remove any existing /etc/localtime file.
  2. Browse through the /usr/share/zoneinfo directory and its subdirectories and note the path to the file that most closely matches your geographic location or time zone.
  3. Copy the file found in the previous step to /etc/localtime.

Example

The following example shows how you might set the system time and the time zone if you lived in Chicago, USA.

hwclock --set --utc --date="4/22/2008 21:39:00"
hwclock --utc --hctosys

ls /usr/share/zoneinfo
rm -f /etc/localtime
cp /usr/share/zoneinfo/America/Chicago /etc/localtime

Note

Occasionally countries make changes to Daylight Saving Time rules. If this happens to you, you'll need to download an updated time zone file from http://www.iana.org/time-zones, extract it to the /usr/share/tzdata directory and recompile the zonefiles with the zic command.

Creating a swap file

If you have a small amount of RAM in your system, you will probably want to create a swap file to avoid running out of memory. Just how big that swap file needs to be depends on a number of factors including how much RAM you have, how much load you intend to put on the system and how much hard drive space is available. Fortunately, file-based swapping is flexible so you don't have to get it exactly right the first time.

Start by configuring a 64M swap file in the /var directory. Here's how to set it up:

  1. Change directory to /var.
  2. Create an empty 64M file called swap using the dd command.
  3. Create a swap filesystem on the file using the mkswap command.
  4. Add the swap file to the /etc/fstab file.
  5. Activate the swap space with the swapon command.

Example

The following example shows the commands used to set up the initial 64M swap file described above.

cd /var
dd if=/dev/zero of=swap bs=1M count=64
mkswap swap
echo "/var/swap  swap  swap  defaults  0  0" >> /etc/fstab
swapon -a

Note

You can check your swap usage with the free command. If you find your system's swap needs changing over time, you can always add or remove swap files as needed. Just be sure that if you create one, it's on a filesystem with plenty of available space.

Creating additional filesystems

The base installation of ELS does not set aside any space for additional programs or user data. You will need to carve out more space for these things depending on how you want to use your server. Here is how to do it.

  1. Create a new partition using fdisk.
  2. If you use mirroring, create a second partition of equal size and mirror the two using mdadm.
  3. Create a filesystem using the mke2fs command.
  4. Add the new filesystem to /etc/fstab.
  5. Mount the filesystem.

Depending on the available hard drive space you'll want to create a filesystem for /opt that is about 600M or more. All ELS add-on software is configured to install in /opt and 600M should give just enough room if you install everything on the CD-ROM. Any remaining space on the hard drive can be given to other filesystems like /usr/local or /home.

Example

The following examples shows how to create a filesystem for /opt on the system. Two examples are shown. The first is for a system that uses only a single disk, the second is for a system with two disks in a mirrored configuration. Choose the one that is most appropriate for your configuration.

Creating /opt on a system with a single disk.
fdisk /dev/sda
mke2fs -t ext4 /dev/sda5
echo "/dev/sda5  /opt  ext4  defaults  1  2" >> /etc/fstab
mount /opt
Creating /opt on a system with mirrored disks.
fdisk /dev/sda
fdisk /dev/sdb
mdadm --create --metadata=0.90 /dev/md5 -l mirror -n 2 /dev/sda5 /dev/sdb5
mke2fs -t ext4 -L ELS_OPT /dev/md5
echo "/dev/md5  /opt  ext4  defaults  1  2" >> /etc/fstab
mount /opt

Note

After using creating partitions, you may see a message telling you that the device or resource is busy and that the kernel still uses the old table. If you see this message, you should finish partitioning and reboot the system before continuing with mirroring or creating filesystems.

Configuring IP networking

The ELS system comes with kernel modules for a large number of 10/100 and gigabit network cards. Before configuring networking, you must determine the kernel module that supports your hardware. Most modules have a name similar to that of the card or card's chipset.

Steps to enabling IP networking include the following:

  1. Browse the /lib/modules/kernel.version.number/kernel/drivers/net directory to find the appropriate kernel module for your network card.
  2. Edit /etc/modprobe.d/eth.conf and add an alias for netdev-eth0 that refers to your network hardware's kernel module.
  3. Set the hostname in /etc/hostname.
  4. Enter an IP address and mask in /etc/interfaces.
  5. Create an entry in /etc/hosts for the local machine and any other devices on your Local Area Network (LAN).
  6. Set the gateway address in /etc/routes.
  7. Add your DNS server information to /etc/resolv.conf.
  8. Configure any desired firewall rules in /etc/firewall.
  9. Start the networking subsystem using the /etc/init.d/network script.

Each of the network configuration files mentioned above has a man page associated with it to help you with configuration.

Example

The following is an example of editing the configuration files for a typical small network setup using an Intel Pro 1000 network card.

vi /etc/modprobe.d/eth.conf
alias netdev-eth0 e1000

vi /etc/hostname
els.mynetwork.lan

vi /etc/interfaces
eth0 192.168.1.100 netmask 255.255.255.0

vi /etc/hosts
192.168.1.100  els.mynetwork.lan
192.168.1.101  laptop.mynetwork.lan
192.168.1.1    router.mynetwork.lan

vi /etc/routes
default gw 192.168.1.1

vi /etc/resolv.conf
domain mynetwork.lan
nameserver 10.10.10.53
nameserver 10.10.11.53

vi /etc/firewall
-A INPUT -i eth0 -s 192.168.1.0/24 -j ACCEPT

Notes

Configuring system startup

When ELS is first installed, it is configured to boot into runlevel 1 (single-user mode.) Single-user mode is generally only entered when doing system maintenance and is not used for everyday tasks. After you have finished configuring the system, you will want to change the default runlevel, particularly if you plan to have the system attached to a network. To do this, edit the initdefault entry of /etc/inittab. Choose runlevel 2 for a non-networked machine or runlevel 3 for a machine with a network connection.

Example

The following entry shows the system configured to start in networked mode:

id:3:initdefault:

Congratulations, the basic system configuration is finished. Your changes will take effect on the next reboot.


Additional administrative tasks

This section provides a reference for things that you may need to do after the basic system configuration is finished.

Installing additional pre-packaged software

Add-on packages for ELS are found on the ELS-EXTRA CD-ROM. They are packaged as simple .tar.gz files and are designed to reside in the /opt directory.

The procedure for installing add-on software is outlined below.

  1. Preview the contents of the package with the tar -ztvf command.
  2. Check for available space in the /opt filesystem using df.
  3. Change to the / directory and extract the package with the tar -zxf command.
  4. Create symbolic links to the package's executables in /opt/bin and, if necessary, /opt/sbin and /opt/lib directories.
  5. If needed, create customized configuration files in the /etc/opt directory.

Example

The following simple example shows how you might install the Midnight Commander file manger on your ELS system.

mount /media/cdrom
tar -ztvf /media/cdrom/extra/mc-4.8.1.7.i586.tar.gz
df /opt
cd /
tar -zxf /media/cdrom/extra/mc-4.8.1.7.i586.tar.gz
mkdir /opt/bin
cd /opt/bin
ln -s ../mc-4.8.1.7/bin/* .

Note

More complex examples of installing add-on software may be seen by viewing the documents in the howto directory.

Maintaining info pages

Info pages are different than man pages in that they have a top-level directory that serves as a master table of contents. This file, /usr/share/info/dir needs to be maintained or the info page collection will appear incomplete. If new packages with info pages are installed they will not appear in the table of contents until the directory is updated. Also, if the dir file is missing, typing info at the shell prompt will result in an error.

The command used to add info pages to the dir file is install-info. To create a table of contents that includes all info pages, first delete the existing dir file and then use the command ( cd /usr/src/info ; for INFOFILE in *.info.gz; do install-info $INFOFILE; done )

Configuring network services

Basic network services like telnet, tftp, pop3 and imap are controlled from /etc/inetd.conf and generally do not require any additional configuration. Other network daemons like Apache, Samba and ProFTPd are controlled using scripts in /etc/init.d. These daemons also have configuration files within the /etc/opt directory. See the documentation included with these daemons for more information on how to configure them.

Note

Be sure to configure firewall rules to grant or restrict access to the desired network services.

Controlling what runs at startup and shutdown

The runlevels in ELS are defined as follows:

The scripts used during system startup and shutdown are located in the /etc/init.d directory. Each script is named after the service it controls (e.g. exim starts/stops the Exim mail server.) Determining which scripts will run during startup/shutdown is as simple as answering the following questions:

Most scripts are pre-configured to run in the appropriate runlevels, however there may be times when you will need to link scripts manually. Creating a link name that begins with the letter 'S' will cause the script to be given a start argument. Conversely, any link name that begins with the letter 'K' will cause the script to be given a stop (kill) argument. Linked scripts are executed in alpha-numerical order. For example, K97local_fs will execute before K99poweroff and K scripts always execute before the S scripts.

Example

Below is an example of how you might set up links to start a fictitious "foo server" in runlevel 3 and stop it in runlevels 0, 1, 2 and 6.

cd /etc/rc3.d
ln -s ../init.d/foo S45foo
cd /etc/rc0.d
ln -s ../init.d/foo K55foo
cd /etc/rc1.d
ln -s ../init.d/foo K55foo
cd /etc/rc2.d
ln -s ../init.d/foo K55foo
cd /etc/rc6.d
ln -s ../init.d/foo K55foo

Note

The scripts in the /etc/init.d directory may also be run manually from a shell prompt. Each of the scripts takes a start or stop argument to respectively start or stop a daemon or process. For example, /etc/init.d/crond stop will manually stop the cron daemon. Some scripts also take a status argument to show the current state of the daemon and a restart argument to stop and start with a single command.

Configuring your ELS system to for specific applications

Chances are good that you'll want to do something interesting with your ELS system. Maybe you'll want to use it as a home file server or run an intranet web site on it. Several "howto" documents are provided for these sorts of tasks. More information can be found in the howto directory.