Suse linux Enterprise Server

2,933
-1

Published on

Suse Linux Enterprise Server Training

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,933
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
137
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Suse linux Enterprise Server

  1. 1. Whittaker ffirs.tex V2 - 06/18/2008 3:59pm Page i ®OpenSUSE 11.0 ® and SUSE ®Linux Enterprise Server Bible
  2. 2. Whittaker ffirs.tex V2 - 06/18/2008 3:59pm Page ii
  3. 3. Whittaker ffirs.tex V2 - 06/18/2008 3:59pm Page iii ®OpenSUSE 11.0 ® and SUSELinux Enterprise ® Server Bible Roger Whittaker Justin Davies Wiley Publishing, Inc.
  4. 4. Whittaker ffirs.tex V2 - 06/18/2008 3:59pm Page iv ® ®OpenSUSE 11.0 and SUSE Linux® Enterprise Server BiblePublished byWiley Publishing, Inc.10475 Crosspoint BoulevardIndianapolis, IN 46256www.wiley.comCopyright © 2008 by Wiley Publishing, Inc., Indianapolis, IndianaPublished simultaneously in CanadaISBN: 978-0-470-27587-0Manufactured in the United States of America10 9 8 7 6 5 4 3 2 1No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form orby any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permittedunder Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written per-mission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copy-right 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 athttp://www.wiley.com/go/permissions.Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations orwarranties with respect to the accuracy or completeness of the contents of this work and specifically dis-claim all warranties, including without limitation warranties of fitness for a particular purpose. No war-ranty may be created or extended by sales or promotional materials. The advice and strategies containedherein may not be suitable for every situation. This work is sold with the understanding that the publisheris not engaged in rendering legal, accounting, or other professional services. If professional assistance isrequired, the services of a competent professional person should be sought. Neither the publisher nor theauthor shall be liable for damages arising herefrom. The fact that an organization or Website is referred toin this work as a citation and/or a potential source of further information does not mean that the authoror the publisher endorses the information the organization or Website may provide or recommendations itmay make. Further, readers should be aware that Internet Websites listed in this work may have changedor 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 contactour Customer Care Department within the U.S. at (800) 762-2974, outside the U.S. at (317) 572-3993 orfax (317) 572-4002.Library of Congress Cataloging-in-Publication Data:Whittaker, Roger, 1955- OpenSUSE 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 2008014649Trademarks: Wiley, the Wiley logo, and related trade dress are trademarks or registered trademarks ofJohn Wiley & Sons, Inc., in the United States and other countries, and may not be used without writtenpermission. OpenSUSE and SUSE are registered trademarks of Novell, Inc. Linux is a registered trademarkof 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 maynot be available in electronic books.
  5. 5. Whittaker ffirs.tex V2 - 06/18/2008 3:59pm Page vTo Shekufeh and Golnaz, who tolerate all this — Roger Whittaker To my wife, Aimee — Justin Davies
  6. 6. Whittaker ffirs.tex V2 - 06/18/2008 3:59pm Page vi
  7. 7. Whittaker fauth.tex V2 - 06/18/2008 5:34pm Page viiAbout the AuthorsAfter working as a teacher of Mathematics and as Deputy Head of an independent school inLondon, Roger Whittaker discovered Linux in 1996 and became increasingly interested (somewould say obsessed). When SUSE Linux opened its UK office in 1999, he changed careers andworked as a technical and training consultant until early in 2004. He now works for Novellsupporting Linux installations for large customers. He is Newsletter Editor for UKUUG, the UK’sUnix and Open Systems user group.Justin Davies has been a Linux user since the age of 15. After University, he joined SUSE Linuxas a Technical Consultant where he specialized in Linux on non-Intel architecture. He thenspent time working with value-added resellers in Europe to define their open source strategyand go-to-market plans around Linux. He is now the founder and CTO of Ninetyten, a socialnetworking consultancy based in London, where he is still providing solutions based on opensource software.
  8. 8. Whittaker fauth.tex V2 - 06/18/2008 5:34pm Page viii
  9. 9. Whittaker fcre.tex V2 - 06/18/2008 5:35pm Page ixCreditsAcquisitions Editor Production ManagerJenny Watson Tim TateDevelopment Editor Vice President and Executive GroupGus A. Miklos PublisherSenior Development Editor Richard SwadleyKevin Kent Vice President and Executive PublisherTechnical Editor Joseph B. WikertWarren E. Wyrostek Project Coordinator, CoverProduction Editor Lynsey StanfordDaniel ScribnerCopy Editor ProofreaderNancy Rapoport Josh Chase, Word OneEditorial Manager IndexerMary Beth Wakefield Ron Strauss
  10. 10. Whittaker fcre.tex V2 - 06/18/2008 5:35pm Page x
  11. 11. Whittaker cag.tex V2 - 06/18/2008 7:12pm Page xiForeword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxixPreface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxiIntroduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxiiiPart I: SUSE Linux BasicsChapter 1: Installing SUSE ................................................................................................................3Chapter 2: Linux Fundamentals .....................................................................................................47Chapter 3: Partitions, Filesystems, and Files ..................................................................................77Part II: The SUSE SystemChapter 4: Booting the System .....................................................................................................109Chapter 5: Documentation ............................................................................................................139Chapter 6: Understanding Your Linux Network ..........................................................................159Chapter 7: Logging ........................................................................................................................175Chapter 8: The X Window System ...............................................................................................193Chapter 9: Configuring the System with YaST ............................................................................ 225Part III: Using the Command Line in SUSE LinuxChapter 10: Text Manipulation .....................................................................................................269Chapter 11: Text Editors ...............................................................................................................297Chapter 12: Working with Packages ............................................................................................319Chapter 13: Working with Files ...................................................................................................347Chapter 14: Working with the System .........................................................................................379Chapter 15: Linux Networking .....................................................................................................411Part IV: Implementing Network Services in SUSE LinuxChapter 16: Setting Up a Web Site with the Apache Web Server ..............................................447Chapter 17: Mail Servers — Postfix, Sendmail, Qpopper, and Cyrus ........................................469Chapter 18: Setting Up Windows Interoperability with Samba ..................................................503Chapter 19: Setting Up Printing with CUPS ................................................................................521Chapter 20: Configuring and Using DHCP Services ....................................................................541Chapter 21: Configuring a DNS Server ........................................................................................559Chapter 22: Working with NFS ................................................................................................... 577Chapter 23: Running an FTP Server on SUSE .............................................................................589Chapter 24: Implementing Firewalls in SUSE Linux ...................................................................601Chapter 25: Network Information and Directory Services ..........................................................621Chapter 26: Setting Up a Web Proxy with Squid ........................................................................647 xi
  12. 12. Whittaker cag.tex V2 - 06/18/2008 7:12pm Page xii Contents at a Glance Part V: SUSE Linux in the Enterprise Chapter 27: Enterprise Architecture .............................................................................................659 Chapter 28: Emulation and Virtualization ................................................................................... 685 Chapter 29: The Kernel ................................................................................................................ 713 Chapter 30: Business Desktop Linux: SLED ................................................................................729 Appendix A: What’s on the DVD .................................................................................................737 Index ..............................................................................................................................................739xii
  13. 13. Whittaker ftoc.tex V2 - 06/18/2008 7:13pm Page xiiiForeword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxixPreface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxiIntroduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxiiiPart I: SUSE Linux BasicsChapter 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
  14. 14. Whittaker ftoc.tex V2 - 06/18/2008 7:13pm Page xiv 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 ......................................................................................86xiv
  15. 15. Whittaker ftoc.tex V2 - 06/18/2008 7:13pm Page xv 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 .................................................................................................105Part II: The SUSE SystemChapter 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 ..........................................................................................135Chapter 5: Documentation . . . . . . . . . . . . . . . . . . . . . . . . 139 Finding Help on Your SUSE System ............................................................................. 139 The SUSE Manuals ....................................................................................................140 Man Pages ..................................................................................................................141 Info Pages ..................................................................................................................144 xv
  16. 16. Whittaker ftoc.tex V2 - 06/18/2008 7:13pm Page xvi 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 .............................................................................................................190xvi
  17. 17. Whittaker ftoc.tex V2 - 06/18/2008 7:13pm Page xvii ContentsChapter 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 ....................................................................................... 222Chapter 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
  18. 18. Whittaker ftoc.tex V2 - 06/18/2008 7:13pm Page xviii 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 ...........................................................................................................................282xviii
  19. 19. Whittaker ftoc.tex V2 - 06/18/2008 7:13pm Page xix 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 ........................................................................................................................ 296Chapter 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
  20. 20. Whittaker ftoc.tex V2 - 06/18/2008 7:13pm Page xx 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 .........................................................................................372xx
  21. 21. Whittaker ftoc.tex V2 - 06/18/2008 7:13pm Page xxi Contents Using pax ...................................................................................................................372 Using ark ...................................................................................................................373 Files Attributes and ACLs ...............................................................................................374 File Attributes ............................................................................................................374 File ACLs ...................................................................................................................376Chapter 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 ...................................................................................................405Chapter 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
  22. 22. Whittaker ftoc.tex V2 - 06/18/2008 7:13pm Page xxii 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 ......................................................................508xxii
  23. 23. Whittaker ftoc.tex V2 - 06/18/2008 7:13pm Page xxiii 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 ......................................................................................................................519Chapter 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 ................................................................................................... 540Chapter 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
  24. 24. Whittaker ftoc.tex V2 - 06/18/2008 7:13pm Page xxiv 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 ................................................................................................... 609xxiv
  25. 25. Whittaker ftoc.tex V2 - 06/18/2008 7:13pm Page xxv Contents Network Address Translation ........................................................................................609 Source NAT ...............................................................................................................609 Allowing the Packets to be Forwarded .....................................................................611 Destination NAT ........................................................................................................612 Redirecting Traffic ........................................................................................................... 613 Allowing ICMP Traffic .....................................................................................................614 Allowing Loopback .......................................................................................................... 614 Stopping ‘‘Too Frequent’’ Connections .........................................................................615 Logging Dropped Packets ............................................................................................... 615 Using SuSEfirewall2 ........................................................................................................ 616Chapter 25: Network Information and Directory Services . . . . . . . . 621 Using NIS for Authentication .........................................................................................622 Setting Up a NIS Server Using YaST ........................................................................622 Setting Up a NIS Server Manually ............................................................................624 Configuring Clients for NIS ......................................................................................627 Working with LDAP in SUSE .........................................................................................629 What Is LDAP? .................................................................................................................630 LDAP Objects ............................................................................................................631 The Hierarchy ............................................................................................................632 Implementing the LDAP Server ..................................................................................... 633 Configuring the Administrator ..................................................................................633 Testing the LDAP Server ...........................................................................................634 Adding Information ...................................................................................................635 Adding User Data to the LDAP Server .....................................................................638 Pluggable Authentication Modules ................................................................................642 Integrating LDAP into Linux ..........................................................................................644 Setting the ACL on the LDAP Server ............................................................................645 How Can LDAP Help You? .............................................................................................646Chapter 26: Setting Up a Web Proxy with Squid . . . . . . . . . . . . . 647 Getting Started with Squid on SUSE ............................................................................648 User Authentication .........................................................................................................650 Restricting Access by Hardware Address .....................................................................652 The Squid Log ...................................................................................................................653 Using Squid as a Transparent Proxy ............................................................................654 Using Cache Manager ......................................................................................................655 Using squidGuard ............................................................................................................656Part V: SUSE Linux in the EnterpriseChapter 27: Enterprise Architecture . . . . . . . . . . . . . . . . . . . 659 A Typical Organization ...................................................................................................660 Where Can Linux Be Used? ......................................................................................661 I Know Where, but How? .........................................................................................662 Fulfilling Your Staff Requirements ............................................................................663 xxv
  26. 26. Whittaker ftoc.tex V2 - 06/18/2008 7:13pm Page xxvi Contents Linux Enterprise Hardware: The Big Players ..............................................................663 IBM ............................................................................................................................ 664 Hewlett-Packard ........................................................................................................665 64-bit Platforms .........................................................................................................665 Blade Technology ......................................................................................................667 Hardware and Software Certification and Support ..................................................668 Putting It All Together .................................................................................................... 668 Where Do I Put the Services? ...................................................................................668 Storage Area Networks ..............................................................................................672 Virtualize Everything! ................................................................................................677 Disaster Recovery ...................................................................................................... 678 High Availability and Failover ..................................................................................682 Chapter 28: Emulation and Virtualization . . . . . . . . . . . . . . . . 685 Emulation Versus Virtualization ...................................................................................685 DOS Emulation Using dosemu and dosbox ................................................................ 686 dosemu ......................................................................................................................687 dosbox .......................................................................................................................687 Running Microsoft Windows Applications with Wine ..............................................688 The bochs PC Emulator .................................................................................................. 693 Virtual Machines Using QEMU ......................................................................................694 Installing and Running QEMU .................................................................................695 VMware Virtual Machines .............................................................................................. 697 VMware Server ..........................................................................................................698 VirtualBox ......................................................................................................................... 700 The Xen Hypervisor ......................................................................................................... 702 Hardware-Assisted Virtualization ..............................................................................705 Configuration Files and Command-Line Tools ........................................................708 Other Emulators ...............................................................................................................711 Chapter 29: The Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . 713 Why You Probably Don’t Need This Chapter ............................................................. 713 Why You Might Need This Chapter ..............................................................................714 SUSE Kernels and Vanilla Kernels ................................................................................714 Kernel Version Numbers ...........................................................................................714 The Binary Kernel Packages ......................................................................................715 What Kernel Am I Running? ....................................................................................716 Upgrading a Kernel Package ..........................................................................................716 Kernel Configuration .......................................................................................................717 Building the Kernel ..........................................................................................................722 Kernel Module Packages and Third-Party Software ..................................................724 Tainting the Kernel ................................................................................................... 725 Loading Kernel Modules ...........................................................................................726 Kernel Parameters at Boot Time ................................................................................... 727 The Initial Ramdisk .........................................................................................................728xxvi
  27. 27. Whittaker ftoc.tex V2 - 06/18/2008 7:13pm Page xxvii ContentsChapter 30: Business Desktop Linux: SLED . . . . . . . . . . . . . . . . 729 The Technical Background .............................................................................................731 The Stubborn Applications .............................................................................................731 Other Commercial Desktop Distributions ...................................................................732 Other Approaches ............................................................................................................ 733 SLD, NLD, and SLED ...................................................................................................... 734 The Future of SLED and the Linux Desktop ...............................................................734 For More Information ......................................................................................................735Appendix A: What’s on the DVD . . . . . . . . . . . . . . . . . . . . . 737Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739 xxvii
  28. 28. Whittaker ftoc.tex V2 - 06/18/2008 7:13pm Page xxviii
  29. 29. Whittaker flast.tex V2 - 06/18/2008 4:04pm Page xxixM y Brothers and Sisters,Should we accept that this book is indeed a Bible? Let us use a dictionary to see what the defini-tion of a Bible is.The first definition is marked obsolete, and just means ‘‘a book.’’ I think that anyone wouldagree that this tome is a Bible by that definition.The second definition is the one that most know, ‘‘The Book by way of eminence . . . acceptedas of divine authority and origin.’’ Well, Linux has long been known for its gurus who hand outsmall snippets of sage advice. Sometimes that sage advice is in many books, and beginners areoften told RTFM (Read The Freaking Manual). Easy enough for the guru to say, but when thereare so many manuals, HOWTOs, and other pieces of information scattered about, how do youput it all together?Therefore, a Bible is necessary. Let’s hope it carries information pertinent to your own religion,or in this case, distribution. If the Bible tries to cover the information in every distribution, thereader may become lost. That is why this is a SUSE Linux Bible, and not some other brand ofLinux.Some people say that Linux and Free and Open Source (FOSS) are a religion, and that the peo-ple that support it are religious zealots. I don’t think that is true, for the people I know in FOSSare multifaceted. But when it comes to programming, we believe that Linux and FOSS offer edu-cation, government, and business the most flexible, most powerful, and lowest cost solution. Allyou have to do is reach out and accept that fact.Like any good religion you have to practice it, study it, and really understand what is being saidto you. You also have to apply it to your life. Look for ways in your life that this software canhelp you, whether to organize your life or your business better.Many people think that Total Cost of Ownership (TCO) is simply made up of the cost of thehardware, software, and services of the solution you pick. How naive. Total Cost of Ownershipis also made up of the cost of not picking a better solution, one that is flexible enough for youto solve 99 percent of your problems instead of 80 percent of your problems. How much does itcost you not to be able to solve that 19–20 percent?The Freedom that you get when you use FOSS is the key to this savings, or (in reverse) theadditional earning power. To be able to fully tailor the software to meet your needs is thegreatest value of FOSS. But you can’t do this without knowledge. xxix
  30. 30. Whittaker flast.tex V2 - 06/18/2008 4:04pm Page xxx Foreword This is where this Bible comes in, to give you the knowledge to go out and explore further. So, my brothers and sisters, throw off the shackles of proprietary software and learn how to make software do what you want it to do. Open the pages of this Bible and see your life change. Welcome to the bright side of ‘‘The Force.’’ Carpe Diem! Jon ‘‘maddog’’ Hall President, Linux Internationalxxx
  31. 31. Whittaker fpref.tex V2 - 06/18/2008 4:05pm Page xxxiW elcome to the OpenSUSE 11.0 and SUSE Linux Enterprise Server Bible! This book is for anyone who is interested in running a SUSE Linux system — at home or at work, ‘‘for fun or for profit.’’ It covers the all the currently available versions from SUSE:the brand new openSUSE 11.0 and the current versions of the SUSE Linux Enterprise Server(SLES) and the SUSE Linux Enterprise Desktop (SLED). Most of the content applies equally toearlier versions also, however.The book aims to supplement the documentation provided by SUSE and to show the readerhow best to carry out a particular task on a SUSE system, making full use of SUSE’s config-uration utilities. Many Linux books and ‘‘howto’’ documents provide generic instructions forcarrying out particular tasks; however, it often turns out that these are either incorrect in detailsor unnecessarily complicated when applied to a particular distribution. In this book we aim todescribe the best ways to work with SUSE in a wide variety of situations, making full use ofSUSE’s specific configuration tools.Too often, computer books tend to be written only from the standpoint of ‘‘how to’’ perform atask and fail to provide a real understanding of the underlying principles. Our aim in this bookis to combine a description of the steps necessary to perform a particular task with a real under-standing of what is being done.While we discuss the use of SUSE Linux in enterprise applications, with examples based on ourown consulting experience, the book is also for home users coming to grips with Linux for thefirst time. In short, we aim for OpenSUSE 11.0 and SUSE Linux Enterprise Server Bible to be whatyou need to run your SUSE Linux system, whatever your situation might be.How This Book Is StructuredWe’ve organized this book into five parts: ■ Part I: SUSE Linux Basics: This part introduces SUSE Linux by describing the installa- tion of a SUSE system and discussing the fundamental concepts of Linux. ■ Part II: The SUSE System: This part describes the use of YaST for system configuration; explains Linux networking, system logs, and the X Window system; and helps you to find further documentation. xxxi
  32. 32. Whittaker fpref.tex V2 - 06/18/2008 4:05pm Page xxxii Preface ■ Part III: Using the Command Line in SUSE Linux: This part covers the power of the Linux command line, with chapters covering text editing and tools for manipulating text ff

×