~  CHAPTER 2:    INSTALLING LINUX IN A SERVER CONFIGURATION   ~           

 

 

A key attribute in Linux’s recent success is the remarkable improvements in installation tools.

 

NOTE:  The version of Red Hat Linux 7.l0 that ships with this book is the “Publishers Edition” 

This means Red had had to make a special effort to get all of the package’s source code in

addition to their easy-to-install format onto a single CD.  As a result, some of the less used

packages had to be dropped.  For the complete list, look at the README.publishers-edition

file located in the root directory of the CD-ROM.

 

Most default configurations where Linux is installed are already capable of becoming servers. 

This is due to an unfortunate, slightly naïve design decision:  being designated a server means

 that the machine serves everything!

 

From this services to printers to mail to news to …. It’s all turned on from the start.

 

 

 Before Installation

 

Evaluate the hardware of the system that it is going on.

You can visit the Linux website they have an HCL.  www.redhat.com/support/hardware.

While they appear to be really impressive, they haven’t had the maturing process some of

the slightly older hardware has gone through.

 

 

 

Server Design

 

The most significant design you must make when managing a server configuration is not

technical but administrative.  You must design a server to unfriendly to casual users.  This

means no cute multimedia tools, no sound card support, and no fancy Web browsers

(when at all possible).

 

Another important aspect of designing a server is making sure that it has a good environment. 

As a system administrator, you must ensure the physical safety of your servers by keeping

them in a separate room under lock and key.  The wrong environment is an accident

waiting to happen.  Here are some specific things you can do to improve your server situation:

 

 

=====================================================================

 

linux2.html                                                      PAGE 2                                                   2002/07/11

 

 

 

Take advantage of the fact that the graphical user interface (GUI) is uncoupled from the core

operating system, and avoid starting X Windows (Linux’s GUI) unless someone needs to

sit on console and run an application.  After all, like any other application, X Windows

requires memory and CPU time to work, both of which are better off going to the server

processes instead.

 

Determine that functions the server is to perform, and disable all other functions.  Not only

are unused functions a waste of memory and CPU, but they are just another issue and need

to deal with on the security front.

 

Unlike some other operating systems, Linux allows you to pick and choose the features

you want in the kernel.

 

The default kernel will already be reasonably well tuned, so you won’t have to worry

about it; but if you do need to change a feature or upgrade the kernel, be picky about

what you add and what you don’t.

 

NOTE:  You may hear an old recommendation that you recompile your kernel to make the

most effective use of your system resources. This is no longer true – the only reason to

recompile your kernel is to upgrade or add support for a new device.  Remember:  Don’t

screw around (lightly) with what’s stable and performs reasonably well.

 

 

Uptime

 

Uptime is good, More uptime is better.  The UNIX (Linux) uptime command tells the user how

long the system has been running since its last boot, how many users are currently logged in,

and how much load the system is experiencing.

You may deny caring about it now, but in six months you’ll probably scream at anyone who

reboots the system unnecessarily.

 

 

Dual-Booting Issues

 

Some quick hints:  If a Windows 95 or Windows 98 partition currently consumes an entire hard

disk as drive C; you can use the fips tool to repartition the disk.  Simply defragment and then

run fips.exe.

 

If you are using Windows NT/20000 with NTFS and have already allocated all the disk with

data on each partition, you may have to move data around a bit by hand to free up a partition. 

Don’t bother trying to shrink an NTFS partition, though; because of its complexity, it doesn’t

like being resized, and doing so will lead to corruption.

 

 

=====================================================================

 

linux2.html                                                      PAGE 3                                                   2002/07/11

 

 

 

NOTE:  From the perspective of flexibility, NTFS doesn’t sound like a good thing, but in

reality it is.  If you have to run NT or 2000, use NTFS.

 

You may find using a commercial tool such as Partition Magic to be especially helpful,

because it offers for NTFS, FAT32, and regular FAT, as well as a large number of other

file system types.  Its user interface is also significantly nicer than fips.

 

 

Methods of Installation

 

Typically, server installations aren’t well suited to automation, because each server usually

has a unique task; thus each server will have a slightly different configuration.   For example,

a server dedicated to handling logging information sent to it over the network is going to have

especially large partitions set up for the appropriate logging directories, compared to a file

server that performs no logging of its own.

 

 

If it Just Won’t Work Right

 

In the immortal words of Douglas Adams, don’t panic.  No operating system installs

smoothly 100% of the time.

Here are some help sites for help.

 

Comp.os.linux.admin

http://www.ojichan.com/linux-admin/

http:///www.linuxdoc.org/

http://www.thelinuxgurus.org/

 

 

Installing Red Hat Linux

 

You have two ways to start the boot process:  you can use a boot floppy or the CD-ROM. 

This installation guide assumes you will boot off the CD-ROM to start the Red Hat installation

process.  You must change the C-MOSS to accomplish this.

 

NOTE:  Users of other UNIX operating systems can use the dd command to create the

boot image onto a floppy disk.  Follow the instructions that came with your distribution on

using the dd command with your floppy device.

 

 

 

 

=====================================================================

 

linux2.html                                                      PAGE 4                                                   2002/07/11

 

 

 

 

Creating a Boot Disk

 

The program is rawrite.exe program.  You can also create a boot floppy at the end of an

installation.

 

Classroom Preinstallation Hints:

 

Change the C-MOSS and boot to a 98 floppy.  Find the command delpart, and run it. 

(usually in command.com directory).

 

Find fdisk and run this command.

Install Windows 98 on 1 GB partition and format FAT32 for dual booting.

Once done Windows will be installed on Drive C:  so type format^c:^/s

Once you boot it again it will boot into Windows 98 C:Directory

Insert the 98 Client diskette and type ntsetup (use the directory a:\ndis2\dos.

D:\xcopy^*.*^c:\win98setup^/s^/e

Setup98

Student (with password = student

 

 

If Install Linux at home (do the following)

 

  •   Get a copy of Red Hat 7.1 version, can download off the Internet onto 2 CDs.
  •   Take my 20GB drive and leave Professional on C: and make a maximum of 4GB.
  •   Change the C-MOSS and start install from CD-ROM.
  •   Ensure that Linux is installed on the 1st 8 GB, so if Professional is on 4GB, then it will be

okay.

 

 

See page 32, check both questions:

 

  •   Create Boot Disk
  •   Do not install Lilo
  •   Ensure that the refresh rates the screens vertical and horizontal are correct.  This is

important, or you can damage your screen.

 

 

 

=====================================================================

 

linux2.html                                                      PAGE 5                                                   2002/07/11

 

 

 

 

Starting the Installation

 

Boot off the CD-ROM and you will be at the Red Hat 7.0 screen and the following will appear:

 

   boot:

 

  • Press F1 to stall the installation, so you can look at the selections
  • Once you have viewed the screen, press the Enter key to start the installation.
  • Language: see from the list.
  • Keyboard:  Use the Generic 101-key PC.

 

TIP:  if you ever want to change your keyboard  layout or type, you run the program

/usr/sbin/kbdconfig.

 

 

  •   Mouse:  Choose the 3 Mouse (PS/2)
  •   Install Linux: This starts with a splash screen whose corresponding help bar tells you how to

register Red Hat Linux if you purchased the boxed version.  Do not choose the Workstation

will wipe out Windows 98 we just installed.  Select Install and Custom buttons.

  •   Creating Partitions for Linux.  In short, each partition is mounted at boot time.  Manually

partition with Disk Druid (Next).

  •   Add Mount point.
  •   You need 2 partitions (root and Swap)  Swap must be twice what RAM is.
  •   Mount Point = / size = 3000
  •   Swap = 512 or twice of RAM on partition 5.
  •   Mount Point Device:

 

 

 

Hda1                1004                WinFAT32

                      /             Hda2                3000                Linux Native

            <swap>           hda5                    512                Linux Swap

 

  •   Check for Bad blocks you may want to skip, will take too long.
  •   LILO:  Use the boot disk to do this.
  •   America/Detroit/Eastern time.  Next
  •   Root password = (g00dluck), minimum of 6 characters
  •   Account Name:  Patti (pa55word)  Make up Alex and Wesley accounts and use the

same password.

  •   Next
  •   Enable MD5 Passwords (ON) check off
  •   Enable Shadow passwords (ON) check off (NEVER TURN OFF)
  •   Enable NIS = off
  •   Enable LDAP = off
  •   Enable Kerberos = off
  •   Next
  •   Package Group Selection choose most of them, but no to Laptop, Dail-up, Newsgroups,
  •   SQL (be careful on the last one, it bombed at school on this one.)
  •   Monitor 30-70 Horizontal, Vertical 50-130 Refresh rate.
  •   Monitor ATI Rage 128 Generic 16384K.
  •   Customize (32 bit 800 X 600)
  •   Next
  •   Next
  •   Takes about 30 minutes to install all the files.

 

 

 

 

=====================================================================

 

linux2.html                                                      PAGE 6                                                   2002/07/11

 

 

 

 

Directories:

=====================================================================

                                                            Definition                    Space Required

=====================================================================

             /                                              Root directory                  3GB (if by itself)

           /root                                          Root                                 1GB if others too

            /boot                                                                                   50MB

            /usr                                                                                     50-100MB/user                                                    

            /home                                                                                  2GB

            /var                            (variables, log files)                          100MB                                                                  

            /opt                           (optional)  3rd party programs          unknown

            /tmp                                 Temporary                                 variable size

            /usr/local                                                                           variable size

 

 

=====================================================================

 

Additional Command:

 

NOTE:  the up cursor key will keep a list of 500 commands until you reboot/user.

 

ls^-l                                          Lists the contents

drwxr^-xr-x

cd                                            Changes directories, just cd takes back to home

                                                directory.

cd^..                                        Takes you up one level.

cd^/                                        

 

pwd                                         Print current directory, shows current path.

 

Shutdown                                 You must be logged in as the root, and cd to the

                                                sbin directory.   shutdown^-h^-now

                                                This will shutdown the computer right away.

 

touch^sneak                             Creates a 0 byte file, needed for some driver files.

 

Pico^sneak                               The editor view the contents of sneak.

 

Ctrl 0 = Save Pico (enter key)

Ctrl X = Exit the editor

 

>sneak                                    

 

cat^sneak                                 Shows the content of the sneak.

 

 

 

=====================================================================

 

linux2.html                                                      PAGE 7                                                   2002/07/11

 

 

 

Pico^.bashrc (enter)

 

echo^$PATH                           (variables are in capitals)

                                                PATH=$PATH:$HOME/bin:/bin

                                                echo^$PATH

 

                                                Will respond with the path of the users home

                                                Directory.

 

dmesg                                      Store information about boot up

 

 

            *** These commands will be on EXAM or QUIZES ***

 

=======================================================================

cd^/bin                                    Change the directory

ls^-l                                         All commands, programs stored in bin.

 

cd^/boot                                  boot file directory

ls^-l                                         Physical files for booting

                                                No text files

                                                Must be below 1st 1024 cylinders is where this

                                                Directory is located or 1st  8GB.

 

                                                Boot needs 50-60MB for boot. vmlinuz (the

                                                z means compressed.

 

cd^/dev                                   All devices on the system.

ls^-l                                         Bogus files that point to the other areas. 

                                                JUST pointers.

 

cd^/etc                                    Holds all configuration files.

ls^-l                                         Lists the directory contents.  BACKUP is

                                                Important.

                                                Not necessary to backup the boot.                   

                                   

cd^/home                                Home Directories

ls^-l                                         Lists the profiles.  Important in Linux.  Root is not

                                                Here?  Just a tradition in the UNIX style

                                                Programming.

 

cd^/lib                                     All Linux Libraries VS. .DLL in the Microsoft

ls^-l                                         World.

 

cd^/lost+found                        Lost clusters.  Not necessary to defragment as

ls^-l                                         much as Microsoft, it does self-cleaning.

 

 

 

=====================================================================

 

linux2.html                                                      PAGE 8                                                   2002/07/11

 

 

cd^/mnt                                   Mount point is a strange concept if you are

ls^-l                                         Dealing with Microsoft.  Before you add the

                                                Floppy you have to mount and unmount it.

                                                CDROM and FLOPPY.

 

cd^/opt                                    Optional = 0 New directory, currently empty.

ls^-l                                         the optional Linux “StarOffice” is in

                                                competition with Microsoft.  It is free.

 

cd^/proc                                  The Procedures file is huge.  It is called

ls^-l                                         kcore, and it is 2 Billion currently.  It is stored

                                                in RMA virtual and the page file.

 

                                                Kcore is an important file.  It is your “fault

                                                tolerance”.

 

                                                Kcore size will be the same as your RAM or

                                                256K.

 

cd^/root                                  Cannot get into, must be logged in as the Root.

ls-l

 

cd^/sbin                                  System Binaries and Administrative Tools.

                                                Sometimes this directory is located in /usr in

                                                other Distros.

 

cd^/tmp                                   Temporary Directory.  It does self clearing itself.

                                                Should check occasionally.

 

cd^/usr                                    Data available to any user.  Location of doc-

                                                documentation.  Read only for the executable files.

 

cd^/var                                    Variable Directory.  The security logs, e-mails

                                                system logs.   Similar to the Event Viewer.

 

========================================================================

 

 

How to Mount a Floppy:

 

  • Insert the floppy
  • cd^/mnt/floppy (enter)
  • ls^-l
  • cd^/
  • mount^/mnt/floppy

 

 

 

=====================================================================

 

linux2.html                                                      PAGE 9                                                   2002/07/11

 

 

 

Other commands:

 

ls^-r

ls^-d^s*m*b* (finds samba)

ls^-d^[ckp]*

ls^[b-g][B-G]  Upper/lower case.

Fdisk.

Who

W

date;who^_iH

date;w^_iH

./ifconfig

man^ifconfig (manual ifconfig)

ifconfig^eth0^10.10.1.104^netmask^255.0.0.0^broadcast^10.255.255.255^IRQ^NN^10_addr^ii

 

 

DO NOT DO THESE, DISASTERIOUS CONSEQUENSES:

 

  • Fdformat (sets up a floppy drive) 
  • Fdformat^/dev/fd0H1440
  • Mkfs (makes a files system

 

 

Choosing a Language (p22)

 

The first menu will ask which language you want to use to continue the installation process.

 

 

Selecting a Keyboard Type

 

The first lists the types of keyboards supported; the second lists available layouts the keyboard

can have; and the third box allows you to enable dead keys, which enable you to type special

characters with multiple keystrokes.

 

 

 

 

=====================================================================

 

linux2.html                                                      PAGE 10                                                 2002/07/11

 

 

 

TIP:  If you ever want to change your keyboard layout or type, you can run the program

 

/usr/sbin/kbdconfig.

 

 

Selecting the Mouse

 

It will suggest a default mouse to use.

TIP:  if you change the type of mouse you have later, you can run /usr/sbin/mouseconfig to

reconfigure your mouse.

 

 

Creating Partitions for Linux

 

Each partition is mounted at boot time.  The mount process makes the contents of that

partition available as if it were just another directory on the system.  For example, the

root directory (/) will be on the first (root) partition.  A subdirectory called /usr will exist

on the root directory, but it will have nothing in it.

 

Because you are configuring a server, you need to be aware of the addition large grouping

of files that will exist over the life of the server.  They are:

 

/usr, where all of the program files will reside (similar to C:\Program Files).

           

/home, where everyone’s home directory will be.

 

/var, the final destination for log files.

           

/tmp, where temporary files are placed.

 

Swap.  That isn’t a user accessible file system, but it is where the virtual memory file is

stored.

 

The installation screen gives you three options:  automatically partition the disk, manually

partition the disk with Disk Druid, or manually partition the disk with fdisk.  Simply select

Disk Druid, and click Next, it will be explained in chapter 8.

The Disk Druid partitioning tool was developed by Red Hat as an easy way to create

partitions and associate them to the directories as which they will be mounted.  When

starting Disk Druid, you will see all of the existing partitions on your disk.  Each partition

entry will show the following information:

 

Mount Point.  The location where the partition is mounted.

 

 

 

 

=====================================================================

 

linux2.html                                                      PAGE 11                                                 2002/07/11

 

 

 

Device.  Linux associates each partition with a separate device.  For the purpose of

installation, you need to know only that under IDE disks, each device begins with

dev/hdXY, where X is either:

 

a for IDE Master on the first chain.

            b for IDE Slave on the first chain

            c for IDE Master on the second chain

            d for IDE Slave on the second chain.

 

                        The Y is the partition of the disk.  For example, /dev/hda1 is the

                        First partition on the primary chain, primary disk.  SCSI follows

                        The same basic idea, except instead of starting with /dev/hd, each

                        Partition starts with /dev/sd and follows the format /dev/sdXY,

                        Where X is a letter representing a unique physical drive (a is for

                        SCSI id 1, b is for SCSI id 2, and so on).  The Y represents the

                        Partition number.  Thus /dev/sdb4 is the fourth partition on the

                        SCSI disk with id 2.  The system is a little more complex than

                        Windows, but each partition’s location is explicit – no more

                        Guessing!

 

 

Requested.  The minimum size that was requested when the partition was defined.

Actual.  The actual amount of space allocated for that partition.

Type.  The partition’s type.  Linux’s default type is Linux native, but Disk Druid also

understands many others, including FAT, FAT32, and NTFS.

 

NOTE:  The changes made within Disk Druid are not committed to disk until you

click the Next button.

 

 

Addition a Partition

 

To create a new partition, click the Add button.  This will bring up a dialog box where

each of the elements in the dialog box should resemble those.

At a minimum, you need to have two partitions: one for holding all of the files and the

other for swap space.  Swap space is usually sized to be double the available RAM

if there are fewer than 128MB of RAN, or the exact same amount of RAM if there

are more than 128MB. 

Realistically, you will want to separate partitions for /usr, /var, /home, and /tmp in the

addition to a root partition.

 

NOTE:  One last detail that we have intentionally omitted is the process of adding

network drive mounts (NFS).  Covered in Chapter 8.

 

 

 

 

=====================================================================

 

linux2.html                                                      PAGE 12                                                 2002/07/11

 

 

 

Formatting Partitions:

 

The screen for formatting partitions will present you with a list of all the newly created

partitions.  Because you are wiping the disk of previous installations, you want to

select all of the partitions to be formatted.  More accurately, Red Hat will be creating

a file system on it.

 

 

Installing LILO

 

LILO is the boot manager of Linux.  If you aren’t already familiar with what it does, a

boot manager handles the process of actually starting the load process of an operating

system.

The Red Hat tool’s screen for setting up LILO has three sections.  The top of the screen

allows you to select whether you want to make a boot disk.  Good idea.

 

NOTE:  The exception is for SMP-based systems that will have two choices.  The first

choice, linux is set up to support multiple processors.  In the event this doesn’t work out

for you, linux-up will also be available; it will utilize only one processor, but at least it will

get you up and going.

 

 

Setting Up Networking

 

Now Red Hat is ready to configure your network interface cards. 

Each interface card you have will be listed as a tabbed menu on the top of your screen. 

Ethernet devices are listed as eth0, eth1, eth2, and so on.  For each interface, you can

either configure it using DHCP or set the IP address by hand.

 

Creating Accounts

 

Su is the Switch user account.  Setting the root password isn’t enough if you intend to

perform remote administration; you will need to set up a real user, as well.

NOTE:  You do not need to add the root user.  When you add new users, you can

delete and edit them as well.

 

 

Authentication Configuration

 

Linux keeps its list of users in the /etc/passwd file.  Each system has its own copy of this

file, and a user listed in one /etc/passwd file cannot log into another system unless they

have an entry in the other /etc/passwd file.

 

 

=====================================================================

 

linux2.html                                                      PAGE 13                                                 2002/07/11

 

 

 

Within the last few years, affordable PCs have gained the necessary computational

power to present a threat to this type of security, and therefore a push to use shadow

passwords has come.  With shadow passwords, the actual encrypted password entry

is not kept in the /etc/passwd file but rather in a /etc/shadow file.  The /etc/passwd file

remains readable by any user in the system, but /etc/shadow is readable by the root user

only. 

 

If your site has an existing NIS infrastructure, enter the relevant NIS domain and server

name in this window.  If you don’t know or if you want to deal with this later, you can s

afely ignore this step.

 

Finally, if you are in a Kerberos environment, you will need to enable the Kerberos

authentication method.  If you go this route, contact your Kerberos administrator for the

appropriate realm names, KDC, and admin server.

 

 

Selecting Package Groups

 

This is where you can select what packages get installed onto the system.   Red Hat

categorizes these packages into several high-level descriptions, which allows you to make

a quick selection of what type of packages you want installed and safely ignore the details.

If you opted to select individual packages, Red hat will go through and verify that all of the

prerequisites necessary for these packages are met.  If any are not met, you will be shown

these packages in a screen that looks like the picture on page 39.

 

 

Configuring X Windows

 

X Windows is the basis for Linux’s graphical user interface.  It is what communicates with

the actual video hardware.  Programs such as KDE and GNOME (which you are more

likely to have heard about; if not read) use X Windows as a standard mechanism for

communicating with the hardware.

By having the GUI turned off, you save memory and system resources that can instead

by used for the actual server processes.

 

TIP:  Have the frequency information about your monitor information. Trying to send

your monitor too high a frequency can cause physical damage.  This author managed to

toast his first color monitor this way, back when monitors were far less robust and before

X Windows configuration tools existed.

 

 

 

=====================================================================

 

linux2.html                                                      PAGE 14                                                 2002/07/11

 

 

 

By default, Xconfigurator tries to use the highest resolution with the maximum number of

colors available.  For some people, this resolution setting is too high and makes fonts hard

to read.  DUH.

 

The choice of using a graphical login is just that:  You can have X Windows automatically

start up on boot so that the first login everyone sees is graphical instead of text based.

Finally, if you do want X Windows, you can select your default desktop to be either

GNOME or KDE.

 

Here you can select the resolution you want to work with.  Be sure to test the resolution

before continuing.  Ensure that you test your monitor before you accept it.

 

 

Chapter Summary:

 

 

  •   What makes Linux wonderful is that even though those options are no longer part of the

installation process, you can still change them and tweak them to your heart’s content

once you’ve completed the install and have started the system for real.