Вы находитесь на странице: 1из 62

3.

Linux and Unix installation

• Essential Duties Of The System Administrator


• Selecting a distribution
• Gnome, Kde,
• Virtualization:vmware,virtualbox
• Unattended installations 1
Overview
 Essential Duties Of The System Administrator
 Selecting a distribution,
 Gnome, Kde,
 Designing A Hard Disk Layout,
 Installing A Boot Manager,
 Explore Different Installation Methods – Direct,
Dual Booting, Vm Virtualbox Software;
 Installing Packages And Their Dependencies; 2
Essential Duties Of The System
Administrator
 Account provisioning
 adds accounts for new users,
 removes the accounts of users that are no longer active,
 handles all the account-related issues that come up in
between (e.g., forgotten passwords).
 Adding and removing hardware
 When new hardware is purchased or when hardware is
moved from one machine to another, the system must be
configured to recognize and use that hardware.
 Hardware-support chores can range from the simple task of adding a
printer to the more complex job of adding a disk array.
3
Essential Duties Of The System Administrator
 Performing backups
 perhaps the most important job
 Backups are absolutely necessary
 make sure that backups are executed correctly and
on schedule
 Installing and upgrading software
 When new software is acquired, it must be installed and
tested, often under several operating systems and on
several types of hardware
 User training
 Installation of patches and security updates
 Packaging of Local software and administrative scripts
 new releases should be staged for testing before being
4
deployed to the entire site.
Essential Duties Of The System Administrator
 Monitoring the system
 Vigilant supervision.
 Regularly ensure that email and web services are working
correctly,
 watch log filesfor early signs of trouble,
 make sure that local networks are properly connected,
 keep an eye on the availability of system resources such as
disk space
 Troubleshooting
 Diagnosing problems and calling in experts if needed.
 Finding the problem is often harder than fixing it.

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

 Ubuntu is used by 39.1% of all the


websites who use Linux.
17
Example UNIX distributions:
Solaris
 Solaris is a System V derivative with many extensions from
the company formerly known as Sun Microsystems, now
part of Oracle
 Solaris runs on a variety of hardware platforms, most notably
Intel x86 and SPARC.
 In Sun’s hands, Solaris was free to download and use.
However, Oracle has changed this policy, and current
downloads are labeled as 90-day free trial editions.
 The existence of OpenSolaris, an explicitly free and open
source version of Solaris, complicates the picture as well

18
HP-UX

 HP-UX is based on System V and is tied to


Hewlett-Packard’s hardware platforms.
 It’s closer to the ancestral source tree than
either Solaris or AIX, but HP has kept pace
with developments in the OS world and has
added a variety of its own enhancements.
 Now that HP has begun supporting Linux as
well, the future of HP-UX is somewhat less
clear. 19
IBM’s AIX
 IBM’s AIX started as a variant of Berkeley’s 4.2 BSD, but as of
version 4 in 1994, most parts of the system migrated to
System V.
 At this point, AIX has drifted rather far from both origins.
 AIX has enjoyed less cross-pollination from other systems
than most UNIX variants
 It has also been influenced by of some of IBM’s mainframe
and AS/400 operating systems, from which it inherits
conventions such as the Object Data Manager
 IBM continues to develop and promote AIX, but it’s also
engaged in partnerships with Red Hat and Novell to ensure
that their respective Linux distributions run smoothly on IBM
hardware. It will be interesting to see how this approach plays
out in the years ahead 20
DESKTOP ENVIRONMENTS
 Two big players in modern desktop
environments: GNOME and KDE.
 Both are relatively complete desktop managers
 just because you are running in one realm does
not mean you cannot use applications from the
other; just expect a different look and feel and
a brief sense of discontinuity in the universe.

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

 High costs and infrastructure needs


 Maintenance
 Networking
 Floor space
 Cooling
 Power
 Disaster Recovery
Dynamic Data Center

 Virtualization helps us break the “one service per


server” model
 Consolidate many services into a fewer number of
machines when workload is low, reducing costs
 Conversely, as demand for a particular service
increases, we can shift more virtual machines to run
that service
 We can build a data center with fewer total
resources, since resources are used as needed
instead of being dedicated to single services
So, it is just like Java VM,
right?
VM software: VirtualBox
 Oracle VM VirtualBox is a free and open-
source hypervisor for x86 computers currently being
developed by Oracle Corporation. Developed initially by
Innotek GmbH, it was acquired by Sun Microsystems in 2008
which was in turn acquired by Oracle in 2010.
 VirtualBox may be installed on a number of host operating
systems, including: Linux, macOS, Windows, Solaris,
and OpenSolaris.
 It supports the creation and management of guest virtual
machines running versions and derivations
of Windows, Linux, BSD, OS/2, Solaris, Haiku, OSx86 and
others, and limited virtualization of macOS guests on Apple
hardware.

39
VM software:

 VMware, Inc. is a subsidiary of Dell Technologies that


provides cloud computing and platform virtualization
software and services.
 It was the first commercially successful company to
virtualize the x86 architecture.
 VMware's desktop software runs on Microsoft
Windows, Linux, and macOS, while its enterprise
software hypervisor for servers, VMware ESXi, is a
bare-metal hypervisor that runs directly on server
hardware without requiring an additional underlying
operating system. 40
OS Software Installation
 different installation methods
 Direct installation,
 dual booting,
 Using Virtualisation 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

 Arbitrary shell commands 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

 The second section is a list of packages to


install, beginning with a %packages directive.
 The list can contain individual packages,
collections such as @ GNOME, or the notation @
Everything to include the whole shebang.
 When selecting individual packages, specify
only the package name, not the version or the
.rpm extension.
56
Arbitrary shell commands section
 In the third section of the Kickstart configuration file,
you can specify arbitrary shell commands for
Kickstart to execute.
 There are two possible sets of commands:
 one introduced with %pre that runs before installation,
 and one introduced with %post that runs afterward.
 Both sections have some restrictions on the ability of
the system to resolve hostnames, so it’s safest to use
IP addresses if you want to access the network.
 In addition, the post-install commands are run in a
chrooted environment, so they cannot access the
installation media.
57
Automating installation with the Ubuntu installer
 Ubuntu relies on the underlying Debian installer (named,
appropriately enough, debian-installer) for “preseeding,”
the recommended method for automated installation.
 As in Kickstart, a preconfiguration file answers questions
asked by the installer.
 Preseeded installations cannot use existing partitions; they
must either use existing free space or repartition the entire
disk.
 All the interactive parts of the Debian installer use the
debconf utility to decide which questions to ask and what
default answers to use.
 By providing debconf with a database of preformulated
answers, you fully automate the installer.
58
Automating installation with the Ubuntu installer
 You can either generate the database by hand (it’s a
text file), or you can perform an interactive installation
on an example system and then dump out your
debconf answers with the following commands:
ubuntu$ sudo debconf-get-selections --installer > preseed.cfg
ubuntu$ sudo debconf-get-selections >> preseed.cfg

 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

 2 GHz dual core processor.


 2 GiB RAM (system memory)
 25 GB of hard-drive space (or USB stick, memory
card or external drive but see LiveCD for an
alternative approach)
 VGA capable of 1024x768 screen resolution.
 Either a CD/DVD drive or a USB port for the
installer media.
 Internet access is helpf
61
centos requirements
Criteria Requirements
Red Hat Enterprise Linux 4 or 5
Operating System with the latest patches and
upgrades
Pentium 3 or higher; 500MHz
CPU Type
or higher
256 MB minimum Up to the
system limit (on 32 bit
Memory/RAM systems, typically 3 GB RAM or
4 GB RAM with hugemem
kernel) for large environments
62

Вам также может понравиться