Tải bản đầy đủ (.pdf) (835 trang)

IT training opensuse 11 0 and suse linux enterprise server bible 9780470275870 38082

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (22.15 MB, 835 trang )


Whittaker

ffirs.tex

®

V2 - 06/18/2008

OpenSUSE 11.0
and SUSE
Linux Enterprise
Server Bible
®

®

3:59pm

Page i


Whittaker

ffirs.tex

V2 - 06/18/2008

3:59pm

Page ii




Whittaker

ffirs.tex

V2 - 06/18/2008

®

OpenSUSE 11.0
and SUSE
Linux Enterprise
Server Bible
®

®

Roger Whittaker
Justin Davies

Wiley Publishing, Inc.

3:59pm

Page iii


Whittaker


OpenSUSE

®

11.0 and SUSE

®

ffirs.tex

V2 - 06/18/2008

3:59pm

Linux® Enterprise Server Bible

Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2008 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-470-27587-0
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or
by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted
under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600.
Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing,

Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, or online at
/>Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or
warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained
herein may not be suitable for every situation. This work is sold with the understanding that the publisher
is not engaged in rendering legal, accounting, or other professional services. If professional assistance is
required, the services of a competent professional person should be sought. Neither the publisher nor the
author shall be liable for damages arising herefrom. The fact that an organization or Website is referred to
in this work as a citation and/or a potential source of further information does not mean that the author
or the publisher endorses the information the organization or Website may provide or recommendations it
may make. Further, readers should be aware that Internet Websites listed in this work may have changed
or disappeared between when this work was written and when it is read.
For general information on our other products and services or to obtain technical support, please contact
our Customer Care Department within the U.S. at (800) 762-2974, outside the U.S. at (317) 572-3993 or
fax (317) 572-4002.
Library of Congress Cataloging-in-Publication Data:
Whittaker, Roger, 1955OpenSUSE 11.0 and SUSE Linux enterprise server bible / Roger Whittaker, Justin Davies.
p. cm.
Includes index
ISBN 978-0-470-27587-0 (paper/dvd)
1. Linux. 2. Operating systems (Computers) I. Davies, Justin, 1979- II. Title.
QA76.76.O63W488 2008
005.4’32 — dc22
2008014649
Trademarks: Wiley, the Wiley logo, and related trade dress are trademarks or registered trademarks of
John Wiley & Sons, Inc., in the United States and other countries, and may not be used without written
permission. OpenSUSE and SUSE are registered trademarks of Novell, Inc. Linux is a registered trademark
of Linus Torvalds. All other trademarks are the property of their respective owners. Wiley Publishing, Inc.,
is not associated with any product or vendor mentioned in this book.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may
not be available in electronic books.


Page iv


Whittaker

ffirs.tex

V2 - 06/18/2008

To Shekufeh and Golnaz, who tolerate all this — Roger Whittaker
To my wife, Aimee — Justin Davies

3:59pm

Page v


Whittaker

ffirs.tex

V2 - 06/18/2008

3:59pm

Page vi


Whittaker


fauth.tex

V2 - 06/18/2008

5:34pm

About the Authors
After working as a teacher of Mathematics and as Deputy Head of an independent school in
London, Roger Whittaker discovered Linux in 1996 and became increasingly interested (some
would say obsessed). When SUSE Linux opened its UK office in 1999, he changed careers and
worked as a technical and training consultant until early in 2004. He now works for Novell
supporting Linux installations for large customers. He is Newsletter Editor for UKUUG, the UK’s
Unix and Open Systems user group.
Justin Davies has been a Linux user since the age of 15. After University, he joined SUSE Linux
as a Technical Consultant where he specialized in Linux on non-Intel architecture. He then
spent time working with value-added resellers in Europe to define their open source strategy
and go-to-market plans around Linux. He is now the founder and CTO of Ninetyten, a social
networking consultancy based in London, where he is still providing solutions based on open
source software.

Page vii


Whittaker

fauth.tex

V2 - 06/18/2008


5:34pm

Page viii


Whittaker

fcre.tex

V2 - 06/18/2008

5:35pm

Credits
Acquisitions Editor
Jenny Watson

Production Manager
Tim Tate

Development Editor
Gus A. Miklos

Vice President and Executive Group
Publisher
Richard Swadley

Senior Development Editor
Kevin Kent
Technical Editor

Warren E. Wyrostek
Production Editor
Daniel Scribner

Vice President and Executive Publisher
Joseph B. Wikert
Project Coordinator, Cover
Lynsey Stanford

Copy Editor
Nancy Rapoport

Proofreader
Josh Chase, Word One

Editorial Manager
Mary Beth Wakefield

Indexer
Ron Strauss

Page ix


Whittaker

fcre.tex

V2 - 06/18/2008


5:35pm

Page x


Whittaker

cag.tex

V2 - 06/18/2008

7:12pm

Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxix
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxi
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxiii

Part I: SUSE Linux Basics
Chapter 1: Installing SUSE ................................................................................................................3
Chapter 2: Linux Fundamentals .....................................................................................................47
Chapter 3: Partitions, Filesystems, and Files ..................................................................................77

Part II: The SUSE System
Chapter
Chapter
Chapter
Chapter
Chapter
Chapter


4:
5:
6:
7:
8:
9:

Booting the System .....................................................................................................109
Documentation ............................................................................................................139
Understanding Your Linux Network ..........................................................................159
Logging ........................................................................................................................175
The X Window System ...............................................................................................193
Configuring the System with YaST ............................................................................ 225

Part III: Using the Command Line in SUSE Linux
Chapter
Chapter
Chapter
Chapter
Chapter
Chapter

10:
11:
12:
13:
14:
15:

Text Manipulation .....................................................................................................269

Text Editors ...............................................................................................................297
Working with Packages ............................................................................................319
Working with Files ...................................................................................................347
Working with the System .........................................................................................379
Linux Networking .....................................................................................................411

Part IV: Implementing Network Services in SUSE Linux
Chapter
Chapter
Chapter
Chapter
Chapter
Chapter
Chapter
Chapter
Chapter
Chapter
Chapter

16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:


Setting Up a Web Site with the Apache Web Server ..............................................447
Mail Servers — Postfix, Sendmail, Qpopper, and Cyrus ........................................469
Setting Up Windows Interoperability with Samba ..................................................503
Setting Up Printing with CUPS ................................................................................521
Configuring and Using DHCP Services ....................................................................541
Configuring a DNS Server ........................................................................................559
Working with NFS ................................................................................................... 577
Running an FTP Server on SUSE .............................................................................589
Implementing Firewalls in SUSE Linux ...................................................................601
Network Information and Directory Services ..........................................................621
Setting Up a Web Proxy with Squid ........................................................................647

xi

Page xi


Whittaker

cag.tex

V2 - 06/18/2008

7:12pm

Contents at a Glance

Part V: SUSE Linux in the Enterprise
Chapter

Chapter
Chapter
Chapter

27:
28:
29:
30:

Enterprise Architecture .............................................................................................659
Emulation and Virtualization ................................................................................... 685
The Kernel ................................................................................................................ 713
Business Desktop Linux: SLED ................................................................................729

Appendix A: What’s on the DVD .................................................................................................737
Index ..............................................................................................................................................739

xii

Page xii


Whittaker

ftoc.tex

V2 - 06/18/2008

7:13pm


Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxix
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxi
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxiii

Part I: SUSE Linux Basics
Chapter 1: Installing SUSE . . . . . . . . . . . . . . . . . . . . . . . . . 3
Selecting Your Installation Method ...................................................................................4
Starting Your Installation ................................................................................................... 5
Selecting Boot Options ..................................................................................................6
Configuring Language Settings ..................................................................................... 8
Installation Mode ............................................................................................................... 11
Customizing the Installation ............................................................................................12
Selecting Your Desktop Environment .........................................................................13
Partitioning Your Disks ...............................................................................................14
Resizing Existing Operating System Partitions ...........................................................16
Primary and Extended Partitions ................................................................................17
Defining Filesystems ....................................................................................................18
Creating a User ............................................................................................................23
Installation Settings .....................................................................................................24
Customizing Your Installation .................................................................................... 24
Selecting Software for Installation ...............................................................................25
Selecting a Boot Loader ...............................................................................................28
Changing the Default Runlevel ...................................................................................31
Running the Installation ................................................................................................... 32
Configuring Your Network Access ............................................................................. 33
Testing Your Connection and Online Updates ..........................................................38
Configuring Your Modem ...........................................................................................39
ISDN and ADSL Connections .....................................................................................40
Cable Modem Connections .........................................................................................41
Wireless Networking ...................................................................................................41

User Management ........................................................................................................41
SuSEconfig ...................................................................................................................42
Reviewing the Release Notes .......................................................................................42
Configuring Your Hardware ........................................................................................43
Completing Installation .....................................................................................................45

xiii

Page xiii


Whittaker

ftoc.tex

V2 - 06/18/2008

7:13pm

Contents

Chapter 2: Linux Fundamentals . . . . . . . . . . . . . . . . . . . . . . 47
Command Line 101: The Shell .........................................................................................48
Commonly Used Shell Features ..................................................................................49
Advanced Shell Features .............................................................................................49
Getting Help for Linux Commands .................................................................................55
Working with Files and Directories ................................................................................56
Listing Files ................................................................................................................. 56
Copying Files ...............................................................................................................57
Moving and Renaming Files ....................................................................................... 57

Deleting Files and Directories .....................................................................................58
Changing Directories ...................................................................................................58
Making Directories ......................................................................................................58
Removing Directories ..................................................................................................59
Making Links to Files or Directories ..........................................................................59
Concatenating Files .....................................................................................................59
Viewing Files with more and less ...............................................................................60
Viewing the Start or End of Files ...............................................................................60
Searching Files with grep ............................................................................................60
Finding Files with find and locate ..............................................................................61
Editing Text with vi and emacs ..................................................................................61
Common Administrative Tasks ........................................................................................62
Basic User and Group Concepts .................................................................................62
Creating Users and Groups .........................................................................................63
Working with File Ownership and Permissions ........................................................64
Configuring User Preferences ......................................................................................67
Mounting and Unmounting Filesystems .................................................................... 68
Working with Software Packages ....................................................................................69
Checking What’s Installed .......................................................................................... 70
Examining RPM Packages ...........................................................................................70
Extracting Files from Packages ...................................................................................71
Working with Source RPMs ........................................................................................72
Compiling Source Packages ..............................................................................................72
Connecting Over the Network ..........................................................................................73
Backing Up, Restoring, and Archiving Files ..................................................................74
Creating and Reading Simple Archives ...................................................................... 75
Creating an ISO Image to Burn to CD .......................................................................76

Chapter 3: Partitions, Filesystems, and Files . . . . . . . . . . . . . . . . 77
Partitions ............................................................................................................................. 77

Types of Partitions .......................................................................................................78
Creating Partitions .......................................................................................................80
Updating a Disk’s Partition Table ...............................................................................85
Changing Partition Types ............................................................................................85
Logical Volume Management ......................................................................................86

xiv

Page xiv


Whittaker

ftoc.tex

V2 - 06/18/2008

7:13pm

Contents

Filesystems .......................................................................................................................... 87
EXT2 ............................................................................................................................89
EXT3 ............................................................................................................................89
ReiserFS ....................................................................................................................... 89
JFS ................................................................................................................................90
XFS .............................................................................................................................. 91
VFAT/NTFS .................................................................................................................91
Creating Filesystems ..........................................................................................................92
Creating an EXT2 Filesystem ......................................................................................93

Creating an EXT3 Filesystem ......................................................................................94
Upgrading an EXT2 Filesystem to an EXT3 Filesystem ............................................95
Creating a ReiserFS Filesystem ...................................................................................96
Filesystem Comparisons ................................................................................................... 97
Mounting Filesystems ........................................................................................................98
Mount Options ............................................................................................................99
Mounting Filesystems Automatically ........................................................................104
Unmounting Filesystems .................................................................................................105

Part II: The SUSE System
Chapter 4: Booting the System . . . . . . . . . . . . . . . . . . . . . . 109
Booting Concepts ............................................................................................................. 109
Runlevels ....................................................................................................................114
Switching Runlevels Manually ..................................................................................115
Using chkconfig to Control Runlevels ......................................................................118
Customizing Runlevels for Different Types of Systems ........................................... 119
Boot Managers ..................................................................................................................120
LILO ...........................................................................................................................120
GRUB .........................................................................................................................122
Getting Out of Trouble with GRUB ......................................................................... 126
Dual Booting .....................................................................................................................128
Installing Windows and Linux on a New System ....................................................128
Installing Linux on an Existing Windows System ................................................... 129
Manually Partitioning an Existing Windows System ...............................................130
Sharing Data on Windows and Linux Partitions ..................................................... 132
Troubleshooting Booting .................................................................................................133
Fixing Boot Problems Using Runlevels .....................................................................133
The SUSE Rescue System ..........................................................................................135

Chapter 5: Documentation . . . . . . . . . . . . . . . . . . . . . . . . 139

Finding Help on Your SUSE System ............................................................................. 139
The SUSE Manuals ....................................................................................................140
Man Pages ..................................................................................................................141
Info Pages ..................................................................................................................144

xv

Page xv


Whittaker

ftoc.tex

V2 - 06/18/2008

7:13pm

Contents

The KDE Help Center ...............................................................................................146
/usr/share/doc/packages/ ............................................................................................146
Other Documentation Packages ................................................................................147
Linux Documentation Project Resources .....................................................................148
FAQs ..........................................................................................................................148
HOWTOs ...................................................................................................................149
Linux Documentation Project Guides ...................................................................... 149
The SUSE Books Package ..........................................................................................150
Finding Help Online ........................................................................................................ 151
The openSUSE Web Site ...........................................................................................151

The Novell Customer Center ....................................................................................152
openSUSE Public Mailing Lists .................................................................................153
The Unofficial SUSE FAQ .........................................................................................153
Other Unofficial SUSE Help Sites .............................................................................153
Other SUSE Documents ............................................................................................154
Topic-Specific Sites ................................................................................................... 154
Finding Software .......................................................................................................156
IBM ............................................................................................................................ 156
Other Distributions ...................................................................................................157
News Sites ................................................................................................................. 157
IRC .............................................................................................................................157
Local User Groups .....................................................................................................157
Finding Further Information ..........................................................................................157

Chapter 6: Understanding Your Linux Network . . . . . . . . . . . . . . 159
Internet 101 ...................................................................................................................... 160
TCP/IP ................................................................................................................................161
The ISO OSI Model .................................................................................................. 161
The DoD Model .........................................................................................................165
IP Addresses ..............................................................................................................165
Routing ...............................................................................................................................172

Chapter 7: Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
The Files in /var/log .........................................................................................................176
Logging with syslog ..........................................................................................................177
Logging with syslog-ng ....................................................................................................181
The Log Source ......................................................................................................... 182
The Filter ...................................................................................................................182
The Log Destination ..................................................................................................183
The Log Definition — Tying It All Together ...........................................................183

Managing Your Logs with logrotate ..............................................................................184
Analyzing Your Logs with logcheck ..............................................................................186
Using Webalizer ............................................................................................................... 188
Reading Log Files .............................................................................................................190

xvi

Page xvi


Whittaker

ftoc.tex

V2 - 06/18/2008

7:13pm

Contents

Chapter 8: The X Window System . . . . . . . . . . . . . . . . . . . . 193
X Window System Concepts .......................................................................................... 194
Window Managers .................................................................................................... 194
KDE and GNOME .....................................................................................................195
Configuring X ....................................................................................................................196
Getting Hardware Information ..................................................................................196
Using sax2 .................................................................................................................197
Framebuffer Graphics ................................................................................................198
Accessing Framebuffer Graphics After Installation .................................................. 200
If X Still Doesn’t Start ............................................................................................... 201

Switching Resolutions ...............................................................................................201
Switching to a Text Console .....................................................................................201
Copy and Paste in X ................................................................................................. 201
User Preferences in X ................................................................................................202
Using X Remotely ......................................................................................................202
Diskless X Terminals .................................................................................................207
KDE .....................................................................................................................................208
Konqueror ..................................................................................................................209
The KDE Control Center ..........................................................................................211
KDE Applications ......................................................................................................212
GNOME ..............................................................................................................................213
Nautilus ..................................................................................................................... 215
Firefox ........................................................................................................................215
Evolution ...................................................................................................................215
Gnucash .....................................................................................................................215
AbiWord ....................................................................................................................216
Gnumeric ...................................................................................................................216
Other Window Managers ................................................................................................216
FVWM2 .....................................................................................................................217
Blackbox ....................................................................................................................217
IceWM .......................................................................................................................218
XFCE ..........................................................................................................................218
Window Maker ..........................................................................................................218
Xgl and Compiz ................................................................................................................219
Setting Up Desktop Effects ....................................................................................... 222

Chapter 9: Configuring the System with YaST . . . . . . . . . . . . . . 225
YaST Modules ................................................................................................................... 228
Configuring Installation Sources ...................................................................................234
Setting Up Proxy Settings ...............................................................................................237

Using NTP Time Services ................................................................................................237
Printer Configuration ...................................................................................................... 239
Setting Up a Scanner .......................................................................................................242

xvii

Page xvii


Whittaker

ftoc.tex

V2 - 06/18/2008

7:13pm

Contents

Boot Loader Configuration .............................................................................................243
Setting Up SCPM ..............................................................................................................245
Runlevel Editor .................................................................................................................247
Users and Groups ............................................................................................................ 248
Adding or Editing Users ........................................................................................... 249
Adding or Editing Groups ........................................................................................252
Installing Additional Software with YaST ...................................................................253
YOU — The YaST Online Update ................................................................................. 255
YOU on SUSE Professional and on SLES .................................................................255
opensuse-updater ......................................................................................................256
The YaST Online Update Module .............................................................................257

YOU Dangers .............................................................................................................258
The YaST Installation Server Module ...........................................................................258
Setting Up an Installation Server ..............................................................................258
Installing from the Installation Server ......................................................................260
Autoinstallation — AutoYaST ........................................................................................261
Principles ...................................................................................................................262
Mode of Operation ....................................................................................................262
The YaST Autoinstallation Module ...........................................................................263
Using Pre-Install, chroot, and Post-Install Scripts ................................................... 265
Further Information ..................................................................................................266

Part III: Using the Command Line in SUSE Linux
Chapter 10: Text Manipulation . . . . . . . . . . . . . . . . . . . . . . 269
Reading Lines from Files ................................................................................................ 270
cat ..............................................................................................................................270
tac ..............................................................................................................................272
zcat .............................................................................................................................272
head ........................................................................................................................... 272
tail ..............................................................................................................................272
expand .......................................................................................................................273
nl ................................................................................................................................273
uniq ............................................................................................................................274
sort .............................................................................................................................274
Extracting Lines from Files ............................................................................................ 275
grep ............................................................................................................................275
zgrep ..........................................................................................................................278
grepmail .....................................................................................................................278
sgrep .......................................................................................................................... 279
split ............................................................................................................................280
csplit ..........................................................................................................................280

Working with Fields from Text Files ............................................................................281
cut ..............................................................................................................................282
paste ...........................................................................................................................282

xviii

Page xviii


Whittaker

ftoc.tex

V2 - 06/18/2008

7:13pm

Contents

join .............................................................................................................................283
awk ............................................................................................................................ 283
wc .............................................................................................................................. 285
Replacing Text .................................................................................................................. 285
sed ..............................................................................................................................286
tr ................................................................................................................................ 287
dos2unix and unix2dos ............................................................................................ 288
Formatting Text Files for Viewing and Printing .........................................................289
pr ............................................................................................................................... 289
fold .............................................................................................................................289
fmt ............................................................................................................................. 290

groff-Tascii .................................................................................................................290
a2ps ............................................................................................................................290
enscript ......................................................................................................................291
Comparing Files ............................................................................................................... 291
cmp ............................................................................................................................291
diff and patch ............................................................................................................292
Getting Text Out of Other File Formats ...................................................................... 293
antiword .................................................................................................................... 294
ps2ascii ......................................................................................................................294
pdftotext .................................................................................................................... 294
ps2pdf ........................................................................................................................295
dvi2tty ........................................................................................................................295
detex .......................................................................................................................... 295
acroread and xpdf .....................................................................................................296
html2text ................................................................................................................... 296
strings ........................................................................................................................ 296

Chapter 11: Text Editors . . . . . . . . . . . . . . . . . . . . . . . . . 297
The Politics ........................................................................................................................298
vi/vim ..................................................................................................................................298
Using Command Mode .............................................................................................300
Moving Around the Text .......................................................................................... 300
Deleting Text .............................................................................................................302
Copying and Pasting .................................................................................................304
Inserting and Saving Files .........................................................................................305
Searching and Replacing ...........................................................................................305
Using the vim Initialization File ...............................................................................306
Exiting vim ................................................................................................................307
emacs ..................................................................................................................................307
What to Install .......................................................................................................... 308

Starting emacs ........................................................................................................... 308
Controlling emacs ..................................................................................................... 310

xix

Page xix


Whittaker

ftoc.tex

V2 - 06/18/2008

7:13pm

Contents

Using Word Completion ...........................................................................................311
Using Command Completion and History ...............................................................312
emacs Modes .............................................................................................................312
Using the Calendar ....................................................................................................314
Customizing emacs ................................................................................................... 315
More Information ......................................................................................................318

Chapter 12: Working with Packages . . . . . . . . . . . . . . . . . . . 319
Binary RPMs ..................................................................................................................... 320
Installing an RPM ......................................................................................................320
Querying RPM Packages ...........................................................................................322
Removing Installed Packages ....................................................................................324

Verifying an RPM ......................................................................................................325
Creating an RPM ..............................................................................................................327
Distribution RPMs .....................................................................................................327
Source Code ..............................................................................................................327
The RPM Environment ..............................................................................................328
The Spec File .............................................................................................................329
Compiling an RPM from the Spec File .................................................................... 334
Checking the Finished RPM .....................................................................................336
Installation Sources .........................................................................................................337
YaST’s Installation Sources Module ..........................................................................338
1-Click Installation ....................................................................................................340
Command-Line Installation Tools ................................................................................ 343

Chapter 13: Working with Files . . . . . . . . . . . . . . . . . . . . . . 347
Listing, Copying, and Moving Files ...............................................................................347
The Command-Line Tools ........................................................................................347
File Managers ............................................................................................................ 352
Finding Files ..................................................................................................................... 354
Using find ..................................................................................................................354
Using locate ...............................................................................................................354
Using Konqueror to Find Files .................................................................................355
Finding Files in GNOME ..........................................................................................356
Finding Files in mc ...................................................................................................356
Finding Files by Content: Beagle ..............................................................................357
Looking at Files and File Types .................................................................................... 358
The file Command ....................................................................................................358
strings, ghex, khexedit, and antiword ......................................................................359
Viewing and Opening Different File Types and Formats ........................................360
Compressing Files ............................................................................................................367
Working with Archives ....................................................................................................369

Working with tar Archives ....................................................................................... 369
Working with cpio Archives .....................................................................................371
Working with zip Archives .......................................................................................372
Unpacking RPM Packages .........................................................................................372

xx

Page xx


Whittaker

ftoc.tex

V2 - 06/18/2008

7:13pm

Contents

Using pax ...................................................................................................................372
Using ark ...................................................................................................................373
Files Attributes and ACLs ...............................................................................................374
File Attributes ............................................................................................................374
File ACLs ...................................................................................................................376

Chapter 14: Working with the System . . . . . . . . . . . . . . . . . . 379
System Rescue and Repair ..............................................................................................379
Booting from the Hard Disk with Special Boot Parameters .....................................380
Booting into the Rescue System ................................................................................380

Booting into YaST System Repair Mode ...................................................................381
Working with Partitions .................................................................................................385
Partitioning Examples ............................................................................................... 386
Making a Filesystem ..................................................................................................391
Working with DVDs, CDs, and Floppies .....................................................................392
Creating and Using Images of Existing Disks ..........................................................392
Creating and Using New Disk Images ......................................................................393
Creating ISO CD and DVD Images ..........................................................................394
Burning CDs from the Command Line ....................................................................395
Burning CDs and DVDs Using k3b ..........................................................................395
Automating Tasks ............................................................................................................396
Shell Aliases ...............................................................................................................397
Writing Shell Scripts .................................................................................................397
Scripting Languages ...................................................................................................405

Chapter 15: Linux Networking . . . . . . . . . . . . . . . . . . . . . . 411
Configuring an IP Network ............................................................................................ 412
ifconfig .......................................................................................................................412
Setting Up Your Routes .............................................................................................416
Using iproute2 ...........................................................................................................419
The Wonderful World of ARP ........................................................................................422
Taking Part in an IPX Network .....................................................................................423
Network Tools .................................................................................................................. 424
Using Telnet ..............................................................................................................425
Using SSH ..................................................................................................................427
rsync .......................................................................................................................... 431
wget ........................................................................................................................... 432
Tracing Packets on the Network .............................................................................. 433
Network Troubleshooting ...............................................................................................435
ping ............................................................................................................................435

traceroute ...................................................................................................................436
Wireless Networking ....................................................................................................... 436
ndiswrapper ...............................................................................................................437
Configuring Your Wireless Network ........................................................................439
Bluetooth ........................................................................................................................... 441

xxi

Page xxi


Whittaker

ftoc.tex

V2 - 06/18/2008

7:13pm

Contents

Part IV: Implementing Network Services in SUSE Linux
Chapter 16: Setting Up a Web Site with the Apache Web Server . . . . . 447
Configuring Apache ......................................................................................................... 448
Apache Packages in SUSE .........................................................................................448
Starting Apache for the First Time ...........................................................................448
The Apache Configuration Files ...............................................................................450
Global Directives .......................................................................................................451
Main Server ............................................................................................................... 453
Virtual Hosts ..............................................................................................................454

Security .............................................................................................................................. 456
Setting Up User Access .............................................................................................457
Setting Up Group Access ..........................................................................................458
The Common Gateway Interface ...................................................................................459
Creating Dynamic Content with PHP ...........................................................................462
Configuration Using YaST ..............................................................................................464

Chapter 17: Mail Servers — Postfix, Sendmail, Qpopper, and Cyrus . . . 469
How Mail Is Sent and Received .....................................................................................470
Testing an MTA from the Command Line ...............................................................470
Postfix ................................................................................................................................472
Postfix Configuration ................................................................................................ 473
Postfix Terminology and Use ....................................................................................481
Stopping Spam ..........................................................................................................486
sendmail .............................................................................................................................487
Installing sendmail ....................................................................................................487
Configuring sendmail ................................................................................................488
Starting sendmail .......................................................................................................492
Getting More Information About sendmail ..............................................................493
Qpopper .............................................................................................................................493
Fetchmail ...........................................................................................................................495
Cyrus IMAPD ....................................................................................................................496
Configuring the Cyrus User ......................................................................................497
Adding Users to Cyrus ..............................................................................................497
Creating a Shared Mailbox ........................................................................................498
Integrating Cyrus and Postfix ...................................................................................499
Setting an Alias for Root’s Mail in Cyrus .................................................................500
Choosing a Mail Client ....................................................................................................500
The Command-Line Clients ......................................................................................500
The Graphical Mail Clients .......................................................................................501

Mail Systems on Linux ....................................................................................................502

Chapter 18: Setting Up Windows Interoperability with Samba . . . . . . 503
The Samba Packages ....................................................................................................... 504
Setting Up and Using a Samba Client ..........................................................................505
Using a Windows Printer from Linux ......................................................................508

xxii

Page xxii


Whittaker

ftoc.tex

V2 - 06/18/2008

7:13pm

Contents

Setting Up a Samba Server Using YaST .......................................................................511
Creating and Managing the Samba Password File .....................................................515
Working with the Winbind Daemon ............................................................................ 516
The Samba Configuration File .......................................................................................517
Using SWAT ......................................................................................................................519

Chapter 19: Setting Up Printing with CUPS . . . . . . . . . . . . . . . . 521
Setting Up a Locally Connected Printer .......................................................................523

Printers Not Listed by YaST ......................................................................................526
Unsupported Printers ................................................................................................526
Printing from Applications ........................................................................................526
Printing from the Command Line ............................................................................527
Canceling a Print Job from the Command Line ...................................................... 528
Setting Up a Simple Print Server on the Local Network .........................................529
Setting Up a Windows Client to Print to the CUPS Server .....................................531
Printing from Linux to Other Types of Remote Printers .........................................532
Using the CUPS Web Interface .................................................................................533
The CUPS Command-Line Tools and Configuration Files ......................................536
The CUPS Logs ......................................................................................................... 538
Other Tools ............................................................................................................... 539
Documentation ................................................................................................................. 539
CUPS Online Documentation ...................................................................................539
The CUPS Book .........................................................................................................539
SUSE Printing Documentation ..................................................................................539
IPP Documentation ................................................................................................... 540

Chapter 20: Configuring and Using DHCP Services . . . . . . . . . . . . 541
DHCP: Mode of Operation ............................................................................................. 541
DHCP Packages on SUSE ............................................................................................... 542
Setting Up a DHCP Server Using YaST ........................................................................542
Using the YaST DHCP Server Wizard ......................................................................543
Reconfiguring an Existing DHCP Server in YaST .................................................... 546
Manually Configuring a DHCP Server ..........................................................................549
IP Address Ranges .....................................................................................................549
Assigning a Default Gateway .....................................................................................549
Configuring Name Services .......................................................................................550
Configuring Fixed Addresses ....................................................................................550
Other Options ...........................................................................................................550

Defining Host Groups ...............................................................................................551
Specifying Leases .......................................................................................................551
Other DHCP Options ................................................................................................552
Starting and Stopping DHCP Clients ........................................................................... 552
Troubleshooting DHCP Clients and Servers ............................................................... 553
Troubleshooting DHCP Clients ................................................................................ 553
Troubleshooting DHCP Servers ................................................................................555

xxiii

Page xxiii


Whittaker

ftoc.tex

V2 - 06/18/2008

7:13pm

Contents

Chapter 21: Configuring a DNS Server . . . . . . . . . . . . . . . . . . 559
Some DNS Theory ............................................................................................................559
Top-Level Domains ...................................................................................................560
How Does a DNS Search Work? ..............................................................................560
Caching ......................................................................................................................561
Configuring BIND for Caching and Forwarding .........................................................561
Using dig ...................................................................................................................562

Using host ..................................................................................................................563
Examining Record Types ................................................................................................ 564
Working with Zones ........................................................................................................ 565
The Start of Authority ...............................................................................................565
The NS Entry .............................................................................................................567
The Mail Exchanger ..................................................................................................567
The Address Record ..................................................................................................567
The CNAME Record ..................................................................................................567
Adding the Zone to named.conf ...............................................................................568
The Reverse Zone ............................................................................................................. 569
Configuring a DNS Server with YaST ...........................................................................570

Chapter 22: Working with NFS . . . . . . . . . . . . . . . . . . . . . . 577
Mounting NFS Filesystems .............................................................................................577
Mounting NFS Filesystems at Boot Time .................................................................578
Using mount Options ............................................................................................... 579
rcnfs start and rcnfs stop ..........................................................................................580
YaST’s NFS Client Module ........................................................................................580
The NFS Server .................................................................................................................581
The exports File ........................................................................................................ 582
The exportfs Command ............................................................................................584
The showmount Command ......................................................................................585
Problems with Mounting NFS Shares ...................................................................... 586
NFS Security Considerations .................................................................................... 587

Chapter 23: Running an FTP Server on SUSE . . . . . . . . . . . . . . . 589
vsftpd as an Anonymous FTP Server ............................................................................590
Setting Up User FTP with vsftpd .................................................................................. 595
Allowing Uploads .............................................................................................................596
Using pure-ftpd .................................................................................................................598

Further Information .........................................................................................................599

Chapter 24: Implementing Firewalls in SUSE Linux . . . . . . . . . . . . 601
Why Use a Firewall? ........................................................................................................602
Configuring a Firewall with iptables ............................................................................603
Implementing an iptables Firewall ...........................................................................605
Setting Your First Rules ............................................................................................ 607
Adding a Rule ............................................................................................................608
The Order of Rules ................................................................................................... 609

xxiv

Page xxiv


×