3.linux and Unix Installation
3.linux and Unix Installation
5
Essential Duties Of The System Administrator
Maintaining local documentation
As a system is changed to suit an organization’s needs, it
begins to differ from the plain-vanilla system described
by the documentation.
it’s the sysadmin’s duty to document the changes.
includes documenting where cables are run and how they
are constructed,
keeping maintenance records for all hardware,
Recording the status of backups, and documenting local
procedures and policies
Vigilantly monitoring security
implement a security policy and periodically check to be sure
that the security of the system has not been violated
Includes traps and auditing programs. 6
Essential Duties Of The System
Administrator
Fire fighting
helping users with their various problems
claims a significant portion of most administrators’
workdays
7
LINUX DISTRIBUTIONS
All Linux distributions share the same kernel lineage, but the
ancillary materials that go along with that kernel can vary
quite a bit.
Distributions vary in their focus, support, and popularity.
There continue to be hundreds of independent Linux
distributions, but our sense is that distributions based on the
Debian, Red Hat, and SUSE lineages will continue to
predominate in production environments
All major distributions, include a relatively painless
installation procedure, a well-tuned desktop environment,
and some form of package management.
Most distributions also allow you to boot from the distribution
DVD, which can be handy for debugging
8
Selecting a distribution
Is this distribution going to be around in five
years?
Is this distribution going to stay on top of the
latest security patches?
Is this distribution going to release updated
software promptly?
If I have problems, will the vendor talk to
me?
9
Most popular general-purpose Linux distributions
Distribution Website Comments
CentOS Centos.org Free analog of Red Hat Enterprise
Debian debian.org Closest to GNU
Fedora fedoraproject.org De-corporatized Red Hat Linux
Gentoo Gentoo.org Compile-it-yourself, optimized
Linux Mint linuxmint.com Ubuntu-based, elegant apps
Mandriva mandriva.com Long history, “easy to try”
openSUSE opensuse.org Free analog of SUSE Linux Enterprise
Oracle Enterprise Linux oracle.com Oracle-supported version of RHEL
PCLinuxOS pclinuxos.com Fork of Mandriva, KDE-oriented
Red Flag redflag-linux.com Chinese distro, similar to Red Hat
Red Hat Enterprise: redhat.com Reliable, slow-changing,
commercial Slackware: slackware.com Grizzled, long-surviving distro
SUSE Linux Enterprise: novell.com/linux Strong in Europe, multilingual
Ubuntu ubuntu.com Cleaned-up version of Debian 10
Example Systems Used In The Book
Three popular linux distributions and three UNIX variants
These systems are representative of the overall marketplace and
account collectively for an overwhelming majority of the
installations in use at large sites today.
11
Ubuntu
The Ubuntu distributions maintain an ideological
commitment to community development and open
access, so there’s never any question about which
parts of the distribution are free or redistributable.
Ubuntu currently enjoys philanthropic funding from
South African entrepreneur Mark Shuttleworth.
Ubuntu is based on the Debian distribution and uses
Debian’s packaging system.
It comes in two main forms, a Desktop Edition and a
Server Edition.
They are essentially similar, but the Server Edition
kernel comes pretuned for server use and does not
12
install a GUI or GUI applications such as OpenOffice.
SUSE
SUSE, now part of Novell, has taken the path of
Red Hat and forked into two related
distributions:
openSUSE that contains only free software; and
another
SUSE Linux Enterprise that costs money,
includes a formal support path, and offers a few
extra trinkets
13
Red Hat
Red Hat has been a dominant force in the Linux world
for most of the last decade, and its distributions are
widely used in North America.
In 2003, the original Red Hat Linux distribution was
split into
A production-centered line called Red Hat Enterprise
Linux (RHEL)
A community-based development project called Fedora.
The split was motivated by a variety of technical,
economic, logistic, and legal reasons.
The distributions were initially similar, but Fedora has
made some significant changes over the years
14
The CentOS Project
(centos.org)
The CentOS Project (centos.org) collects source code that
Red Hat is obliged to release under various licensing
agreements (most notably, the GNU Public License) and
assembles it into a complete distribution that is eerily similar
to Red Hat Enterprise Linux, but free of charge.
The distribution lacks Red Hat’s branding and a few
proprietary tools, but is in other respects equivalent.
CentOS aspires to full binary and bug-for-bug compatibility
with RHEL
CentOS is an excellent choice for sites that want to deploy a
production-oriented distribution without paying tithes to Red
Hat. 15
Usage statistics and market
share of Linux for websites
Unix is used by 66.9% of all the websites.
Linux is used by 36.7% of all the websites.
16
Usage statistics and market
share of Linux for websites
18
HP-UX
21
KDE
KDE, which stands for the K Desktop Environment, is written in
C++ and built on the Qt tool kit library
It is often preferred by users who enjoy eye candy, such as
transparent windows, shadows, and animated cursors.
It looks nice, but it can be slow on anything but a high-end
workstation
KDE is often preferred by people transitioning from a Windows
or Mac environment because of its pretty graphics.
It’s also a favorite of technophiles who love to be able to fully
customize their environment.
For others, KDE is simply too much to deal with and GNOME is
the simpler choice
22
KDE Applications
Applications written for KDE almost always
contain a K somewhere in the name, for
example, Konqueror (the web/file browser),
Konsole (the terminal emulator), or KWord (a
word processor).
The KOffice application suite contains word
processing, spreadsheet, and presentation
utilities.
KDE has a comprehensive set of development
tools, including an integrated development
environment (IDE) 23
GNOME
GNOME is written in C and is based on the GTK+ widget set.
The name GNOME was originally an acronym for GNU
Network Object Model Environment, but that derivation no
longer really applies; these days, GNOME is just a name.
With the recent addition of support for Compiz (compiz.org),
GNOME has acquired many of the eye candy features that it
previously lacked.
Overall, GNOME is still less glitzy than KDE, is not as
configurable, and is slightly less consistent.
However, it is noticeably cleaner, faster, simpler, and more
elegant.
Most Linux distributions use GNOME as the default desktop
environment.
24
GNOME applications
GNOME has a rich application set.
Usually identifiable by the presence of a G in their names
Office applications include AbiWord for word processing,
Gnumeric as a spreadsheet
The GIMP for image processing.
A file manager called Nautilus is also included.
Like KDE, GNOME provides an extensive infrastructure for
application developers.
Altogether, GNOME offers a powerful architecture for
application development in an easy-to-use desktop
environment
try both desktops and decide for yourself which best meets
your needs.
25
Virtualization
Virtualization deals with “extending or
replacing an existing interface so as to mimic
the behavior of another system”
Virtual system examples: virtual private
network, virtual memory, virtual machine
Virtualization is the creation of a virtual --
rather than actual -- version of something,
such as an operating system, a server, a
storage device or network resources
NO virtualisation
Run legacy software on non-legacy
hardware
Run multiple operating systems on the
same hardware
Create a manageable upgrade path
Manage outages (expected and unexpected)
dynamically
• Reduce costs by consolidating services
onto the fewest number of physical
machines
http://www.vmware.com/img/serverconsolidation.jpg
Non-virtualized Data Centers
Too many servers for too little work
39
VM software:
41
Multibooting
it’s fairly common practice to set up a machine to boot several
different operating systems.
you need to configure a boot loader to recognize all the
different operating systems on your disks
Each disk partition can have its own second-stage boot loader.
However, the boot disk has only one MBR.
When setting up a multiboot configuration, you must decide
which boot loader is going to be the “master.”
GRUB is really the only option for Intel-based UNIX and Linux
systems.
Always use GRUB over the Windows boot loader when dual
booting a Windows system.
Install all the desired operating systems before making
changes to grub.conf or menu.lst.
42
Dual booting, or why you
shouldn’t
If you are doing real work and need access to both Windows
and UNIX, be very skeptical of dual booting as a possible
solution in the context of a production system.
Dual boot setups represent Murphy’s Law at its worst: they
always seem to be booted into the wrong OS, and the
slightest chore usually requires multiple reboots.
With the advent of widespread virtualization and cheap
computing hardware, there’s usually no reason to put yourself
through this torture.
43
grub.conf file
default=0
timeout=5
splashimage=(hd0,2)/boot/grub/splash.xpm.gz
hiddenmenu
title Windows XP
rootnoverify (hd0,0)
chainloader +1
title Red Hat
root (hd0,1)
kernel /vmlinuz
44
OS Software Installation
The installation, configuration, and management of
software is a large part of most sysadmins’ jobs.
Administrators perform all of the following tasks:
Automating mass installations of operating systems
Maintaining custom OS configurations for the local
environment (localization.)
Keeping systems and applications patched and up to date
Managing add-on software packages
We now discuss the installation procedure (Direct
installation) for an example distributions, including
some options for automated deployment that use
common (platform-specific) tools
45
INSTALLING LINUX AND OPENSOLARIS
Current Linux distributions all have straightforward
procedures for basic installation.
Open Solaris installation process is similar, especially
on PC hardware.
Installation typically involves booting from a DVD,
answering a few basic questions, optionally
configuring disk partitions, and then telling the
installer which software packages to install.
Some systems, such as Ubuntu and OpenSolaris,
includea “live” option on the installation media that
lets you run the operating system without actually
installing it on a local disk.
46
Netbooting PCs
If you have to install the operating system on more
than one computer, you will quickly reach the limits
of interactive installation.
It’s time consuming, error-prone, and boring to repeat the
standard installation process on hundreds of systems
To alleviate some of these problems, most systems include
network installation options that simplify large-scale
deployments.
The most common methods use DHCP and TFTP to boot
the system’s physical media, then retrieve the installation
files from a network server through HTTP, NFS, or FTP.
Network installations are appropriate for sites with more
than ten or so systems.
47
Preboot eXecution Environment(PXE)
is a standard from Intel that allows systems to boot from a
network interface.
PXE acts like a miniature OS sitting in a ROM on your
network card.
It exposes its network capabilities through a standardized
API for the system BIOS to use.
This cooperation makes it possible for a single boot loader
to netboot any PXE-enabled PC without the need to
supply special drivers for each network card.
A host broadcasts a DHCP “discover” request with the PXE
flag turned on, and a DHCP responds with a DHCP packet
that includes PXE options (the name of a boot server and
boot file). The client downloads its boot file by using TFTP
and then executes it. 48
Setting up PXE for Linux
Several PXE-based netboot systems exist,
but the one that works best at this time is
H. Peter Anvin’s PXELINUX, which is part of
his SYSLINUX suite of boot loaders for every
occasion.
Check it out at http://www.syslinux.org.
49
Netbooting non-PCs
PXE is an Intel product and is limited to IA-32 and
IA-64 hardware.
Other architectures have their own methods of
booting over the net
SPARC machines and most PowerPC boxes use Open
Firmware, which is easy to netboot (type boot net).
IBM and HP systems also have netbooting
capabilities, but the procedures are heavily
dependent on the Network Installation Manager
and Ignite-UX software packages, respectively. 50
Kickstart
Is the automated installer for Red Hat
Enterprise Linux
It is really just a scripting interface to the
standard Red Hat installer, Anaconda.
It is dependent on both the base distribution
and RPM packages.
Kickstart is flexible and quite smart about
autodetecting the system’s hardware.
51
Setting up a Kickstart configuration file
Kickstart’s behavior is controlled by a single configuration file,
generally called ks.cfg.
The format of this file is straightforward.
If you’re visually inclined, Red Hat provides a handy GUI tool
called system-config-kickstart that lets you point and click
your way to ks.cfg creation
The ks.cfg file is also quite easy to generate programmatically.
A Kickstart config file consists of three ordered parts.
command section
Packages section
52
command section:example
text
lang en_US # lang is used during the installation...
langsupport en_US # ...and langsupport at run time.
keyboard us # Use an American keyboard.
timezone --utc America/EST # --utc means hardware clock is on UTC (GMT)
mouse
rootpw --iscrypted $1$NaCl$X5jRlREy9DqNTCXjHp075/
reboot # Reboot after installation. Always a good idea.
bootloader --location=mbr # Install default boot loader in the MBR.
install # Install a new system instead of upgrading.
url --url http://installserver/redhat
clearpart --all --initlabel # Clear all existing partitions.
part / --fstype ext3 --size 4096
part swap --size 1024
part /var --fstype ext3 -size 1 --grow
network --bootproto dhcp
auth --useshadow --enablemd5
firewall --disabled
53
xconfig --defaultdesktop=GNOME --startxonboot --resolution 1280x1024
command section
Specifies options such as the language, keyboard, and time
zone.
This section also specifies the source of the distribution with
the url option
Kickstart uses graphical mode by default, which defeats the
goal of unattended installation.
The text keyword at the top of the example fixes this.
The rootpw option sets the new machine’s root password.
The default is to specify the password in cleartext, which
presents a serious security problem.
You should always use the --iscrypted flag to specify a
pre-encrypted password
The clearpart and part directives specify a list of disk
partitions with sizes
54
Packages section example:
%packages
@ Networked Workstation
@ X Window System
@ GNOME
mylocalpackage
55
Packages section
Make the config file available on the net and then pass
it to the kernel at installation time with the following
kernel argument:
preseed/url=http://host/path/to/preseed
The syntax of the preseed file, usually called
preseed.cfg, is simple and reminiscent of Red Hat’s
ks.cfg.
59
Assignment 1:VMware and Ubuntu
Linux Installation
Goal:
In this Assignment, you will learn: 1) how to create a virtual
machine using VMware Server; 2) how to install UBUNTU
Linux;
During VM Creation and Linux installation, take screenshots
as many as needed for your assignment report. Use
VM/Capture Screen from the VMware menu
Follow instructions provided
Submit assignment report in pdf for grading
60
ubuntu requirements