Hat Linux Bible all editions, CentOS Bible, Fedora and Red Hat Enterprise Linux Bible, Linux Troubleshooting Bible, Linux Toys and Linux Toys II.. 703 Running Bootable Linux Distribution
Trang 4Copyright © 2010 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-470-48505-7
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
Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201)
748-6008, or online at http://www.wiley.com/go/permissions.
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 Web site 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 Web site may provide or recommendations it may make
Further, readers should be aware that Internet Web sites 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 please contact our Customer Care Department within the
United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley also publishes its books in a variety of electronic formats Some content that appears in print may not be available
in electronic books.
Library of Congress Control Number: 2009937839
Trademarks: Wiley and the Wiley logo are trademarks or registered trademarks of John Wiley & Sons, Inc and/or its
affiliates, in the United States and other countries, and may not be used without written permission Linux is a
regis-tered 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.
Trang 7Hat Linux Bible (all editions), CentOS Bible, Fedora and Red Hat Enterprise Linux Bible, Linux Troubleshooting Bible, Linux Toys and Linux Toys II Recently, Chris co-authored several books for the new Toolbox series for power users: Fedora Linux Toolbox, SUSE Linux Toolbox, Ubuntu Linux Toolbox, Mac OS X, and BSD UNIX Toolbox
For eight years Chris worked with the organization at AT&T that developed UNIX before ing to Utah to help contribute to Novell’s UnixWare project in the early 1990s When not writing about Linux, Chris enjoys playing soccer and just hanging out with his family
mov-Currently, Chris is employed by Red Hat, Inc as a Linux instructor He teaches classes and gives exams to those seeking Red Hat Certifi ed Engineer (RHCE) and Red Hat Certifi ed Technician (RHCT) certifi cations
Trang 9I
the thousands of people who give their time and code to support Linux So, thanks to you all!
I’d like to acknowledge several contributors for their participation in previous editions Wayne Tucker originally wrote the chapters on Debian, LAMP servers, and mail servers Bill von Hagen has contributed updates to the SUSE, Yellow Dog, and Ubuntu chapters Warren Wyrostek served as technical editor to this edition Thanks to the folks at Wiley for helping me press through the proj-ect Sara Shlaer did an excellent job helping me stay on track as I balanced my work on this book with my new full-time job with Red Hat Katie Wisor shepherded the book through the production process Thanks to Margot Maley Hutchison and Maureen Maloney from Waterside Productions for contracting the book for me with Wiley
And fi nally, special thanks to my wife, Sheree There’s no way I could do the work I do without the solid support I get on the home front I love you, and thanks for taking such good care of Seth, Caleb, and me
Trang 11Starting with LinuxChapter 1: .3
Linux Projects, Activities, and CareersChapter 2: .15
Part II: Running a Linux Desktop 33
Getting into the DesktopChapter 3: 35
Playing Music and VideoChapter 4: .83
Working with Words and ImagesChapter 5: 121
E-Mailing and Web BrowsingChapter 6: 151
Gaming with LinuxChapter 7: 185
Part III: Learning System Administration Skills 211
Installing LinuxChapter 8: 213
Running Commands from the ShellChapter 9: 245
Learning Basic AdministrationChapter 10: .295
Getting on the InternetChapter 11: .349
Securing LinuxChapter 12: 373
Part IV: Setting Up Linux Servers 421
Running a Linux, Apache, MySQL, and PHP (LAMP) ServerChapter 13: .423
Running a Mail ServerChapter 14: .445
Running a Print ServerChapter 15: .463
Running a File ServerChapter 16: .487
Part V: Choosing and Installing Different Linux Distributions 523
Running Ubuntu LinuxChapter 17: .525
Running Fedora and Red Hat Enterprise LinuxChapter 18: .545
Running Debian Chapter 19: GNU/Linux 569
Running SUSE and openSUSE LinuxChapter 20: .593
Running KNOPPIXChapter 21: .607
Running Yellow Dog LinuxChapter 22: 627
Running Gentoo LinuxChapter 23: .639
Running Slackware LinuxChapter 24: .661
Running PCLinuxOSChapter 25: 679
Trang 12Running Mandriva
Chapter 26: .689
Running a Linux Firewall Router Chapter 27: 703
Running Bootable Linux Distributions Chapter 28: 731
Part VI: Programming in Linux 751
Programming Environments and Interfaces Chapter 29: 753
Programming Tools and Utilities Chapter 30: 785
Appendix A: Media 817
Appendix B: Linux History and Background 827
GNU General Public License (Version 2) 849
Index 855
Trang 13Starting with Linux
Chapter 1: .3
Taking Your First Step 4
What comes in Linux systems? 4
What do you need to get started? 5
Starting right now 6
Understanding Linux 10
What’s So Great About Linux? 13
Summary 14
Linux Projects, Activities, and Careers Chapter 2: 15
Making Things with Linux 16
Linux in outer space 16
Linux in gadgets 17
Linux in projects 19
Getting Involved with Linux 21
Joining a Linux User Group 22
Joining Linux communities 22
Companies and groups supporting Linux 22
Keeping Up with Linux 23
Major Linux projects 24
Exploring Linux distributions 26
Linux in the Real World 27
Linux in schools 27
Linux in small business 28
Linux in the enterprise 30
Becoming a Linux Professional 30
Summary 31
Part II: Running a Linux Desktop 33 Getting into the Desktop Chapter 3: 35
Understanding Your Desktop 35
Starting the Desktop 36
Trang 14Boot to the desktop 36
Boot to graphical login 37
Boot to a text prompt 39
K Desktop Environment 40
Using the KDE desktop 41
Managing fi les with Dolphin and Konqueror 45
Using the Dolphin fi le manager 45
Using the Konqueror Web browser/fi le manager 50
Managing the KDE desktop 53
Confi guring the desktop 55
The GNOME Desktop 57
Using the Metacity window manager 60
Using the GNOME panels 61
Using the Nautilus fi le manager 66
3D effects with AIGLX 68
Changing GNOME preferences 71
Exiting GNOME 72
Confi guring Your Own Desktop 72
Confi guring X 73
Choosing a window manager 77
Choosing your personal window manager 80
Getting More Information 80
Summary 81
Playing Music and Video Chapter 4: 83
Playing Digital Media and Obeying the Law 84
Copyright protection issues 84
Exploring codecs 86
Playing Music 88
Using sound systems in Linux 88
Adjusting sound with PulseAudio 89
Setting up audio cards 90
Choosing an audio CD player 92
Using MIDI audio players 99
Performing audio fi le conversion and compression 99
Recording and Ripping Music 102
Creating an audio CD with cdrecord 103
Ripping CDs with Grip 104
Creating CD labels with cdlabelgen 106
Working with TV, Video, and Digital Imaging 107
Watching TV with tvtime 108
Video conferencing with Ekiga 109
Watching Movies and Video 111
Watching video with xine 112
Using Totem movie player 116
Trang 15Using a Digital Camera 117
Displaying images in gThumb 117
Using your camera as a storage device 118
Summary 119
Working with Words and Images Chapter 5: 121
Desktop Publishing in Linux 122
Using text editors and notepads 122
Using word processors 122
Transitioning documents from Windows 129
Building structured documents 132
Doing page layout with Scribus 136
Working with Graphics 138
Manipulating images with The GIMP 138
Creating vector graphic images with Inkscape 141
Acquiring screen captures 143
Viewing images 144
Displaying PDF and PostScript Documents 145
Using the ghostscript and gv commands 146
Using Adobe Reader 146
Using Scanners with SANE 148
Web Publishing 148
Summary 150
E-Mailing and Web Browsing Chapter 6: 151
Using E-Mail 151
Choosing an e-mail client 151
Getting here from Windows 153
Getting started with e-mail 154
Tuning up e-mail 156
Reading e-mail with Thunderbird 156
Managing e-mail in Evolution 163
Reading e-mail with SeaMonkey Mail 166
Working with text-based e-mail readers 167
Choosing a Web Browser 169
Exploring the SeaMonkey Suite 170
Using Firefox 171
Setting up Firefox 173
Securing Firefox 177
Tips for using Firefox 179
Using Firefox controls 179
Improving Firefox browsing 180
Doing cool things with Firefox 181
Using Text-Based Web Browsers 182
Summary 184
Trang 16Gaming with Linux
Chapter 7: 185
Jumping into Linux Gaming 185
Overview of Linux Gaming 187
Basic Linux Gaming Information 188
Choosing Gaming Hardware for Linux 190
Running Open Source Linux Games 191
GNOME games 192
KDE games 193
Games in Fedora 194
Commercial Linux Games 201
Getting started with commercial games in Linux 202
Playing commercial Linux games .203
id Software games 203
Playing TransGaming and Cedega games 205
Loki Software game demos 207
Summary 210
Part III: Learning System Administration Skills 211 Installing Linux Chapter 8: 213
Choosing a Linux Distribution 214
Linux at work 214
Other distributions 215
Getting Your Own Linux Distribution 215
Finding another Linux distribution 216
Understanding what you need 216
Downloading the distribution 217
Burning the distribution to CD 218
Exploring Common Installation Topics 219
Knowing your computer hardware 219
Upgrading or installing from scratch 221
Dual booting and virtualization 221
Using installation boot options 223
Partitioning hard drives 224
Using LILO or GRUB boot loaders 232
Confi guring networking 242
Confi guring other administrative features 243
Installing from the Linux Bible CD or DVD 243
Summary 244
Running Commands from the Shell Chapter 9: 245
Starting a Shell 246
Using the shell prompt 246
Using a terminal window 247
Trang 17Using virtual terminals 248
Choosing Your Shell 248
Using bash (and earlier sh) shells 249
Using tcsh (and earlier csh) shells 250
Using ash 250
Using ksh 250
Using zsh 250
Exploring the Shell 251
Checking your login session 251
Checking directories and permissions 252
Checking system activity 254
Exiting the shell 255
Using the Shell in Linux 255
Locating commands 256
Rerunning commands 259
Connecting and expanding commands 265
Creating Your Shell Environment 268
Confi guring your shell 268
Using shell environment variables 272
Managing background and foreground processes 275
Working with the Linux File System 277
Creating fi les and directories 280
Moving, copying, and deleting fi les 287
Using the vi Text Editor 287
Starting with vi 288
Moving around the fi le 291
Searching for text 291
Using numbers with commands 292
Summary 293
Learning Basic Administration Chapter 10: 295
Graphical Administration Tools 296
Using Web-based administration 296
Graphical administration with different distributions 298
Using the root Login 302
Becoming root from the shell (su command) 303
Allowing limited administrative access 304
Exploring Administrative Commands, Confi guration Files, and Log Files 304
Administrative commands 305
Administrative confi guration fi les 306
Administrative log fi les 310
Using sudo and Other Administrative Logins 310
Administering Your Linux System 313
Creating User Accounts 314
Adding users with useradd 314
Setting user defaults 317
Trang 18Modifying users with usermod 319
Deleting users with userdel 320
Confi guring Hardware 321
Managing removable hardware 322
Working with loadable modules 325
Managing File Systems and Disk Space 327
Mounting fi le systems 330
Using the mkfs command to create a fi le system 338
Adding a hard disk 339
Checking system space 342
Monitoring System Performance 344
Doing Remote System Administration 345
Summary 347
Getting on the Internet Chapter 11: 349
Connecting to the Network 350
Connecting via dial-up service 350
Connecting a single wired Ethernet card 351
Sharing a network connection with other computers 352
Connecting servers 354
Connecting other equipment 355
Using Ethernet Connections to the Internet 356
Confi guring Ethernet during installation 357
Confi guring Ethernet from the desktop 357
Using Network Confi guration GUI in Fedora 358
Identifying other computers (hosts and DNS) 360
Understanding your Internet connection 362
Using Dial-Up Connections to the Internet 364
Getting information 364
Setting up dial-up PPP 365
Creating a dial-up connection with the Internet Confi guration Wizard 366
Launching your PPP connection 368
Launching your PPP connection on demand 369
Checking your PPP connection 370
Checking that your modem was detected 370
Connecting to the Internet with Wireless 371
Summary 372
Securing Linux Chapter 12: 373
Linux Security Checklist 374
Finding distribution-specifi c security resources 377
Finding general security resources 378
Using Linux Securely 379
Using password protection 379
Choosing good passwords 379
Trang 19Using Log Files 383
The role of syslogd 386
Redirecting logs to a loghost with syslogd 386
Understanding the messages log fi le 388
Using Secure Shell Tools 389
Starting the ssh service 389
Using the ssh, sftp, and scp commands 390
Using ssh, scp, and sftp without passwords 391
Securing Linux Servers 392
Controlling access to services with TCP wrappers 392
Understanding attack techniques 395
Protecting against denial-of-service attacks 396
Protecting against distributed DoS attacks 399
Protecting against intrusion attacks 404
Securing servers with SELinux 407
Protecting Web servers with certifi cates and encryption .407
Using Security Tools from Linux Live CDs 417
Advantages of security live CDs 418
Using INSERT to check for rootkits 418
Summary 419
Part IV: Setting Up Linux Servers 421 Chapter 13: Running a Linux, Apache, MySQL, and PHP (LAMP) Server 423
Components of a LAMP Server 424
Apache 424
MySQL 424
PHP 425
Setting Up Your LAMP Server 426
Installing Apache 426
Installing PHP 426
Installing MySQL 428
Operating Your LAMP Server 428
Editing your apache confi guration fi les 429
Adding a virtual host to Apache 431
User content and the UserDir setting 433
Installing a Web application: Coppermine Photo Gallery 433
Troubleshooting 437
Confi guration errors 437
Access forbidden and server internal errors 439
Securing Your Web Traffi c with SSL/TLS 440
Generating your keys 442
Confi guring Apache to support SSL/TLS 443
Summary 444
Trang 20Running a Mail Server
Chapter 14: 445
Internet E-Mail’s Inner Workings 445
About the System and the Software Used 447
Preparing Your System 447
Confi guring DNS for direct delivery 448
Confi guring for retrieval from a mail host 449
Installing and Confi guring the Mail Server Software 450
Installing Exim and Courier 450
Installing ClamAV and SpamAssassin 452
Testing and Troubleshooting 454
Checking logs 454
Common errors (and how to fi x them) 455
Confi guring Mail Clients 458
Confi guring Fetchmail 459
Confi guring web-based mail 460
Securing Communications with SSL/TLS 460
Summary 462
Running a Print Server Chapter 15: 463
Common UNIX Printing Service .464
Setting Up Printers 465
Using Web-based CUPS administration 466
Using the Printer Confi guration window 468
Working with CUPS Printing 476
Confi guring the CUPS server (cupsd.conf) 476
Starting the CUPS server 477
Confi guring CUPS printer options manually 478
Using Printing Commands 479
Printing with lpr 480
Listing status with lpc 480
Removing print jobs with lprm 481
Confi guring Print Servers 481
Confi guring a shared CUPS printer 482
Confi guring a shared Samba printer 483
Summary 485
Running a File Server Chapter 16: 487
Setting Up an NFS File Server 488
Getting NFS 490
Sharing NFS fi le systems 490
Using NFS fi le systems 495
Unmounting NFS fi le systems 501
Other cool things to do with NFS 502
Setting Up a Samba File Server 502
Getting and installing Samba 504
Trang 21Working with Samba fi les and commands 515
Using Samba shared directories 518
Troubleshooting your Samba server 519
Summary 522
Part V: Choosing and Installing Different Linux Distributions 523
Running Ubuntu Linux Chapter 17: 525
Overview of Ubuntu 526
Ubuntu releases 526
Ubuntu installer 527
Ubuntu as a desktop 528
Ubuntu as a server 528
Ubuntu spin-offs 530
Challenges facing Ubuntu 531
Installing Ubuntu 532
Getting Started with Ubuntu 537
Trying out the desktop 538
Adding more software 539
Getting More Information about Ubuntu 542
Summary 543
Running Fedora and Red Hat Enterprise Linux Chapter 18: 545
Digging into Features 547
Red Hat installer (Anaconda) 547
Custom spins, install sets, and Live CDs 548
RPM Package Management 549
Latest desktop technology 549
System confi guration tools 551
Going Forward with Fedora 551
Growing community support for Fedora 552
Joining Fedora special interest groups 552
Forums and mailing lists 553
Fedora Comes of Age 553
Installing Fedora 556
Choosing computer hardware 556
Choosing an installation method 557
Choosing to install or upgrade 558
Beginning the installation 559
Running the Fedora Firstboot 567
Adding cool stuff to your Fedora desktop 567
Summary 567
Trang 22Running Debian GNU/Linux Chapter 19: 569
Inside Debian GNU/Linux 570Debian packages 570Debian package management tools 571Debian releases 573Getting Help with Debian 573Installing Debian GNU/Linux 574Hardware requirements and installation planning 574Running the installer 575Managing Your Debian System 580Confi guring network connections 580Package management using APT 583Package management using dpkg 587Installing package sets (tasks) with tasksel 589Alternatives, diversions, and stat overrides 590Managing package confi guration with debconf 592Summary 592
Running SUSE and openSUSE Linux Chapter 20: 593
Understanding SUSE Linux Enterprise and openSUSE 595What’s in SUSE Distributions? 595Installation and confi guration with YaST 596RPM package management 599Automated software updates 600Managing software with zypper .600Getting Support for SUSE Linux Enterprise and openSUSE 601Installing openSUSE 601Before you begin 602Starting installation 603Starting with openSUSE 605Summary 605
Running KNOPPIX Chapter 21: 607
KNOPPIX Features 608Understanding KNOPPIX 608Looking inside KNOPPIX 608What’s cool about KNOPPIX 610Examining challenges with KNOPPIX 611Seeing where KNOPPIX comes from 612Exploring uses for KNOPPIX 613Starting KNOPPIX 614Getting a computer 614Booting KNOPPIX 615Correcting boot problems 615
Trang 23Using KNOPPIX 620Getting on the network 624Installing software in KNOPPIX 625Summary 626
Running Yellow Dog Linux Chapter 22: 627
Understanding Yellow Dog Linux 628Going Forward with Yellow Dog 629Digging into Yellow Dog 629Installing Yellow Dog Linux 631Hardware support 632Installing Yellow Dog Linux on a PowerStation 633Updating Yellow Dog Linux 635Support Options 637Summary 637
Running Gentoo Linux Chapter 23: 639
Understanding Gentoo 640Gentoo’s open source spirit 640The Gentoo community 641Building, tuning, and tweaking Linux 641Where Gentoo is used 643What’s in Gentoo 643Managing software with Portage 644Finding software packages 644Gentoo features 645Installing Gentoo 646Getting Gentoo 646Starting Gentoo installation from a live CD 647Starting Gentoo installation from a minimal CD 650Getting software with emerge 658Summary 659
Running Slackware Linux Chapter 24: 661
Getting into Slackware 661Characterizing the Slackware Community 663The Slackware creator 663Slackware users 665Slackware Internet sites 665Challenges of Using Slackware 666Using Slackware as a Development Platform 667Installing Slackware 667Getting Slackware 667New features in Slackware 13 668
Trang 24Hardware requirements 668Starting installation 669Starting with Slackware 675Summary 677
Running PCLinuxOS Chapter 25: 679
Starting with PCLinuxOS 680Checking what you can do 680Adding more applications 681Installing PCLinuxOS 683Starting the install 683Confi guring after installation 685Remastering PCLinuxOS 685Summary 688
Running Mandriva Chapter 26: 689
Mandriva Features 689Exploring Mandriva 691Mandriva installer (DrakX) 692RPM package management with RPMDrake 693Mandriva Linux Control Center 694The Mandriva Community 695Installing Mandriva Limited Edition .696The right hardware for Mandriva 696Installing Mandriva with the DrakX installer 697Summary 701
Running a Linux Firewall Router Chapter 27: 703
Understanding Firewalls 704Protecting Desktops with Firewalls 705Starting your fi rewall in Fedora 705Confi guring a fi rewall in Mandriva 707Using Firewalls with iptables 709Starting with iptables 709Using iptables to do SNAT or IP Masquerading 715Adding modules with iptables 716Using iptables as a transparent proxy 716Using iptables for port forwarding 717Making a Coyote Linux Bootable Floppy Firewall 718Creating a Coyote Linux fi rewall 718Building the Coyote Linux fl oppy 719Running the Coyote Linux fl oppy fi rewall 725Managing the Coyote Linux fl oppy fi rewall 726Using Other Firewall Distributions 728Summary 729
Trang 25Running Bootable Linux Distributions Chapter 28: 731
Overview of Bootable Linux Distributions 732Trying a Bootable Linux 733Showcasing Linux from a live CD 734Security and rescue bootables 735Demonstration bootables 740Multimedia bootables 740Tiny desktops 743Special-Purpose Bootables 747Customizing a Bootable Linux 747Building a live CD with Fedora 749Summary 750
Part VI: Programming in Linux 751
Programming Environments and Interfaces
Understanding Programming Environments 754Using Linux Programming Environments 754The Linux development environment 755Graphical programming environments 763The command-line programming environment 769Linux Programming Interfaces 770Creating command-line interfaces 770Creating graphical interfaces 777Application programming interfaces 779Summary 783
Programming Tools and Utilities Chapter 30: 785
The Well-Stocked Toolkit 785Using the GCC Compiler 787Compiling multiple source code fi les 789GCC command-line options 791Automating Builds with make 792Library Utilities 795The nm command 796The ar command 797The ldd command 798The ldconfi g command 799Environment variables and confi guration fi les 799Source Code Control 800Source code control using RCS 800Source code control with CVS 804
Trang 26Debugging with GNU Debugger 808Starting GDB 808Inspecting code in the Debugger 811Examining data 812Setting breakpoints 814Working with source code 815Summary 815
Appendix A: Media 817 Appendix B: Linux History and Background 827 GNU General Public License (Version 2) 849 Index 855
Trang 27of us who have been bitten by the Linux bug, you won’t ever look back
Linux Bible 2010 Edition is here to open your eyes to what Linux is, where it came from, and
where it’s going But, most of all, the book is here to hand you Linux and help you get started
Because Linux is the operating system of free speech and free choice, Linux Bible gives you
choices in selecting the Linux that is right for you
On the DVD and CD that come with this book are 18 different Linux distributions that you are free to install, try out, and keep You learn how those distributions are alike or different, and the book leads you through the basics of installing and setting up your Linux system as:
A desktop computer user
—You have a full range of offi ce, music, gaming, graphics, and other applications to use
A Linux system administrator
—Learn how to install software, use shell commands, confi gure system services, and secure your computers and networks
A Linux server administrator
—Using some of the world’s best server software, you can set up your computer to be a Web server, fi le server, mail server, or print server
A software developer
—You can draw on thousands of open source programming tools
to develop your own software applications
The Linux systems you have in your hand don’t contain trialware or otherwise-hobbled software
On the contrary, they feature software created by world-class development projects, the same teams that build the software that powers many professional businesses, schools, home desktops, and Internet service providers In other words, this truly fi rst-rate software is from develop-ers who have made a commitment to producing software that can be used in the ways that you choose to use it
Most of the Linux distributions offered on the DVD and CD that come with this book are live CDs that let you try a Linux distribution without installing Almost all of those live CDs include features that let you install the contents of those live CDs to your hard disk For example, you can try out Fedora, Gentoo, Ubuntu, openSUSE, PCLinuxOS, and Mandriva as live CDs, and then install those distributions permanently to your hard drive from icons on the desktops of those live CDs
Trang 28Unlike some other books on Linux, this book doesn’t tie you to one Linux distribution The book teaches you the essentials of Linux graphical desktop interfaces, shell commands, and basic sys-tem administration Separate chapters break down many of the major Linux distributions avail-able today Then descriptions of the major software projects in most Linux distributions (KDE and GNOME desktops, Apache Web servers, Samba fi le and printer sharing, and so on) guide you in setting up and using those features, regardless of which Linux you choose.
Understanding the Linux Mystique
This book is designed to spark your imagination about what is possible with Linux, then give you the software and instruction to jump right into Linux From there, the approach is to help you learn by using it
In the fi rst two chapters, you’ll learn a lot of exciting ways Linux is being used today and see who many of the major players are in the free and open source software (FOSS) world You will see how people are adapting Linux to run on handhelds, mini laptops, 32- and 64-bit PCs, Macs, mainframes, and super computers Linux is truly everywhere!
However, if you are concerned that somehow “free” software is too good to be true, skip ahead for the moment to the brief history of Linux in Appendix B That appendix guides you through the strange and circuitous path of free and open source software development that led to the Linux phenomenon
If you are intrigued by what you learn here, I’ll tell you how you can become part of the open source and free software communities, whose stars are known by a single name (such as Linus)
or a few initials (such as rms) You’ll fi nd a staggering number of open source projects, forums, and mailing lists that are thriving today (and always looking for more people to get involved)
How This Book Is Organized
Learn the basics of what goes into Linux and you will be able to use all sorts of devices and computers in the future The book is organized in a way that enables you to start off at the very beginning with Linux, but still grow to the point where you can get going with some powerful server and programming features, if you care to
Part I includes two short chapters designed to open your eyes to what you can do with Linux,
then get your hands on it quickly Those two chapters describe
How others use Linux, how to transition to Linux from Windows, and how to start with
Linux using the CD and DVD inside this book (Chapter 1)What you can do, what you can make, and what you can become with Linux (Chapter 2)
Trang 29
In Part II, you start in with details on how to use Linux desktops and associated applications
In Part III, you learn how to administer Linux systems, including
Installing Linux systems (Chapter 8)
Linux creates powerful servers, and in Part IV you learn to
Set up a Web server using Apache, MySQL, and PHP in Linux (Chapter 13)
If you don’t have Linux installed yet, this book helps you understand differences in Linux
dis-tribution, then install the systems you want from the DVD and CD included in this book Part
V (Chapters 17 through 28) describes each of those distributions and how to run them live or
In addition, Appendix A tells you what’s on the DVD and CD, how to install from the DVD or
CD, and how to burn additional installation CDs from the software that comes with this book
Appendix B provides history and background information about Linux
Trang 30What You Will Get from This Book
By the time you fi nish this book, you’ll have a good basic understanding of many of the major features in Linux and how you can use them If you decide then that you want to go a bit deeper,
try the Fedora 12 Bible or the Red Hat Enterprise Linux Bible (both from Wiley, 2010), with content
that includes how to set up many different types of Linux servers You can fi nd similar books for other distributions
If you are more technically oriented, Linux Troubleshooting Bible (Wiley, 2004) can be a good way to learn more advanced skills for securing and troubleshooting Linux systems Or a Linux
Toolbox book for Fedora, Ubuntu, BSD, or SUSE (Wiley, 2007 and 2008) can provide you with
more than 1,000 Linux command lines to help you become a Linux power user
If you are looking for some fun, try out some projects with an old PC and free software from
Linux Toys II (Wiley, 2006).
Conventions Used in This Book
Throughout the book, special typography indicates code and commands Commands and code are shown in a monospaced font:
This is how code looks.
In the event that an example includes both input and output, the monospaced font is still used, but input is presented in bold type to distinguish the two Here’s an example:
$ ftp ftp.handsonhistory.com
Name (home:jake): jake Password: ******
As for styles in the text:
New terms and important words appear in italics when introduced
Trang 31A Caution box alerts you to take special care when executing a procedure, or damage to your computer
hard-ware or softhard-ware could result
Cross-Reference
A Cross-Reference box refers you to further information on a subject that you can fi nd outside the current
chapter
Coming from Windows
A Coming from Windows box provides tips to help you transfer your knowledge of Windows systems to the
Linux world
The On the CD and On the DVD icons point out features related to the media that accompany the book
Trang 35With Linux, you are free to erase your computer’s entire hard disk
and run nothing but free (as in freedom) software on it As an alternative, you could run Linux from a live CD (ignoring your computer’s contents without changing them) or install Linux to dual boot
with your Windows or Mac OS X system as you choose The bottom line is
that with Linux you are free to do as YOU choose with your computer
In only a few years, Linux has advanced from being considered a
spe-cialty operating system into the mainstream Precompiled and
con-fi gured Linux systems can be installed with no technical expertise
Versions of Linux run on all kinds of devices, from PCs to handhelds (see
www.linuxdevices.com) to game consoles (such as PlayStation 3) to
supercomputers to Mars rovers In short, Linux has become a system that
almost anyone can run almost anywhere
On both desktop and server computers Linux has become a formidable
operating system across a variety of business applications Today, large
enterprises can deploy thousands of systems using Linux distributions from
companies such as Red Hat, Inc and Novell, Inc Small businesses can put
together the mixture of offi ce and Internet services they need to keep their
costs down
The free and open source software (FOSS) development model that
espoused sharing, freedom, and openness is now on a trajectory to
sur-pass the quality of other operating systems outside of the traditional Linux
servers and technical workstations What were once weak components of
Linux, such as easy-to-use desktops, multimedia codecs and limited driver
availability, have improved at a rapid pace In areas of security, usability,
connectivity, and network services, Linux has continued to improve and
outshine the competition
Starting with Linux
IN THIS CHAPTER
Getting started with Linux Understanding Linux Linux features and advantages
Trang 36Computer industry heavy-hitters such as Microsoft and Oracle have taken notice of Linux
Microsoft has struck agreements with Linux companies including Novell and Xandros to form partnerships that primarily protect those companies against threatened Microsoft lawsuits
Oracle began producing its own enterprise-targeted Linux system to try to stem the fl ow of tomers to Red Hat Enterprise Linux
cus-What does this all add up to? A growing swirl of excitement around the operating system that the big guys can’t seem to get rid of For people like yourself, who want the freedom to use your com-puter software as you like, it means great prospects for the future
Let this book help you grab your fi rst look at the distributions, applications, services, and munity that make up the phenomenon that has become Linux
com-Taking Your First Step
In your hands, you have 18 different Linux distributions (on CD and DVD), thousands of tions, and descriptions for getting it all running on your own computer For you right now, the worldwide Linux phenomenon is just a reboot away
applica-Linux Bible 2010 Edition brings you into the world of free and open source software that, through
some strange twists and turns, has fallen most publicly under the “Linux” banner Through descriptions and procedures, this book helps you
Understand what people do with Linux and how you can use Linux for all your
high-quality software projects that are included with Linux
What comes in Linux systems?
Whether you are using Linux for the fi rst time or just want to try out a new Linux
distribu-tion, Linux Bible 2010 Edition is your guide to using Linux and the latest open source
technol-ogy Although different Linux distributions vary in the exact software they include, this book describes the most popular software available for Linux to
Manage your desktop (menus, icons, windows, and so on)
Trang 37Browse the Web and send e-mail
Connect to the Internet or other network
Google and Amazon.com), universities, and businesses of all sizes
This book guides you through the basics of getting started with these Linux features, plus many more After you’ve been through the book, you should be profi cient enough in the basics to track down answers to your more advanced questions through the volumes of man pages, FAQs, HOWTOs, and forums that cover different aspects of the Linux operating system
To get started with Linux right now, all you need is a standard PC with a bootable CD or DVD drive
What do you need to get started?
Although Linux runs great on many low-end computers (even some old 486s and early Pentiums), if you are completely new to Linux, I recommend that you start with a PC that has a little more muscle Here’s why:
Full-blown Linux operating systems with complete GNOME or KDE desktop
environ-
ments (see Chapter 3) perform poorly on slow CPUs and less than the recommended amount of RAM The bells and whistles come at the price of processing power Lighter-weight options (such as the Xfce or LXDE desktop environments) often run well on computers that have limited resources, but they may offer fewer features
You can use streamlined graphical Linux installations that fi t on small hard disks (as
small as 100MB) and run fairly well on slow processors Also, small live CD Linux tributions, such as Damn Small Linux (DSL), can be copied to hard disk and run from there (read about some of these small “bootables” in Chapter 28) The 50MB DSL desktop system can run fi ne on old Pentium machines with little RAM But if you want to add some of the more demanding applications to these small systems, such as OpenOffi ce.org offi ce applications, you will fi nd you need more than minimal computer hardware
Trang 38dis-If you are starting with a Pentium II, 400 MHz, your desktop will run slowly in default KDE or GNOME confi gurations with less than 128MB of RAM A simpler desktop system, with just X and a window manager, will work, but won’t give you the full fl avor of a Linux desktop (See Chapter 3 for information about different desktop choices and features.)
The good news is that cheap desktop PCs or netbooks that you can buy from big box retailers start at less than $200 Those systems will perform better than most PCs you have laying around that are more than a few years old, and some even come with Linux pre-installed The bottom line is that the less you know about Linux, the more you should try to have computer hardware that is up to spec to have a pleasant experience
Starting right now
If you are anxious to get started, insert either the DVD or CD accompanying this book into the appropriate drive on your PC and reboot When you see the boot screen, press Enter When the DVD or CD boots, the following happens, respectively:
KNOPPIX starts up.
A fully functional KNOPPIX desktop Linux system will boot directly from the DVD From that Linux system, you can do everything you would expect to do from a modern desktop computing system: write documents, play music, communicate over the Internet, work with images, and so on If you have a wired Ethernet connection that connects to the Internet when you started up Windows, most likely it will also connect automatically when KNOPPIX starts
Damn Small Linux starts up.
This small, amazing desktop-oriented Linux system starts up directly from the CD that comes with this book Besides being expandable and adaptable, DSL runs on everything from low-end PCs to powerful workstation hardware while being small enough to fi t on a mini CD (it’s only about 50MB in size)
What you have in front of you is a functioning desktop system that you can install to your hard disk to use permanently, if you like You can choose to add software from among thousands of software packages available for Linux Depending on your Linux system, installing extra software might just take a few clicks
The next sections step you through a few things you can do with KNOPPIX and Damn Small Linux
If you have any trouble starting KNOPPIX, see Chapter 21 for descriptions of boot options to help you
over-come certain problems (such as a garbled screen or hanging when certain hardware is encountered) That
Trang 39FIGURE 1-1
The KNOPPIX live Linux CD contains the KDE desktop and hundreds of applications
Here is a quick tour of the KNOPPIX desktop:
Browsing
—Select the Web Browser icon from the bottom panel to open the IceWeasel browser The IceWeasel browser is a version of the Firefox Web browser that was rebranded by the Debian project (http://geticeweasel.org)
Managing files
—Select the My Documents icon from the desktop A PCMan File Manager window opens to show your home folder (/home/knoppix) You will typically save fi les and folders to your home folder Because you are running KNOPPIX as a live
CD, any fi les you create will be lost when you reboot if you don’t explicitly save them
Chapter 21 describes how to make a persistent desktop, so you can save the fi les you create in KNOPPIX permanently
Trang 40Accessing disks
—A live CD, such as KNOPPIX, is designed to run without touching the contents of your hard disk However, if you have something on your hard disk you want to use with KNOPPIX (such as a music fi le or document), KNOPPIX makes doing
it easy
Entries appear in the left column of the fi le manager, representing every partition on your hard disk, as well as detected removable media (such as a USB fl ash drive) In Figure 1-1, Volume entries represent several partitions on your hard disk Select an icon
to display the contents of the partition in that fi le manager window To add content to that disk partition, simply drag and drop fi les from the desktop, or copy, move, or oth-erwise create fi les from the shell
Special Knoppix features
—Because of the temporary nature of a live CD, you have to confi gure settings each time you boot, unless you take steps to save those settings From the LXDE icon on the left side of the bottom panel, you can see a menu of selections to
do special things to make KNOPPIX run from your hard disk Select System Tools ➪ KNOPPIX HD Install to install KNOPPIX so you can run it from your hard disk
Other KNOPPIX features are also available from that menu You can select Install Components to add non-free software, such as Flash plug-ins or Windows fonts
Chapter 21 describes other KNOPPIX features
Running Applications
—Select the LXDE icon from the lower-left corner of the panel
to see a menu of available applications Choose Offi ce to select from several OpenOffi ce
org offi ce applications for writing documents, using spreadsheets, drawing pictures, and building presentations Try out some communications applications, such as Icedove mail reader and Pidgin Internet Messenger, from the Network menu
When you are done trying KNOPPIX, select Log Out from the LXDE menu and choose Shut Down After KNOPPIX shuts down, it ejects the disc After you remove the disc, you can use your computer again with whatever operating system you have installed there
Trying Damn Small Linux
Because Damn Small Linux (DSL) is based on KNOPPIX, you may notice some similarities DSL
is smaller and faster, however, so you should get to the DSL desktop screen quicker Instead of LXDE, the DSL desktop features a simple window manager Figure 1-2 shows an example of a Damn Small Linux desktop with several applications open
Note
Many of the same boot options that come with KNOPPIX will work with DSL, so check Chapter 21 if you have
trouble booting DSL For other descriptions of DSL, see Chapter 28