Escolar Documentos
Profissional Documentos
Cultura Documentos
Linux Administration
Level II
Welcome
Please...
Pick Up Materials at the Front...
Workbook
Notebook
Housekeeping Information
Roll Call
Course Times
Refreshments -Time / Locations
Drinks OK / No Food in Classroom
Workbook Page 1
Housekeeping Information
Washroom Locations
No Smoking Indoors
Temperature Control
Fire Exit Locations
Please Recycle
Introductions
Name / Company Name / Duties
Computer / Networking Experience
Linux Experience
System Administrator Experience
Expectations
Reasons for Taking Class
Course Outline
Install Software
Source *
RPM's
yum / yast
Kernel Updates and Customization
Update the Kernel
Customize and Compile Kernel
Workbook Page 2
Outline
Library Management
Software Install Practice
Setup servers as time permits
Mail, Web, FTP, Samba, etc.
Technical Role
System Administrator
Technical Support
Power User Role
Command-line Oriented
Workbook Page 3
Introduction and Course Overview
10
Software Installation
11
Software Installation
Linux Architecture
Sarwar, Koretsky & Sarwar p22
Static and Dynamic linking
12
Workbook Page 4
Applications
Shell(s)
Libraries
API
In te rp ro ce ss
Co m mu n ica tio n
F ile ( IP C)
Mama ge me nt
Kernel P ro ce ss M a n a g e m e n t
P rim a ry a n d S e co n d a ry
S to ra g e M a n a g e m e n t
CP U
S ch e d u le r
Device Drivers
13
Software Installation
Software Sources
Free Software Foundation
Your Distro's Site
Project Sites: Source Forge, Freshmeat, etc
Commercial Sources
etc, etc
Security Issues
File integrity
Signatures / Message digests 14
Software Installation
Methods...
Install Binary files (executables)
RPM Binaries, yum, yast
Debian package management
dpkg / apt-get tool
15
Workbook Page 5
Software Installation
Methods...
Install from Source Code
Tarballs
RPM Source Packages
Debian package management Packages
16
Software Installation
Techniques
RPM (Redhat Package Management)
Query packages
Install / Update / Freshen package
Erase packages
17
Software Installation
Techniques
yum / yast / others
Front-end for RPM
Databases (repositories) of files
Meta-data stores
Check dependencies
18
Workbook Page 6
Software Installation
Techniques
Compile Source Code
19
Software Installation
Comprehensive Development-Management
Packages
http://www.eclipse.org/
20
Software Installation
Techniques
Finding Installed Software
whereis, which
chkconfig
find, locate
rpm, yum, yast
21
Workbook Page 7
Installation from Source
22
23
[periodic updates]
24
Workbook Page 8
Installation from Source
25
Source Formats
Source RPMs
Tarballs*
Developer's Source Directory Tree
encapsulated with tar
compressed with gzip
26
(newer ...)
27
Workbook Page 9
Installation from Source
28
tar command
tar -t list archive
tar -c create archive
tar -x extract from archive
tar -d show differences
etc
compression
z = gzip; j = bzip2
29
30
Workbook Page 10
Installation from Source
exit 0
31
33
Workbook Page 11
Installation from Source
34
/<packageX>.tar.m+.n+/
less README
less INSTALL
35
36
Workbook Page 12
Libraries
37
Software Installation
Libraries
Statically Linked Libraries
create stand-alone programs don't rely on user
having particular libraries installed, but...
increase program size
consume memory if several programs are concurrently
using their own copy of a library
each program using a statically linked library requires
manual, individual recompile; a functionality and security
concern.
38
Software Installation
Libraries
Dynamically Linked (Shared) Libraries
Many programs can share one block of code
Saves storage
Improves efficiency and effectiveness of updates
39
Workbook Page 13
Software Installation
Libraries
Dynamically Linked (Shared) Libraries
ldd shows libraries required by an application
Running a program invokes ld.so (old a.out) or ld-
linux.so* (new ELF) which finds and loads the
shared libraries needed by the program, prepares
the program to run, and then runs it.
40
Software Installation
Libraries
Dynamically Linked (Shared) Libraries
These runtime shared object (.so) dynamic linkers
try to satisfy dependencies from information in:
binary index cache /etc/ld.so.cache and
environmental variable LD_LIBRARY_PATH which is a
colon delimited list of directories
41
Software Installation
Libraries
Working with Dynamic Libraries
ldconfig updates binary index cache
/etc/ld.so.cache from:
files in /lib/ and /usr/lib/
/etc/ld.so.conf.d
files in directories in ldconfig's command line [transient]
Workbook Page 14
Software Installation
Glossary
Compile / Compiler
Assemble / Assembler
Object Code
Libraries
Link / Linker
Static Links / Dynamic Links
Binaries (Executables)
43
Kernel Updates
44
Kernel Updates
Workbook Page 15
Kernel Updates
46
Kernel Updates
47
Kernel Updates
48
Workbook Page 16
Kernel Updates
49
Kernel Updates
50
Kernel Customization
51
Workbook Page 17
Kernel Customization
Version Numbering
2.4.21-13mdk
52
Kernel Customization
Rationale
Light-weight Kernel...
just the right built-in drivers and configuration
performance tuning
53
Kernel Customization
Workbook Page 18
Kernel Customization
55
Kernel Customization
.config file
back up original
[make oldconfig] makes a default file
Make custom .config file with one of:
make config
make menuconfig
make xconfig
Or, copy a canned file from /usr/src/<kernel-m.n>/configs/ \
/usr/src/<kernel-m.n>/.config ; make oldconfig
56
Kernel Customization
.config options:
M install as module
Y compile into kernel
N don't compile-in; no module support
57
Workbook Page 19
Kernel Customization
58
Kernel Customization
59
Kernel Customization
60
Workbook Page 20
Manage Kernel Modules
61
Monolithic Kernels
all support is built-in
negative: too many / too few modules
negative: driver updates require recompile
Modular Kernels
module support is dynamically installed as
needed
Linux supports both methods
62
63
Workbook Page 21
Manage Kernel Modules
64
Interface Configuration
Module Management
edit /etc/modules.conf to use <tag option>. Add:
path= /lib/modules/<kernel-version>/kernel/drivers/
lsmod list installed modules
rmmod remove installed modules (-sa)
modinfo module information (-alpdv)
insmod install module (-sv)
65
Module utilities
lsmod list loaded modules
insmod insert module into kernel
insmod -s -v mod_name
-s=log to syslog; -v=verbose
Watch for unsatisfied dependencies
rmmod remove module from kernel
rmmod -s -a mod_name
-s=log to syslog; -a=all unused modules
66
Workbook Page 22
Manage Kernel Modules
Module utilities
modinfo display module's information
modinfo -a -d -p mod_object_file
-a=author; -d=description; -p=typed parameters
-l=licence; -v=version; etc
67
Module utilities
modprobe load modules, dependencies, etc
modprobe [options] module [symbol=value ...]
modprobe=insmod + more (a wrapper)
options
-v = verbose
-a = all probes all modules
-a -t <tag> probes all modules in <tag>
-s = log to syslog
68
Module utilities
modprobe load modules, dependencies, etc
options
-l [-t <tag>]= list modules [in <tag>]
-r = remove module ...
-c = display complete module configuration [including
/etc/modules.conf (/etc/conf.modules)]
69
Workbook Page 23
Network Servers
70
Network Servers
Time Permitting...
WebMin
Cups
Web Server
FTP Server
Samba Server
71
Web Server
72
Workbook Page 24
Web Server
Apache 2.0
Download from www.apache.org
to: ~clientxx/downloads
check md5sum, sha1sum, pgp signature
Extract Source
tar -zxvf httpd-m.n.tar.gz
cd to httpd-m.n
73
Web Server
Apache 2.0
Read supplied documentation
README (not much)
INSTALL (useful Quick Install)
Read full Install Instructions
httpd.apache.org/docs-2.0/install.html
Follow 'overview for the impatient' instructions
74
Web Server
Apache 2.0
Observe Directives
./configure help | more
Start Apache
/usr/local/apache2/bin/apachectl start
Test Apache
ps -ef | grep httpd
lynx localhost
browse from alien machine: http://<hostIP>
75
Workbook Page 25
Web Server
Apache 2.0
Starting Apache at bootup
in /etc/rc.d/rc.local
/usr/local/apache2/bin/apachectl -k start
76
Web Server
Apache 2.0
Starting Apache at bootup (2)
in /etc/rc.d/init.d
script file: httpd (see notes)
in .../rc[35].d
symbolic link: Sxxhttpd > /etc/rc.d/init.d/httpd
77
Web Server
Apache 2.0
Install sample site
78
Workbook Page 26
FTP Server
79
FTP Server
wu-ftpd www.wu-ftpd.org
note documentation links
FAQ
Example Configuration Files
HowTo's
Resource Centrehttp://www.landfield.com/wu-
ftpd/
80
FTP Server
wu-ftpd
download current version tarball to:
/opt/wu-ftpd
login to user account (non-root)
tar -zxvf wu-ftpd-<version>
cd to wu-ftpd-<version>
Read README and INSTALL** (alternate
method)
81
Workbook Page 27
FTP Server
Compile wu-ftpd
./configure
make
make install (as super user)
Setup xinetd (Super Daemon)
/etc/hosts.allow
in.ftpd: 192.168.1.
82
FTP Server
83
FTP Server
/home/ftp/public
/home/ftp/incoming (1777)
chown -R root:wheel /home/ftp
84
Workbook Page 28
FTP Server
85
FTP Server
86
FTP Server
87
Workbook Page 29
FTP Server
88
FTP Server
Other Files
/etc/ftphosts
allow user-name address
/etc/ftpusers (deny access to...)
root. admin, etc
89
FTP Server
Other Files
/var/log/xferlog
90
Workbook Page 30
FTP Server
Other Programs
ftpshut -l 10 -d5 2300 message
rm /etc/shutmsg to restart
OR ftprestart
ftpwho
91
Mail Server
92
Mail Server
Sendmail
Postfix
qMail
93
Workbook Page 31
Samba File System
94
Samba
95
Thank You
96
Workbook Page 32
Legal Stuff
This Presentation file is Copyright 1999 - 2012 by Jim
Stevenson. All rights are reserved.
This presentation is provided for the private use of students
who have taken this course as an aid in the study and review of
the material covered. The student is permitted to view the slides
and/or print the slides for their private use only. No other use of
the material is permitted, including, but not limited to:
duplicating slides, notes, or the entire file; using the materials in
training sessions or other group events; lending of the materials
to other persons or groups; incorporating these materials into
other slide shows or printed works.
Permission to use these materials in ways other than described
above may be granted (perhaps for a fee). Contact Jim
Stevenson at (780)487-7743; jim.stevenson@shaw.ca
97
Workbook Page 33