Chapter 1 Introduction to Linux
Examples and Lab Practice
Introduce concepts of
Discuss the responsibilit
Demonstrate the Fedora Linux
Demonstrate adding users and groups
Linux is a freely distributed, multitasking, multi
like operating system. It was
esigned specifically for the PC.
Linux distributions are available
bit and 64
on a variety of pl
atforms such as Intel, Alpha, Sp
rather than saying that
s kernel behaves like
UNIX but no UNIX code was used in the development of Linux due to
as all the features of UNIX,
as well as some
The first version on Linux was developed in 1991 by a
inish college student
e published his project
. In 1992 the software was released using
(GNU’s Not Unix)
General Public License (GPL), a royalty free
Free Software Foundation
(FSF) was f
ounded in 1985 and
ment of many GNU utilities and tools for
Much of the GNU software was later
ported and compiled into
Linux distributions rely heavily on these GNU tools and utilities.
s a command
line operating system without
a Graphical User
. In order to compete
Windows and make Linux more attractive,
GNU Network Object Model Environment
part of the
project was developed t
o provide us
er friendly Windows like interface.
was to create
framework similar to
he GNOME project provides two things:
he GNOME desktop
environment, an intuitive and attractiv
e desktop for users
and the GNOME development
platform, an extensive framework for building applications that integr
ate to be
Linux desktop GUI environment
environment, the K Desktop Environment (
KDE project for
GNOME and KDE are
widely adopted by many Linux distributions.
Learning system administration requires interacting with an operating system. It
seem desirable to
all the operating systems
they might use later.
this is not possible, because new operating systems
continue to be developed. Even if no new operating
were developed there
already too many operating systems to be descri
bed in a single book. This book will use
Linux to illustrate system administration concepts throughout.
Linux was selected
because it is open source and it can run on inexpensive PCs. Linux distributions are
available that can
run directly off
a CD or USB
device without using a dedicated partition
hard drive. Because of the
of Linux to UNIX, system administration is
similar in both operating systems. However, a variety of flavors of UNIX
and Linux are
available. Some of the common UNIX flavo
AIX, FreeBSD, HP
Linux flavors or distributions are described in the next section. System
administration principles are the same in all the distributions, but different distribution
supply different system administration
you will not find it difficult to administer
other operating systems, such as Windows
are very similar
to the commands in U
market is expanding, particularly as a server operating system
that during the first
for 39.2 % of
all server s
ales revenue, UNIX for 30.6%, and
tion of Linux
still lags with only about 1% of the market being Linux and Microsoft
more than 90%
of the market
used for server operating system.
What are some ad
vantages of using a graphical or GUI interface?
What are some advantage of using a command
1.2 Linux Distribution
A Linux distribution is a complete operating system consisting of a
(the core of an
operating system) and utilities
operating system) together with a variety of
system applications. A free distribution is supported by its open source project
example of this is
’s support of Fedora. A
commercial distribution is
example of a commercial sponsorship is Novell’s
wide variety of
open source and commercial
ibutions have been created.
The large number of distributions
often confuses beginners who are unsure how to select
between the different
distributions. A system administrator not only needs to know about
to select one appropriate for
a particular situation
, but also
to take advantages of the features of the selected distribution.
Table 1.1 compares some
the popular Linux distributions.
呡扬攠ㄮㄠ卵b浡my映偯灵 a爠i楮畸⁄楳 物扵瑩潮o
畳u搠景d畳 湥獳Ⱐs潭攠畳oⰠ潲ca摥浩c ed畣a瑩潮㬠
a 睬y 杲g摵d瑥t
佮le y潵ove 瑥牭楮r搠y潵爠潰rra瑩湧y獴敭 e摳Ⱐy潵o
睡猠晩牳琠se汥l獥搠楮‱㤹㐠慮搠煵dc歬y ca浥⁴桥 a摩dg 䱩湵i
Hat Package Manager
) is a
An RPM file
(package) is a way to distribute software s
can be easily installed, upgrad
d, and or
. It is one of the
most important features for Red Hat Linux
Red Hat discontinued the Red Hat Linux line in favor of
Red Hat Enterprise Linu
(RHEL) for enterprise environments. The
of RHEL is still
free, and has been
the basis for several other
such as Fe
dora which is
developed by the
and sponsored by Re
based, general purpose
, developed by the
supported and sponsored by
Its first release was in 2004 when Red
Hat Linux was discontinued and replaced by RHEL. Fedora's main objective is t
open source software
, and continue
o be on the leading edge of Linux
any people still
Fedora as Red Hat Linux.
many Linux distributions
, the authors
chose Fedora distribution to explore the
Linux system administration
Fedora was selected
its popularity in the Linux
free cost, its popular RPM software package management, its GNU and
GNOME GUI supports,
, and maintenance, and its
SELinux based security features.
Which Linux distribution has the largest marketshare?
The kernel is the heart of the Linux operating system just like any
The Linux kernel
layers as shown in Figure 1.2
At the base of the kernel, t
low level layer consists of hardware device drivers
layer consists of process management, memory management,
nd various other management modules
upper layer provides a
system call interface to Bash s
hell and other system program calls.
The core of the kernel operations is found in the middle layer. M
makes maximum use of
installed on a machine by
memory areas and swap space to accommodate multiple concurrent system
management is another important part of
kernel which creates
processes and implements multitasking by switching
processes. The kernel also
keeps track of files on the disk via file system management.
The network mana
kernel takes cares of packet handling
The Kernel runs your Linux and manages all system resources to support system
programs to access system hardware. It
tools with which
be built. These tools are acce
ssed via the system call interface.
accessing the hardware directly
At the lowest level, the kernel contains a hardware
device driver for each kind of
hardware such as hard disk and network devices it
n top o
he Linux kernel
services. Without these services
the kernel is
useless to users
User applications rely on services to request the kernel
on behalf of the
The services are written to take advantage of the system call
nterface provided by the kernel. This system allows users to perform a wide variety of
activities on the computer. For instance, issue commands at the
Linux command line to
manipulate file system t
o mount new drives,
daemon on Linux
Apache web server,
run shell script
the system administration task, or run
to type a letter
The Linux kernel space is divided into three layers. What are the
1.2 Linux Structure
Linux BASH Shell
There are two ways for a system
to perform administrative
: by Shell
command lines or by
will briefly discuss the Shell
command lines interface
. Future chapters
will explain the command line interface in
greater depth and explain how to use the GNOME GUI interface.
The command line interface
interact with a
s for system administrations are based on these shell
command lines. It is
junior system admin
understand how to use
shell command lines
how the Linux
. Most proficient system
prefer command line or shell scripts for system
ration jobs. Of
more user friendly.
the Shell is on the top of the Linux kernel
. Shell commands
use the system call interface to interact with the kernel on behalf of a user
shell is called "BASH
". The name comes from "Bourne Again S
Bourne refers to Stephen Bourne of Bell Labs.
users can use
Korn shell, C shell, Bo
can switch from one shell to
by typing the shell name
they want to switch to
. The Bash shell is the defa
lt shell for Linux.
System call interface
Memory, Network, Task schedule, File System, others
File system drivers, TCP/IP network drivers
BASH shell and Linux Utility
GNOME, KDE, Toolkits
Some Server Shell Commands
Later chapters will provide more details on shell programming. This chapter will only
present a very
brief overview. You can use shell commands just by typing the command
at the shell prompt or by writing a shell script containing one or more shell commands.
, the user types a s
ingle command (or a short sequence
y ; or | pipe separators ) and the result is displayed
can automate a complex job
He or she
text file just like the autoexec.bat file in DOS, then executes the
text file as a shell
w are a few examples of commands in Linux.
File system and disk management
reports the amount of free space on each partition.
the size of a given directory
and all sub
commands displays u
sers' disk usage and limits.
a list of all the mounted fil
systems on the system
is used to
mount a partition or device into
file system. Use
unmount a file or directory or device from system. In Linux, all dev
directories, and files are considered
command is used to install software on the server
on the server
the process running on
the server and
respective process ID.
the load on the server and lists
, sleeping process
, zombie process
the basic information about the uptime and load of
with its ID
on the server.
information about networ
the connection with a specified IP
the number of connections to the server
firewall commands can
block a particular IP from connecting to
can scan and discover passive services on a network to
secure the system.
The help system in Linux can be accessed by typing
at the prompt. The man
provides you access to an online Linux manual. If you are unsure of how to use
a Linux command type
followed by the command you would like explained.
example, the following
$ man ipconfig
an be used to
us options that can be used with a
command will be listed as well as an explanation of how the options are used.
The above list are just a few examples. These commands and a number of others will be
discussed in later chapters.
Shell Script Basics
A shell script is a plain
(just a convention)
You can execute
by typing its
by placing its name in another shell script.
Below is a very simple scrip
echo "Hello, W
command shows all the users who
If you typed this
script in a file and ran it, the script
orld!” followed by list of users
many system variables,
else or looping flow controls
The BASH acronym stands for what?
ation covers all tasks that are necessary to keep a system (or server) up
and running. The system administrator is the professional person in charge of system
administration to maintain and operate the system and network. In most cases
belongs to the IT department and reports to the CIO or director of the IT
department. The system administrator is one of the most important persons in the IT
department. He or she has the highest special privileges (root privilege) and duties.
technical knowledge of operating system
web, database, and other popular application pa
ckages. This person shoul
know the business nature of the organization, know how to manage staff team and
including the equipment acquisitions.
know how to diagnose, troubleshoot and quickly fix problems
The duties of a system administrator are wide
ranging, and vary widely from one
organization to another.
charged with installing
, securing, and
. He or she must
for and respond to service outages
nt policy and procedure, and handle legal
any other issue
s that arise
oncerning the system servers.
inistrator must have people skills to effectively communicate with users, in addition
necessary to deal with hardware and software problems. Technical
writing skills are often a challenge,
since they must document the system for users who
often lack the technical expertise possessed by the administrator.
Since the system administrator has great responsibility
it is important that an
administrator adhere to the highest ethical standards of
conduct at all times. System
policy and rules written in the policy documents o
is not a programmer he/she still needs a good
understanding of programming such as script
ing for administrative task automation.
some companies, the system admin
can also be a
system, and is responsible f
or the integrity of the data plus
y and performance of the syst
em. He or she may also
server services (such as
Apache) that allow for internal or external
access to web sites.
Figure 1.3 shows the environment surrounding the system administrator. The next four
iscuss these four aspects.
Responsibilities of the system administrator
The daily administrative job include
s resource usage and performance (CPU, memory,
disk, server load) monitoring, troubleshooting, task automation and automatic scheduling,
configuration of the servers and applications, user account management and user process
monitoring, and security checki
ng. Most of the routine administrative jobs should be
automated by scripting and scheduling.
2) Other common administrative tasks
may not need to be performed on a daily basis, but are still important
to keeping systems running. These i
Install, configure, support and maintain the hardware, peripherals, and network
Manage, schedule, implement, maintain and test operating system upgrades,
including new release upgrade
and patches in accordance with established IT
policies and pr
data/media recoverability by implementing a schedule of system backups
Plan, evaluate, purchase har
Develop and promote
standard operating procedures and enforce the polic
Manage Helpdesk problem tickets and respond t
o users with assistance or
Conducts routine hardware audits of servers and other assets
Establish Disaster Recovery strategies (Planning and implementation) that include
24 x 7 on call duties to respond to service outages and problems in cas
A system administrator is responsible for maintaining the software installed on servers
and sometimes on client machines as well. The system administrator’s responsibilities
related to software are listed below. Note that
this list does not include writing or
developing new software packages. A system administrator may need to do some systems
programming, but he or she should not be doing application programming.
Install, upgrade, and maintain web, databa
se, ftp, mail, an
d other server
Ensures workstation/server data
Evaluate, purchase, install, configure, and test software before deploying it for use
Manage software contracts and licenses
Ensure the firewall and other software
to protect the
Good communication with users is also a very important job for the system administrator.
The success of system administration can be evaluated based on the user’s satisfactio
system is useless without users. There are many different type
users surrounding the
systems such as application developers, fun
ction users, CIO and
O in a business
IT staff, students, faculty, and
staff in an academic envir
The system administrator should tell users what is being planned, what is
, and what has been done recently. This information can be communicated via e
, phone messages, paper memos, etc. All system users need to access sys
resources but the needs are quite different. The developer always requires many more
resources than end users. He or she needs a development server to conduct testing before
moving products to the production server. The developer also needs to access m
system software and application software than end users.
The system administrator should provide technical support to the users. Different types of
users will need different kinds of support and assistance. The system admin
needs to provi
de the environment support rather than solve every specific problem a user
The system administrator should also provide users with training on any newly installed
and upgraded system software and application software.
Documentation is one of the system administrator’s important duties, which should n
be ignored. It includes
, database server
, software, and
technical documents suc
h as ethics
code, system wide
policy and procedures
. All these must be recorded in eith
media or on paper
. The documentation should include the logs of document creation date
and persons or groups who made the document,
and the change track re
The system wide technical document should includes the layout of network and all
equipments, hardware configurations, software installed with its version and
configuration, and all upgrade information. These documents will
help the system
administrator retrieve information or keep track of all system wide changes. It will a
help any successor to more easily
if there are any personnel changes.
The ethics code may include issues related to honesty,
y, copyright, and license
The policy documents may cover
the user’s rights and responsibilities, in addition to the
administrator’s rights and r
esponsibilities. It should
what the administrators
and users are permitted to do
and what they are
not allowed to do. For instance,
the administrator is granted the right to look at other people’s private e
the policy document should state the level of service users can request and what the
offer, and the system resources allocated to each user, such as disk
space and e
The procedure document may specify the steps of action a user should take to accomplish
a certain task. These can be procedures for an application to assign a new
request a new resource, request service or
hnical support, request technical training, or
a meeting related to system issues. The system backup, problem report, and
software upgrading also have their procedures or guidelines to be follo
This book focuses on the technical aspect of system administration
which is listed as the
first two categories.
In the next section, you will practice installing the Fedora server, which includes the
Apache, MySQL and PHP that are inc
luded with Fedora
. We chose the
platform of Linux
, Apache, MySQL, PHP(LAMP) as the
theme of this book so that we
can practice all server site administration plus the very popular application servers such
as web server, database server, and server pages.
Does a system administrator need to have good people skills? Why
or why not?
Examples and Lab Practice
1.6.1 Fedora Pre
In this lab section we guide
you through the process of installing
server on 32
do not already have a Fedora 9
(One was provided with the text),
can download the software from
and burn your
own DVD. If you prefer to purchase a DVD, a n
umber of vendors sell disks, such as
Frozen Tech (
, Discount Linux
), and Lindistros (
). Price for a Fedora DVD including shipping should be less than ten dollars.
When ordering or downloading y
ou can choose
CD or DVD
instead of an
DVD. Live media
allows you to run directly from the distribution medium
hard drive. Note that to complete some of the exercises in the text
you will need to install Linux on writeable media
a hard drive or a USB drive
To install Fedora f
rom a DVD or run it using a live DVD, you will need to include the
DVD drive in the boot sequence of your PC. To configure your machine to boot from the
DVD you may need to change BIOS or CMOS settings.
To access the BIOS setup utility,
press the F2 key wh
en the machine is starting. Some machine
use keys other than F2
use whatever key your machine indicates for BIOS setup. If you do not see a message
during startup about which key to use for BIOS setup, try one of the common BIOS setup
keys, such as F1, F
10, esc and delete.
Before installing Fedora 9, you need to determine whether Fedora 9 is the only operating
system you want on a computer
or whether you want more than one operating system
installed. To allow a machine to boot a different operating syste
you will need to create
separate hard disk partitions for each operating system.
If there is a
on a computer
such as Windows XP, as long as there
more than 20GB
disk space available, you can perform the dual
partition installation with Fedora
need more than 20GB
on the size of applications to be
First, boot the machine from
DVD, and select the first opti
The Fedora 9 is the most current version of Fedora Linux operating system.
Skip the media test
because it takes a long time to complete
Click the Next button on the welcome screen.
as the language to use
Select “U.S. English” or other appropriate keyboard layout.
The next step, creating partitions for the Linux file system, is very important. Partitioning
divides the hard drive into isolated sections (partitions) where each partition acts as if
were a separate drive. If multiple operating systems co
exist on the same machine
each operating system requires at least one dedicated partition. Linux frequently uses
several partitions. Note the option at the base of the screen to “Review and m
To install Linux
you must have enough space for the operating system files to be placed.
To create a partition to hold the Linux files, there are
options shown on the next
screen. For the default layout with a small boot
section, select one of the first
If you prefer to customize your layout of the Linux file system rather than using
the default settings, select the last option.
If you want default file system layout
and either have an empty disk or desi
re to erase
everything on your existing disk
select the first option.
1) Swap partition
This partition provides
system with virtual memory. When there is not enough RAM
data is written to this swap partiti
Linux allows users to set the
. Common settings are the same size as the amount of RAM on machine or twice
the amount of RAM.
For example, if
a computer has
, the size of swap
1GB or 2GB.
Other values are le
gal and will affect performance. If the partiton
is being heavily used, you might want to consider increasing the amount of RAM on the
2) /boot partition holds the Linux kernel and bootstrap process files. The separated /boot
partition is for pro
tection of these import boot programs.
3) root(/) partition holds all system programs, application programs, user data, and
packages. It is about 5GB.
partition options are for default layout. The default file system for Fedora is
the ex3 f
ile system based on ex2. The ex3 system is easier for file system recovery from
ex2 system. You do not need to change this setting.
all partitions on the specified drives:
t will install the new system to
replace an existin
Option2) Remove Linux partition on the specified drives:
t will wipe out everything and
install a new system.
Allows one to resize existing part
existing partitions and uses
to create new partitions:
install the new system on free space and retain your current partitions.
operating systems such as Windows and Linux.
You can choose one of them to boot at machine start up time. If you don’
t have any
operating system installed on the machine, you can create
and leave enough space (20GB) for Fedora. Of course, you can add a new additional hard
disk drive, for example, an IDE drive, just for Fedora installation. T
his drive is assigned
is assigned to Windows partition. If you have two partitions on
hard drive, they are recognized as
You can install Fedora on an existing hard drive or partition
just tell the installation
m to install Fedora Linux in the designated drive (additional available disk drive)
or partition (available free partition on the same drive where other OS is installed in
Fedora even includes an option to resize existing partitions t
to install Fedora.
On the next screen, set
size to be
partition is for virtual memory.
It is used as an extension
if the computer runs
short of RAM.
Next, create a 100 MB
boot partition to hold the system boot program
Now create the system root (/) partition.
The three partitions created so far are default partitions and are created
Users can create additional partitions
The sequence of
is not important.
create a separate
home partition where each user stores his data and programs in
their own home directory so that
user data is placed in a separate partition from system
You may also want to create a /usr partition to
application programs shared by all
The size of each partition depends on your environment. For example,
the system has
large data and programs
then you need
to allocate much more
space for the /home partition.
Here is the
summary list after you configured
The following two screen shots show the
while to complete the disk writing.
, you decide on the boot loader. The
is used to load the operating
system. Without a boot diskette, a boot loader should be installed. When
starts, the BIOS reads the
master boot record
which is located in the first sector
024 bytes) of the hard disk. The master boot record holds a part of
or all of
loader program and the partition information table. With the read data the BIOS activates
the boot loader. The MBR can only hold one boot record for one operating syst
em due its
size. If you need to boot multiple operating systems
the system must use a boot
loader. The boot loader will determine which operating system to
and then transfers
the control to that system kernel software
the kernel then initial
the operating system.
LILO) and GRand Unified Boot loader
) are two popular boot
come with Linux distributions. The LILO is an older Linux boot loader.
GRUB is a newer boot loader
stalled by default. GRUB can
variety of open
source operating systems
as well as
proprietary operating systems. GRUB has
interactive command interface and supports booting from a network. GRUB can always
perform boot loading in its default command
even if the
is configured incorrectly.
Now, you need to
configure the network settings for the computer
efault setting is Dynamic
Host Configuration protocol (DHCP) where the IP address will be assigned by your Interface
(ISP) each time you have your own ISP. If you have an assigned IP
click on the Edit button to enter static IP configuration mode. Linux will detect the network
interface cards automatically and let you enter additional information by typing in val
allows you to enter a static IP
address and subnet mask to specify the host and network in
You can re
configure the machine to use a static IP address after you complete the
installation. If you do not know the address now
you can s
et it later.
If you are installing Fedora
on a machine in an academic lab as part of a course, ask your instructor what values to use for
your network settings.
Internet Protocol version 4
) is the fourth
is the first version of the protocol to be widely
Pv4 uses 32
which limits the
possible unique addresses.
rapidly growing number of computers connected to the Internet
addresses available; forcing the adoption of IPv6 that uses 128
bit addresses. We use IPv4 addresses in this text, since that is what is commonly in use
IPv4 uses dot
(22.214.171.124) to represents a
IP host address. The
host IP address and its subnet.
ext setting is for the network interface card configuration
the server’s gateway(to
access internet outside the LAN)
, the primary DNS and Secondary DNS. T
is used to convert host names into
detailed discussion of these setting
and their meaning
is provided in the
button at the top right
rk mask and
disable IPv6 support
. Then manually
and DNS servers
. Your numbers should not match those shown here
You have now
setting up networking on
is to set the
root account password here.
When you install Fedora Linux you can also include many application packages such as
ache Web server.
KDE GUI desktop software and
GNOME GUI software
ou can install many serv
er component packages
on the software packages screens
in other chapters
you will need
After selecting all the additional software packages that you would like
to install at this
launch the installation process
, by clicking Next
Congratulations! It too
you about 30
45 minutes to complete the entire Fedora
If you need to add more software packages after system installation
install them using GNOME: System
> Add/Remove Software or
using yum command.
reate a use
tasks that do not require
, it is safer to
regular user account instead of root a
account will be used in C
Set up system date and time.
Here is the first screen you will see after the system installation.
administration tasks can be perform
the GNOME desktop
. Look for system
1) Add Additional Users:
To complete the exercises in the next chapter
it will be helpful to have user
defined and a few additional accounts. Create t
hose now by logging in using the root
account. At the GNOME desktop
> Users and groups.
This will bring up a screen similar to the one below.
The user “john” you created in the
last section should already be listed.
reate two additional users:
in addition to
you created during
the install. Click the “Add User” button at the top of the screen and then fill out the form
The users you just will each belong to a group with the s
ame name as their user names.
Create a group named
and assign all three regular users (
this group. If you grant any access rights to
group for accessing files or directories,
members are granted the same privileges
After you have finished your listing of groups should look like the following. If you are
groups or users (these are the group members in the screenshot),
ould add the missing entries
2) Additional Configura
Some housekeeping configurations need to be taken care of after the installation. For
example, you need to edit
file to replace server1.example.com with your new
contains a mapping list of IP addresses and t
names that they correspond to. In general,
only contains entries for your
local machine, and perhaps your name server or gateway. Your local name server will
name mappings for other machines on the network, transparent
Edit /etc/hosts file to reflect this computer.
Fedora includes several text editors
not matter which you use. Gedit is easy to use and available from the menus:
>Text Editor. Alternatively, you can launch a termina
window and use vi, if you are familiar with this editor. To invoke vi, type:
the terminal window
[root@localhost etc]# vi /etc/hosts
Regardless of the editor
to use, you need
to add the fourth line. Use the IP
domain specification of your machine.
We used 192.168.1.93 and
host1.domain.com but you values will be different. Use the same values that you used in
the network configuration section.
Also adjust the local loopback address, 127.0.0.1 to
point to localhos
t as shown above. Eliminate references
The system consults th
e /etc/hosts file
to determine the
address that corresponds to a
, before consulting the DNS server for hostnames not included in the file.
to guarantee all other services
running, you need to disable the
by adding a line
ou can di
using the menus at the top of the
SELinux package provides extended security for Linux
which will be discussed in the
In some cases
you may also
need to temporarily
GNOME desktop and
After you finish configuring your networking and other configuration files, re
server so that
the changes ttake effect.
Reboot the server by including the
r reboot option
in the shutdown command:
commands include the /sbin directory in the
system environment variable
so that you can freely run many system commands
specifying the directory path.
The details will be discussed in the Linux environment
root@localhost etc]# echo $PATH
[root@localhost etc]# PATH=$PATH:/sbin
[root@localhost etc]# export PATH
command to check the configuration of the networ
k interface card
command to check the router configuration. The details of these
commands will be discussed in the networking chapter.
If the path command is not
specified as indicated above use would need to use
to run the commands.
eth0 Link encap:Ethernet HWaddr 00:1E:90:C1:3E:9D
inet addr:192.168.1.93 Bcast:255.255.255.255 Mask:255.255.255.0
inet6 addr: fe80::21e:90ff:fec1:3e9d/64 Scope
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:30131 errors:0 dropped:0 overruns:0 frame:0
TX packets:17709 errors:0 dropped:0 overruns:0 carrier:0
s:44321988 (42.2 MiB) TX bytes:1400710 (1.3 MiB)
Interrupt:22 Base address:0xa000
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
MSS Window irtt
168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0 0 0
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
0 0 0
0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0
0 0 0
This is the time to start up Apache, My
SQL, and PHP after the system installation.
You can launch command line terminal by:
At system prompt, check whether HTTP Apache
, PHP, and MySQL installation are in
using the rpm command
screen below. If the necessary files are not
in place, you can use yum to install all LAMP relevant packages as shown below.
One you have verified the software is install
ed, start the mysqld service for MySQL and
the httpd service for Apache.
Alternatively, you can
Add/Remove Software manager
to search for and
as shown below
Menu Location is: System
ext step is to start up the all relevant daemon and services and list their run
The service run level 0
8 will be discussed in detail later in the text.
You can use graphical tool
by typing netsysv at
terminal prompt to
is working correctly on your computer
. Apache HTTP server comes
with PHP module which will start when
If you use any Web browser to
you should see the PHP default page. It tells you that the Web
server is up running.
The Apache has its default virtual root directory at /var/www/html as shown here.
Since it is the root directory, if you wa
nt to access the
in this directory, you don’t
need to specify the full directory path. Enter
for the address in
your Web browser.
are connected to a network or
be a Windows
machine) connected to this server with Ethernet cable, you can use ping
to check the
network is working and allowing connections.
also be able to
e default page
be specifying the IP address
of your server
You can also install an optional GUI PHP admin package
administering a MySQL database easier.
If you do not do it now, you will install it in
chapter 9 to complete some of t
he exercises in that chapter.
, check the
installation of the
. We will use the DBA root
account for this test. Root is a fully privileged account created during the installation o
MySQL. In MySQL the root account does not have a password initially, but it is strongly
recommended that you assign it a password when you login. Assigning the password will
be covered in Chapter
Log in to your MySQL server by typing “mysql
” at the shell prompt. If you
succeed in connecting to the Server
you should get a welcome message and the
“mysql>” prompt. You can get out of mysql by typing exit at the mysql> prompt.
MySQL also provides an administration utility,
to help i
n configuring and
maintaining a database server. For help in using this utility, type “mysqladmin
Linux shell prompt.
Linux is a freely distributed, multitasking, multi
like operating system.
use Fedora in this book be
cause it is
widely used, runs on PCs, and is
Because of the
similarity between Linux and UNIX, if you master system administration in Linux you
will also be able to administer
s. You can even apply
the system administ
ration principles learned on Linux to administering
although some of the actual commands used to administer Windows require a different
syntax or have different names
The target audience of this book i
s IT students they may become
information system managers, directors of IT department
s, and other high rank
IT related areas. Therefore
we discussed the duty and scope of system
administrator and aspects of system administrative tasks. The system
s to have
technical knowledge of system administration, but also needs to have
people skills, technical writing skills, and management skills.
In this chapter, we discussed the selection of various Linux distributions based on the
larity, usage(client/server), GUI interface availability, cost, software package
support, and other attributes and features.
Linux kernel, Linux shell, and shell scripts.
In the last section
step by step directions
walked you through
the installation of
with Apache web server, MySQL
database server, and PHP
. The use of
was explained. You also
used Fedora’s graphical interface
to create users and groups.
The successful Fedora
the ability to continue with the material in coming
hich Linux distribution is best known for its LiveCD
The leader free open source Linux distribution is
GNOME, as a component of GNU project, is to provide free user friendly desktop
x is Unix
Linux user can’t access hardware directly from command line, must use shell .
The default Linux shell is .
a. Korn shell
b. C shell
d. Bash shell
A system admin only nee
d to have technical administrative skills
Web and database administration may also be part of system admin’s duty depending
on the company and
Most Linux server operations require root privilege
The default Linux shell is
a. Korn shell
b. C shell
d. Bash shell
The number of partitions in the Linux standard installation is
/usr partition is used to hold all
user home directories
The “/” partition is the home directory of the root user.
The /sbin must have its own partition because many important comands are available
User and group management task
s can be done either by Linux command lines or by
GNOME desktop of
Which one is name of a partition
PHP is a Web server
PHP must have support of Apache i
One user can be assigned to multiple user groups
A server should have its static IP instead of using
Dynamic Host Configuration
Download a Linux LiveCD or LiveDVD and boot this Linux from the media wh
Linux is loade
2. Install a dual boot Fedora Linux co
existing with Windows on separate partitions on
the same machine.
3. Install a server vers
ion Fedora follo
wing the tutorial in the lab section of this chapter
manual utility to find the detailed descript
ions of the shell commands listed in
the shell section of this chapter.
5. Run each shell command listed in the shell section of this chapter.
from one shell to another shell and come back to default shell
7. Display the current shell using
$<shell variable> command
8. Login yourself as
, create a user, then logout the root user, login as the user you
editor by yourself, please reference
10. Run your first shell script.