1 tac2000/2000.7 802.16 ip telephony lab advanced linux administration language: offered in english...

13
1 TAC2000/2000.7 802.16 IP Telephony Lab Advanced Linux Administration •Language: Offered in English •Instructor: Dr. Quincy Wu ([email protected]) •Time: Tuesday 17:30-20:00 •Place: Computer Center 027

Upload: baldric-dennis

Post on 26-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 TAC2000/2000.7 802.16 IP Telephony Lab Advanced Linux Administration Language: Offered in English Instructor: Dr. Quincy Wu ( solomon@2010.ipv6.club.tw

11 TAC2000/2000.7

802.16 IP Telephony Lab

Advanced Linux Administration

•Language: Offered in English

•Instructor: Dr. Quincy Wu ([email protected])

•Time: Tuesday 17:30-20:00

•Place: Computer Center 027

Page 2: 1 TAC2000/2000.7 802.16 IP Telephony Lab Advanced Linux Administration Language: Offered in English Instructor: Dr. Quincy Wu ( solomon@2010.ipv6.club.tw

22 TAC2000/2000.7

802.16 IP Telephony Lab

Reading Requirement TextbookTextbook

Nate Campi and Kirk Bauer, "Automating Linux and UNIX System Nate Campi and Kirk Bauer, "Automating Linux and UNIX System Administration", 2nd Ed. Publication: Berkeley, Calif., New York Administration", 2nd Ed. Publication: Berkeley, Calif., New York Springer Science & Business Media, 2009. (NCNU NetLibrary) Springer Science & Business Media, 2009. (NCNU NetLibrary)

ReferencesReferences Online manpageOnline manpage GNU InfoGNU Info Linux Documentation Project (http://tldp.org/LDP/)Linux Documentation Project (http://tldp.org/LDP/) LAMP: The Open Source Web Platform (http://www.onlamp.com/)LAMP: The Open Source Web Platform (http://www.onlamp.com/) Librenix - Linux Sysadmin Portal (http://www.librenix.com/)Librenix - Linux Sysadmin Portal (http://www.librenix.com/) Linux Magazine (http://www.linux-mag.com/)Linux Magazine (http://www.linux-mag.com/) Linux Journal (http://www.linuxjournal.com/) Linux Journal (http://www.linuxjournal.com/)

Page 3: 1 TAC2000/2000.7 802.16 IP Telephony Lab Advanced Linux Administration Language: Offered in English Instructor: Dr. Quincy Wu ( solomon@2010.ipv6.club.tw

33 TAC2000/2000.7

802.16 IP Telephony Lab

Three Hours in Each Week Chapter presentation (60min)Chapter presentation (60min) Package introduction (45min*2)Package introduction (45min*2) Hands-on and free Q&A Hands-on and free Q&A

In addition to the 3 hours in class, you also need to spendIn addition to the 3 hours in class, you also need to spend 3 hours in reading the textbook3 hours in reading the textbook 3 hours to try installing and configuring new services3 hours to try installing and configuring new services 3 hours to read on-line documents3 hours to read on-line documents

Page 4: 1 TAC2000/2000.7 802.16 IP Telephony Lab Advanced Linux Administration Language: Offered in English Instructor: Dr. Quincy Wu ( solomon@2010.ipv6.club.tw

44 TAC2000/2000.7

802.16 IP Telephony Lab

Evaluation Homework (30%)Homework (30%) Oral Presentation (30%)Oral Presentation (30%) Participation (20%)Participation (20%) Term Project (20%) Term Project (20%)

Active participation is expected. Everyone must ask/answer Active participation is expected. Everyone must ask/answer questions during a presentation.questions during a presentation.

Page 5: 1 TAC2000/2000.7 802.16 IP Telephony Lab Advanced Linux Administration Language: Offered in English Instructor: Dr. Quincy Wu ( solomon@2010.ipv6.club.tw

55 TAC2000/2000.7

802.16 IP Telephony Lab

Outline Introducing the Basics of Introducing the Basics of

AutomationAutomation Basic ToolsBasic Tools Using SSH to Automate System Using SSH to Automate System

Administration SecurelyAdministration Securely Configuring Systems with Configuring Systems with

cfenginecfengine Creating Login Scripts and Shell Creating Login Scripts and Shell

ScriptsScripts Pre-Installation: Network Pre-Installation: Network

Preparation and ManagementPreparation and Management Automating and Customizing Automating and Customizing

InstallationInstallation Automatic System ConfigurationAutomatic System Configuration

Sharing Data Between SystemsSharing Data Between Systems Packages and PatchesPackages and Patches System Maintenance and ChangesSystem Maintenance and Changes Generating Reports and Analyzing Generating Reports and Analyzing

LogsLogs System MonitoringSystem Monitoring Improving System SecurityImproving System Security Backing Up and Restoring DataBacking Up and Restoring Data User InterfacesUser Interfaces

Page 6: 1 TAC2000/2000.7 802.16 IP Telephony Lab Advanced Linux Administration Language: Offered in English Instructor: Dr. Quincy Wu ( solomon@2010.ipv6.club.tw

66 TAC2000/2000.7

802.16 IP Telephony Lab

Any Question So Far?

Page 7: 1 TAC2000/2000.7 802.16 IP Telephony Lab Advanced Linux Administration Language: Offered in English Instructor: Dr. Quincy Wu ( solomon@2010.ipv6.club.tw

77 TAC2000/2000.7

802.16 IP Telephony Lab

Importance of Automation You can configure everything by hand, if you only manage 2 or You can configure everything by hand, if you only manage 2 or

3 computers.3 computers. As the number of systems grows to more than ten, you need to As the number of systems grows to more than ten, you need to

spend time repeating the same things over and over again.spend time repeating the same things over and over again. During the so- called “tech downturn” around the year 2003 in During the so- called “tech downturn” around the year 2003 in

Silicon Valley, you may suddenly find yourself the sole member Silicon Valley, you may suddenly find yourself the sole member of what had been a three- person system- administration team. of what had been a three- person system- administration team. The number of systems and responsibilities were increasing, while The number of systems and responsibilities were increasing, while

staffing levels had dramatically decreased.staffing levels had dramatically decreased.

Page 8: 1 TAC2000/2000.7 802.16 IP Telephony Lab Advanced Linux Administration Language: Offered in English Instructor: Dr. Quincy Wu ( solomon@2010.ipv6.club.tw

88 TAC2000/2000.7

802.16 IP Telephony Lab

Tools in This Book The Bash shellThe Bash shell PerlPerl CfengineCfengine Regular expressionsRegular expressions The The grepgrep command command The The sed sed stream editorstream editor AWKAWK

Page 9: 1 TAC2000/2000.7 802.16 IP Telephony Lab Advanced Linux Administration Language: Offered in English Instructor: Dr. Quincy Wu ( solomon@2010.ipv6.club.tw

99 TAC2000/2000.7

802.16 IP Telephony Lab

Do You Need Automation? If you have only one system sitting on your desk at home, you can do If you have only one system sitting on your desk at home, you can do

everything manually.everything manually. Many people do.Many people do.

But, consider routine tasks such asBut, consider routine tasks such as Performing backupsPerforming backups Apply security updatesApply security updates Uninstall a packageUninstall a package

If you have used RPM (RedHat Package Manager), you know how useful it is.If you have used RPM (RedHat Package Manager), you know how useful it is. Log file rotationLog file rotation

See an example under /var/logSee an example under /var/log The “logrotate” utility on LinuxThe “logrotate” utility on Linux

Database updateDatabase update Run “updatedb” command periodically to generate most up-to-date Run “updatedb” command periodically to generate most up-to-date

“/var/lib/mlocate/mlocate.db” to be search by the command “locate”.“/var/lib/mlocate/mlocate.db” to be search by the command “locate”.

All these tasks and more can happen quietly and automatically from within a All these tasks and more can happen quietly and automatically from within a standard UNIX or Linux system.standard UNIX or Linux system.

Page 10: 1 TAC2000/2000.7 802.16 IP Telephony Lab Advanced Linux Administration Language: Offered in English Instructor: Dr. Quincy Wu ( solomon@2010.ipv6.club.tw

1010 TAC2000/2000.7

802.16 IP Telephony Lab

Do You Need Automation? (cont.) Automation is already a core part of UNIX philosophy, and cron Automation is already a core part of UNIX philosophy, and cron

jobs have historically been the de facto method for automating jobs have historically been the de facto method for automating UNIX tasks.UNIX tasks. If a disk fills, set up a log- rotation script run from cron that deletes If a disk fills, set up a log- rotation script run from cron that deletes

unneeded temporary files—whatever addresses the root cause. unneeded temporary files—whatever addresses the root cause. If a process dies, set up a process monitor to restart it when it exits. If a process dies, set up a process monitor to restart it when it exits.

In later chapters, we will show you how to accomplish these In later chapters, we will show you how to accomplish these tasks.tasks.

Page 11: 1 TAC2000/2000.7 802.16 IP Telephony Lab Advanced Linux Administration Language: Offered in English Instructor: Dr. Quincy Wu ( solomon@2010.ipv6.club.tw

1111 TAC2000/2000.7

802.16 IP Telephony Lab

What Will You Gain? Saving TimeSaving Time Reducing ErrorsReducing Errors Documenting System Configuration PoliciesDocumenting System Configuration Policies

Page 12: 1 TAC2000/2000.7 802.16 IP Telephony Lab Advanced Linux Administration Language: Offered in English Instructor: Dr. Quincy Wu ( solomon@2010.ipv6.club.tw

1212 TAC2000/2000.7

802.16 IP Telephony Lab

What Do System Administrators Do? Tedious, repetitive tasks (a.k.a. boring tasks)Tedious, repetitive tasks (a.k.a. boring tasks) New, innovative tasks (a.k.a. why you love the job)New, innovative tasks (a.k.a. why you love the job) Answering users’ questions, or otherwise dealing with Answering users’ questions, or otherwise dealing with

monitoring alarms, issues or emergencies (a.k.a. pulling your monitoring alarms, issues or emergencies (a.k.a. pulling your hair out)hair out)

The goal of this class is to help you create new and innovative The goal of this class is to help you create new and innovative solutions to eliminate those tedious and repetitive tasks. solutions to eliminate those tedious and repetitive tasks.

Moreover, you will learn how to create a system that detects and Moreover, you will learn how to create a system that detects and fixes many problems before they come to the attention of the fixes many problems before they come to the attention of the users.users.

Page 13: 1 TAC2000/2000.7 802.16 IP Telephony Lab Advanced Linux Administration Language: Offered in English Instructor: Dr. Quincy Wu ( solomon@2010.ipv6.club.tw

1313 TAC2000/2000.7

802.16 IP Telephony Lab

Homework #1 Use VirtualBox to create a virtual machine on your desktop.Use VirtualBox to create a virtual machine on your desktop.

If you have limited memory on your desktop PC, you may want to If you have limited memory on your desktop PC, you may want to request a lower amount of memory (e.g. 256MB) for the virtual machine.request a lower amount of memory (e.g. 256MB) for the virtual machine.

Install CentOS 5.4 on it.Install CentOS 5.4 on it. Choose “Red Hat” as the OS type. Don’t choose 64-bit type.Choose “Red Hat” as the OS type. Don’t choose 64-bit type.

Read some documents to know the difference between “find” Read some documents to know the difference between “find” and “locate”.and “locate”.