Monday, April 26, 2010

Running Linux, 4th Edition




Table of Contents
Preface .................................................................................................................................. 1
Why People Like Linux ..................................................................................................... 2
Organization of This Book................................................................................................. 4
Conventions Used in This Book......................................................................................... 5
How to Contact Us ............................................................................................................. 6
Acknowledgments.............................................................................................................. 7
Chapter 1. Introduction to Linux ....................................................................................... 9
1.1 About This Book ........................................................................................................ 10
1.2 A Brief History of Linux............................................................................................ 11
1.3 Who's Using Linux?................................................................................................... 14
1.4 System Features.......................................................................................................... 15
1.4.1 A Note on Linux Version Numbers .................................................................... 15
1.4.2 A Bag of Features................................................................................................ 16
1.4.3 Kernel .................................................................................................................. 17
1.5 Software Features....................................................................................................... 19
1.5.1 Basic Commands and Utilities ............................................................................ 19
1.5.2 Text Processing and Word Processing ................................................................ 20
1.5.3 Commercial Applications.................................................................................... 23
1.5.4 Programming Languages and Utilities................................................................ 24
1.5.5 The X Window System....................................................................................... 25
1.5.6 KDE and GNOME .............................................................................................. 26
1.5.7 Networking.......................................................................................................... 26
1.5.8 Laptop Support.................................................................................................... 28
1.5.9 Interfacing with Windows and MS-DOS............................................................ 28
1.5.10 Other Applications ............................................................................................ 29
1.6 About Linux's Copyright............................................................................................ 30
1.7 Open Source and the Philosophy of Linux................................................................. 31
1.7.1 Hints for Unix Novices ....................................................................................... 34
1.7.2 Hints for Unix Gurus........................................................................................... 35
1.8 Sources of Linux Information .................................................................................... 36
1.8.1 Online Documents............................................................................................... 36
1.8.2 Books and Other Published Works ..................................................................... 36
1.8.3 Usenet Newsgroups............................................................................................. 37
1.8.4 Internet Mailing Lists .......................................................................................... 37
1.9 Getting Help ............................................................................................................... 37
Chapter 2. Preparing to Install Linux.............................................................................. 41
2.1 Distributions of Linux ................................................................................................ 41
2.1.1 Getting Linux via Mail Order or Other Hard Media........................................... 41
2.1.2 Getting Linux from the Internet .......................................................................... 42
2.2 Preparing to Install Linux........................................................................................... 43
2.2.1 Installation Overview .......................................................................................... 43
2.2.2 Repartitioning Concepts...................................................................................... 44
2.2.3 Linux Partition Requirements ............................................................................. 45
2.2.4 Repartitioning Your Drives................................................................................. 47
Chapter 3. Installation and Initial Configuration ........................................................... 50
3.1 Installing the Linux Software..................................................................................... 50
3.1.1 Booting Linux ..................................................................................................... 50
3.1.2 Drives and Partitions Under Linux...................................................................... 56
3.1.3 Creating Linux Partitions .................................................................................... 58
3.1.4 Creating Swap Space........................................................................................... 62
3.1.5 Creating the Filesystems ..................................................................................... 63
3.1.6 Installing the Software ........................................................................................ 63
3.1.7 Creating the Boot Floppy or Installing LILO...................................................... 65
3.1.8 Additional Installation Procedures ...................................................................... 66
3.2 Post-Installation Procedures....................................................................................... 66
3.2.1 Creating a User Account ..................................................................................... 66
3.2.2 Getting Online Help ............................................................................................ 67
3.2.3 Editing /etc/fstab ................................................................................................. 68
3.2.4 Shutting Down the System.................................................................................. 69
3.3 Running into Trouble ................................................................................................. 70
3.3.1 Problems with Booting the Installation Medium ................................................ 71
3.3.2 Hardware Problems ............................................................................................. 72
3.3.3 Problems Installing the Software ........................................................................ 77
3.3.4 Problems after Installing Linux........................................................................... 78
Chapter 4. Basic Unix Commands and Concepts............................................................ 82
4.1 Logging In .................................................................................................................. 83
4.2 Setting a Password ..................................................................................................... 84
4.3 Virtual Consoles......................................................................................................... 84
4.4 Popular Commands .................................................................................................... 85
4.4.1 Directories ........................................................................................................... 85
4.4.2 Listing Files......................................................................................................... 86
4.4.3 Viewing Files, More or Less ............................................................................... 87
4.4.4 Symbolic Links ................................................................................................... 88
4.5 Shells .......................................................................................................................... 88
4.6 Useful Keys and How to Get Them to Work ............................................................. 90
4.7 Typing Shortcuts ........................................................................................................ 91
4.7.1 Word Completion................................................................................................ 91
4.7.2 Moving Around Among Commands................................................................... 92
4.8 Filename Expansion ................................................................................................... 92
4.9 Saving Your Output ................................................................................................... 93
4.10 What Is a Command? ............................................................................................... 96
4.11 Putting a Command in the Background ................................................................... 97
4.12 Manual Pages ........................................................................................................... 98
4.13 File Ownership and Permissions ............................................................................ 100
4.13.1 What Permissions Mean.................................................................................. 100
4.13.2 Owners and Groups......................................................................................... 101
4.14 Changing the Owner, Group,and Permissions ....................................................... 103
4.15 Startup Files............................................................................................................ 105
4.16 Important Directories ............................................................................................. 107
4.17 Programs That Serve You ...................................................................................... 109
4.18 Processes ................................................................................................................ 110
Chapter 5. Essential System Management..................................................................... 114
5.1 Maintaining the System............................................................................................ 115
5.2 Booting the System .................................................................................................. 118
5.2.1 Using a Boot Floppy ......................................................................................... 118
5.2.2 Using LILO ....................................................................................................... 120
5.3 System Startup and Initialization ............................................................................. 126
5.3.1 Kernel Boot Messages....................................................................................... 126
9.3.5 Texinfo .............................................................................................................. 293
9.4 Graphics ................................................................................................................... 299
9.4.1 ImageMagick..................................................................................................... 300
9.4.2 The GIMP.......................................................................................................... 302
9.4.3 POVRAY .......................................................................................................... 303
9.5 Configuring and Using Linux Audio ....................................................................... 303
9.5.1 A Whirlwind Tour of Digital Audio ................................................................. 304
9.5.2 Audio Under Linux ........................................................................................... 307
9.5.3 Installation and Configuration........................................................................... 308
9.5.4 Linux Multimedia Applications ........................................................................ 313
9.5.5 MP3 Players ...................................................................................................... 314
9.5.6 References ......................................................................................................... 315
9.6 Printing..................................................................................................................... 315
9.6.1 How the Printing System Processes a Queued File........................................... 318
9.6.2 nenscript and enscript........................................................................................ 320
Chapter 10. Installing the X Window System................................................................ 323
10.1 X Concepts ............................................................................................................. 324
10.2 Hardware Requirements......................................................................................... 325
10.3 Installing XFree86.................................................................................................. 328
10.4 Configuring XFree86 ............................................................................................. 330
10.5 Running XFree86 ................................................................................................... 338
10.6 Running into Trouble ............................................................................................. 338
Chapter 11. Customizing Your X Environment............................................................ 340
11.1 Basics of X Customization..................................................................................... 341
11.1.1 xinit.................................................................................................................. 341
11.2 The K Desktop Environment.................................................................................. 344
11.2.1 General Features.............................................................................................. 344
11.2.2 Installing KDE................................................................................................. 346
11.2.3 Using KDE...................................................................................................... 348
11.3 KDE Applications .................................................................................................. 353
11.3.1 konsole: Your Home Base............................................................................... 354
11.3.2 Clocks.............................................................................................................. 357
11.3.3 KGhostview: Displaying PostScript................................................................ 357
11.3.4 Reading Documentation with Konqueror ....................................................... 359
11.4 The GNOME Desktop Environment...................................................................... 360
11.4.1 Installing and Updating GNOME ................................................................... 360
11.4.2 Core Desktop Interface.................................................................................... 361
11.5 GNOME Applications............................................................................................ 366
11.5.1 Ximian Evolution: Mail, Calendar, and Contacts ........................................... 366
11.5.2 Gnumeric Spreadsheet..................................................................................... 369
11.5.3 gPhoto, the Digital Camera Tool..................................................................... 369
11.5.4 Abiword Word Processor ................................................................................ 370
11.5.5 Additional Applications and Resources .......................................................... 371
11.6 Other X Applications ............................................................................................. 371
11.6.1 The X Resource Database ............................................................................... 371
11.6.2 Emacs and Other Editors................................................................................. 374
Chapter 12. Windows Compatibility and Samba.......................................................... 378
12.1 Sharing Disks with MTools.................................................................................... 379
12.1.1 mattrib ............................................................................................................. 381
12.2 Sharing Partitions ................................................................................................... 383
12.2.1 Mounting Windows Shares ............................................................................. 385
12.2.2 Using Samba to Serve SMB Shares ................................................................ 388
12.2.3 File Translation Utilities.................................................................................. 395
12.3 Running MS-DOS and Windows Applications on Linux...................................... 397
Chapter 13. Programming Languages ........................................................................... 399
13.1 Programming with gcc ........................................................................................... 399
13.1.1 Quick Overview .............................................................................................. 400
13.1.2 gcc Features..................................................................................................... 402
13.1.3 Basic gcc Usage .............................................................................................. 403
13.1.4 Using Multiple Source Files............................................................................ 404
13.1.5 Optimizing....................................................................................................... 405
13.1.6 Enabling Debugging Code .............................................................................. 405
13.1.7 More Fun with Libraries ................................................................................. 405
13.1.8 Using C++ ....................................................................................................... 408
13.2 Makefiles................................................................................................................ 409
13.2.1 What make Does ............................................................................................. 409
13.2.2 Some Syntax Rules.......................................................................................... 412
13.2.3 Macros............................................................................................................. 412
13.2.4 Suffix Rules and Pattern Rules........................................................................ 414
13.2.5 Multiple Commands........................................................................................ 415
13.2.6 Including Other makefiles............................................................................... 416
13.2.7 Interpreting make Messages............................................................................ 417
13.2.8 Autoconf, Automake, and Other Makefile Tools............................................ 417
13.3 Shell Programming................................................................................................. 418
13.4 Using Perl............................................................................................................... 421
13.4.1 A Sample Program .......................................................................................... 422
13.4.2 More Features.................................................................................................. 424
13.4.3 Pros and Cons.................................................................................................. 427
13.5 Java......................................................................................................................... 428
13.5.1 The Promise of Java, or Why You Might Want to Use Java .......................... 428
13.5.2 Getting Java for Linux..................................................................................... 430
13.5.3 A Working Example of Java ........................................................................... 430
13.6 Other Languages .................................................................................................... 432
Chapter 14. Tools for Programmers .............................................................................. 437
14.1 Debugging with gdb ............................................................................................... 437
14.1.1 Tracing a Program........................................................................................... 437
14.1.2 Examining a Core File..................................................................................... 441
14.1.3 Debugging a Running Program....................................................................... 446
14.1.4 Changing and Examining Data ....................................................................... 446
14.1.5 Getting Information......................................................................................... 448
14.1.6 Miscellaneous Features ................................................................................... 449
14.2 Programming Tools................................................................................................ 453
14.2.1 Debuggers........................................................................................................ 453
14.2.2 Profiling and Performance Tools .................................................................... 453
14.2.3 Using strace ..................................................................................................... 456
14.2.4 Using Valgrind ................................................................................................ 458
14.2.5 Interface Building Tools.................................................................................. 460
14.2.6 Revision Control Tools — RCS...................................................................... 463
14.2.7 Revision Control Tools — CVS...................................................................... 466
14.2.8 Patching Files .................................................................................................. 470
14.2.9 Indenting Code ................................................................................................ 472
14.3 Integrated Development Environments.................................................................. 473
Chapter 15. TCP/IP and PPP.......................................................................................... 475
15.1 Networking with TCP/IP........................................................................................ 475
15.1.1 TCP/IP Concepts ............................................................................................. 476
15.1.2 Hardware Requirements.................................................................................. 482
15.1.3 Configuring TCP/IP with Ethernet.................................................................. 483
15.2 Dial-up PPP............................................................................................................ 493
15.2.1 Basic PPP Configuration for Modems ............................................................ 494
15.3 PPP over ISDN....................................................................................................... 500
15.3.1 Configuring Your ISDN Hardware ................................................................. 501
15.3.2 Setting Up Synchronous PPP .......................................................................... 504
15.3.3 And If It Does Not Work?............................................................................... 507
15.3.4 Where to Go from Here?................................................................................. 507
15.4 ADSL ..................................................................................................................... 508
15.5 NFS and NIS Configuration................................................................................... 509
15.5.1 Configuring NFS............................................................................................. 510
15.5.2 Configuring NIS.............................................................................................. 511
Chapter 16. The World Wide Web and Electronic Mail.............................................. 514
16.1 The World Wide Web ............................................................................................ 514
16.1.1 Using Konqueror and Other Web Browsers ................................................... 516
16.1.2 Configuring Your Own Web Server ............................................................... 519
16.2 Electronic Mail....................................................................................................... 525
16.2.1 The Postfix MTA ............................................................................................ 526
16.2.2 Getting the Mail to Your Computer with Fetchmail ....................................... 535
16.2.3 Other Email Administrative Issues ................................................................. 536
16.2.4 Using KMail.................................................................................................... 537
16.2.5 Using Mozilla Mail & News ........................................................................... 540
Chapter 17. Basic Security .............................................................................................. 542
17.1 A Perspective on System Security ......................................................................... 542
17.2 Initial Steps in Setting Up a Secure System........................................................... 544
17.2.1 Shutting Down Unwanted Network Daemons ................................................ 544
17.2.2 Top 10 Things You Should Never Do ............................................................ 545
17.3 TCP Wrapper Configuration .................................................................................. 547
17.3.1 Using TCP Wrappers with inetd ..................................................................... 548
17.3.2 Using TCP Wrappers with xinetd ................................................................... 548
17.3.3 /etc/hosts.allow and /etc/hosts.deny ................................................................ 548
17.4 Firewalls: Filtering IP Packets ............................................................................... 550
17.4.1 netfilter Basics................................................................................................. 551
17.4.2 Developing IP Filtering Rulesets .................................................................... 555
17.4.3 IP Filter Management and Script Files............................................................ 556
17.4.4 Sample netfilter Configurations ...................................................................... 556
Chapter 18. LAMP........................................................................................................... 561
18.1 MySQL................................................................................................................... 563
18.2 PHP......................................................................................................................... 569
18.2.1 Some Sample PHP .......................................................................................... 569
18.2.2 PHP4 as an Apache Module............................................................................ 572
18.3 The LAMP Server in Action .................................................................................. 574
Appendix A. Sources of Linux Information................................................................... 576
A.1 Linux Documentation Project ................................................................................. 576
A.2 FTP Sites ................................................................................................................. 577
A.3 World Wide Web Sites............................................................................................ 577
A.3.1 General Documentation.................................................................................... 577
A.3.2 Open Source Projects ....................................................................................... 578
A.3.3 Programming Languages and Tools................................................................. 578
A.3.4 News and Information Sites ............................................................................. 579
A.3.5 Linux Software Directories and Download Sites ............................................. 579
A.3.6 Linux Distributions........................................................................................... 579
A.3.7 Commercial Linux Software Companies ......................................................... 580
A.3.8 Internet RFCs and Other Standards.................................................................. 581
A.3.9 Miscellaneous................................................................................................... 581
Appendix B. Installing Linux on Digital/Compaq Alpha Systems .............................. 582
B.1 Alpha History and Status......................................................................................... 582
B.1.1 The Linux Port and Distributions ..................................................................... 583
B.1.2 Chipsets ............................................................................................................ 584
B.1.3 Sources of Information ..................................................................................... 584
B.1.4 Minimum Hardware ......................................................................................... 586
B.1.5 IDE/ATAPI Drive Support............................................................................... 586
B.1.6 Mice and Serial Ports........................................................................................ 586
B.2 Preparations and General Procedure for Installation ............................................... 586
B.2.1 Potential Incompatibilities and Hardware Problems ........................................ 587
B.2.2 Installation Choices .......................................................................................... 588
B.3 Installing Linux........................................................................................................ 591
B.3.1 General Procedure ............................................................................................ 591
B.3.2 Preparing Software for Installation................................................................... 592
B.3.3 Preparing Hardware for Installation ................................................................. 592
B.3.4 Setting Up the System Firmware to Start the Installation ................................ 593
B.3.5 Loading the Linux Boot Kernel........................................................................ 593
B.4 Tuning and Post-Installation Considerations........................................................... 595
B.4.1 Kernel Tuning................................................................................................... 595
B.4.2 Performance and Library Tuning ..................................................................... 595
B.4.3 Binary Emulation.............................................................................................. 595
B.4.4 Graphical Browser Considerations................................................................... 595
Bibliography ..................................................................................................................... 597
Linux Documentation Project Guides ............................................................................ 597
Linux Documentation Project FAQs.............................................................................. 598
Linux Documentation Project HOWTOs (Partial Listing) ............................................ 598
General Linux Books ..................................................................................................... 599
Unix and Unix Shells ..................................................................................................... 599
Applications ................................................................................................................... 599
The Internet .................................................................................................................... 600
Networks and Communications ..................................................................................... 600
Programming and Linux Internals.................................................................................. 601
System Administration................................................................................................... 601
Security.......................................................................................................................... 601
Colophon ........................................................................................................................... 603


Download this book click here

No comments:

Post a Comment

Related Posts with Thumbnails

Put Your Ads Here!