Red Hat Linux 7.2 Bible P1

Chia sẻ: Tuyen Thon | Ngày: | Loại File: PDF | Số trang:30

0
50
lượt xem
6
download

Red Hat Linux 7.2 Bible P1

Mô tả tài liệu
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

Linux was a phenomenon waiting to happen. The computer industry suffered from a rift. In the 1980s and 1990s, people had to choose between inexpensive, market−driven PC operating systems from Microsoft and expensive, technology−driven operating systems such as UNIX. Free software was being created all over the world, but lacked a common platform to rally around. Linux has become that common platform.

Chủ đề:
Lưu

Nội dung Text: Red Hat Linux 7.2 Bible P1

  1. Table of Contents Red Hat Linux 7.2 Bible, Unlimited Edition....................................................................................................1 Part I: Getting Started in Red Hat Linux.........................................................................................................5 Chapter List.............................................................................................................................................5 . Chapter 1: An Overview of Red Hat Linux ......................................................................................................6 Overview..................................................................................................................................................6 Introducing Red Hat Linux......................................................................................................................6 What Is Linux? .........................................................................................................................................7 Linux’s Roots in UNIX ............................................................................................................................8 Common Linux Features.........................................................................................................................9 Primary Advantages of Linux................................................................................................................10 What Is Red Hat Linux?........................................................................................................................11 Why Choose Red Hat Linux?................................................................................................................11 New Features in Red Hat Linux 7.2 .......................................................................................................12 Improvements to Linux 2.4 kernel ...........................................................................................12 . GRUB boot manager................................................................................................................13 Journaling file system (ext3)....................................................................................................14 . Additional software packages...................................................................................................14 The Culture of Free Software................................................................................................................15 Summary................................................................................................................................................15 Chapter 2: Installing Red Hat Linux..............................................................................................................17 Quick Installation...................................................................................................................................17 Detailed Installation Instructions...........................................................................................................19 Choosing an installation method ...............................................................................................19 Choosing computer hardware...................................................................................................20 Beginning the installation.........................................................................................................22 Special Installation Procedures..............................................................................................................31 Installing from other media .......................................................................................................32 Kickstart installation.................................................................................................................34 Special Installation Topics.....................................................................................................................39 Partitioning your disks..............................................................................................................39 Reclaiming disk space from existing partitions........................................................................46 Creating install floppy disks.....................................................................................................49 Using GRUB or LILO boot loaders ..........................................................................................51 Reconfiguring the kernel..........................................................................................................59 Troubleshooting Your Installation.........................................................................................................62 Summary................................................................................................................................................64 Part II: Using Red Hat Linux..........................................................................................................................65 Chapter List...........................................................................................................................................65 . Chapter 3: Getting to Know Red Hat Linux..................................................................................................66 Logging in to Red Hat Linux.................................................................................................................66 The login session......................................................................................................................68 The shell interface.....................................................................................................................68 Understanding the Red Hat Linux Shell................................................................................................72 Using the Shell in Red Hat Linux..........................................................................................................72 Locating commands..................................................................................................................73 Red Hat Linux 7.2 Bible, Unlimited Edition 1/851
  2. Table of Contents Chapter 3: Getting to Know Red Hat Linux Rerunning commands...............................................................................................................75 Connecting and expanding commands.....................................................................................79 Using shell environment variables ............................................................................................82 Managing background and foreground processes....................................................................85 Configuring your shell..............................................................................................................87 Working with the Red Hat Linux File System......................................................................................90 Creating files and directories....................................................................................................92 Moving, copying, and deleting files.........................................................................................96 Using the vi Text Editor .........................................................................................................................96 Starting with vi.........................................................................................................................97 . Moving around the file.............................................................................................................99 Searching for text....................................................................................................................100 Using numbers with commands ..............................................................................................101 Summary..............................................................................................................................................101 Chapter 4: Working with the Desktop..........................................................................................................102 Configuring Your Desktop..................................................................................................................102 Running Xconfigurator...........................................................................................................102 Understanding the XF86Config file.......................................................................................103 Getting more information.......................................................................................................104 Starting the X Desktop.........................................................................................................................104 Starting the GUI at boot time ..................................................................................................105 Starting the GUI yourself ........................................................................................................107 Starting the GUI at login time .................................................................................................107 Using the GNOME Desktop Environment..........................................................................................108 Using the GNOME panel .......................................................................................................110 . Using the Nautilus file manager.............................................................................................114 Changing GNOME preferences..............................................................................................115 Exiting GNOME.....................................................................................................................118 Using the KDE Desktop Environment................................................................................................118 . Starting with KDE..................................................................................................................119 KDE desktop described..........................................................................................................119 Managing files with the Konqueror File Manager.................................................................123 . Configuring Konqueror options..............................................................................................127 Managing windows.................................................................................................................129 Configuring the desktop ..........................................................................................................130 Adding application launchers and MIME types.....................................................................133 Changing X Settings............................................................................................................................135 X client command−line options..............................................................................................136 X resource files.......................................................................................................................138 Changing X display resources................................................................................................140 X Application resources ..........................................................................................................143 Summary..............................................................................................................................................144 Chapter 5: Accessing and Running Applications........................................................................................145 Overview..............................................................................................................................................145 Using Red Hat Linux as an Application Platform...............................................................................145 Obtaining Red Hat Linux Applications...............................................................................................146 Finding applications on the Internet.......................................................................................146 Chapter 4: Working with the Desktop 2/851
  3. Table of Contents Chapter 5: Accessing and Running Applications Downloading Linux software.................................................................................................148 Understanding package names and formats ............................................................................150 Installing Red Hat Linux Applications................................................................................................153 Installing and managing RPM files........................................................................................153 Building and installing from source code...............................................................................160 Running X Window Applications ........................................................................................................163 Starting applications from a menu..........................................................................................163 Starting applications from a Run Program window ................................................................164 Starting applications from a Terminal window......................................................................165 Using X Window utilities.......................................................................................................167 Running remote X applications..............................................................................................171 Using Emulators to Run Applications from Other Operating Systems...............................................175 Running DOS applications.....................................................................................................176 Running Windows and Macintosh applications.....................................................................178 Summary..............................................................................................................................................180 Chapter 6: Publishing with Red Hat Linux ..................................................................................................181 Overview..............................................................................................................................................181 Choosing Red Hat Linux as Your Publishing Platform.......................................................................181 Checklist of your document requirements..............................................................................181 Attributes of Linux publishing ................................................................................................183 Creating Documents in Groff or LaTeX..............................................................................................184 Text processing with Groff.....................................................................................................185 Text processing with TeX/LaTeX..........................................................................................193 Converting documents............................................................................................................197 Creating DocBook Documents...............................................................................................198 Understanding SGML and XML............................................................................................198 Using Free and Commercial Word Processors....................................................................................202 Using Anyware Office............................................................................................................203 Using Star Office....................................................................................................................206 Using Corel WordPerfect.......................................................................................................207 . AbiWord.................................................................................................................................207 Printing Documents with Red Hat Linux............................................................................................208 Printing to the default printer..................................................................................................208 Printing from the shell............................................................................................................209 Checking the print queues .......................................................................................................209 Removing print jobs ................................................................................................................210 Checking printer status...........................................................................................................210 Displaying Documents with Ghostscript and Acrobat........................................................................210 . Using the ghostscript and gv commands................................................................................211 Using Adobe Acrobat Reader.................................................................................................211 Working with Graphics........................................................................................................................212 Manipulating photos and images............................................................................................212 Taking screen captures ............................................................................................................212 Creating bitmap images..........................................................................................................213 Using Scanners Driven by SANE........................................................................................................214 Summary..............................................................................................................................................215 Chapter 6: Publishing with Red Hat Linux 3/851
  4. Table of Contents Chapter 7: Playing Games with Red Hat Linux..........................................................................................217 Overview..............................................................................................................................................217 Basic Linux Gaming Information........................................................................................................217 Where to get information on Linux gaming...........................................................................217 Graphical gaming interfaces...................................................................................................218 X Window Games................................................................................................................................219 Gnome games.........................................................................................................................220 KDE games.............................................................................................................................221 X games you can download....................................................................................................228 Character−Based Games......................................................................................................................231 The xmame Gaming Emulator.............................................................................................................232 Supported xmame hardware...................................................................................................232 Getting and installing xmame games......................................................................................233 Commercial Linux Games...................................................................................................................235 Loki Software Games Demos.................................................................................................235 Civilization: Call to Power.....................................................................................................237 Myth II: Soulblighter..............................................................................................................237 Quake III Arena......................................................................................................................238 Summary..............................................................................................................................................238 Chapter 8: Multimedia in Red Hat Linux....................................................................................................240 Overview..............................................................................................................................................240 Listening to Audio...............................................................................................................................240 Configuring your sound card..................................................................................................242 Audio file conversion ..............................................................................................................244 CD audio players....................................................................................................................245 MP3 audio players..................................................................................................................250 MIDI audio players.................................................................................................................254 Playing Video......................................................................................................................................255 Xanim viewer ..........................................................................................................................255 RealPlayer...............................................................................................................................257 Using a Digital Camera with gPhoto...................................................................................................258 MultiMedia Netscape Plug−ins and Helper Apps...............................................................................260 Recording Music CDs..........................................................................................................................261 Configuring an IDE CD−ROM for recording........................................................................262 Creating an Audio CD with cdrecord.....................................................................................263 Ripping CDs with grip............................................................................................................264 Creating CD labels with cdlabelgen.......................................................................................266 Multimedia Technologies in Waiting..................................................................................................267 DVD movies...........................................................................................................................267 Virtual reality..........................................................................................................................267 Summary..............................................................................................................................................268 Part III: Administering Red Hat Linux........................................................................................................269 Chapter List.........................................................................................................................................269 . Chapter 9: Tools for Using the Internet and the Web.................................................................................270 Overview of Internet Tools..................................................................................................................270 Browsing the Web ................................................................................................................................270 Uniform Resource Locators....................................................................................................271 Chapter 7: Playing Games with Red Hat Linux 4/851
  5. Table of Contents Chapter 9: Tools for Using the Internet and the Web Web pages...............................................................................................................................272 Netscape Communicator package ...........................................................................................273 Using the Mozilla browser ......................................................................................................284 Using text−based Web browsers............................................................................................285 Communicating with E−mail...............................................................................................................286 E−mail basics..........................................................................................................................286 Mozilla Mail client.................................................................................................................287 . Text−based mail programs.....................................................................................................292 Participating in Newsgroups................................................................................................................295 Netscape Messenger for newsgroups ......................................................................................295 The Pan newsreader................................................................................................................297 The trn newsreader.................................................................................................................298 . The tin newsreader..................................................................................................................298 Participating in AOL Instant Messaging with Gaim ............................................................................298 Using Remote Login, Copy, and Execution........................................................................................299 Using telnet for remote login..................................................................................................300 Copying files with FTP...........................................................................................................301 Using ssh for remote login/remote execution.........................................................................305 Using the “r” commands: rlogin, rcp, and rsh........................................................................306 Summary..............................................................................................................................................309 Chapter 10: Understanding System Administration...................................................................................310 Overview..............................................................................................................................................310 Using the root Login............................................................................................................................310 Becoming Super User (The su Command)..........................................................................................311 Learning About Administrative Commands, Configuration Files, and Log Files ...............................312 Administrative commands......................................................................................................312 Administrative configuration files..........................................................................................313 Administrative log files..........................................................................................................317 Using other administrative logins...........................................................................................318 Getting to Know Your System .............................................................................................................319 Hostname and Linux version..................................................................................................319 Disk partitions and sizes.........................................................................................................320 Users.......................................................................................................................................320 The kernel...............................................................................................................................321 Graphical Administrative Interfaces....................................................................................................322 Using linuxconf......................................................................................................................322 . Reconfiguring Hardware with kudzu...................................................................................................328 Configuring Modules...........................................................................................................................329 Finding available modules......................................................................................................329 Listing loaded modules...........................................................................................................330 Loading modules .....................................................................................................................331 Removing modules.................................................................................................................331 Working with File Systems ..................................................................................................................331 Mounting file systems .............................................................................................................333 Using the mkfs command to create a file system...................................................................338 Adding a hard disk..................................................................................................................339 Checking System Space.......................................................................................................................342 Displaying system space with df............................................................................................342 Chapter 10: Understanding System Administration 5/851
  6. Table of Contents Chapter 10: Understanding System Administration Checking disk usage with du..................................................................................................342 Finding disk consumption with find.......................................................................................343 Monitoring System Performance.........................................................................................................343 Checking system load average with xload ..............................................................................344 Monitoring CPU usage with top and gtop..............................................................................344 Checking virtual memory and CPU usage with vmstat..........................................................345 Summary..............................................................................................................................................346 Chapter 11: Setting Up and Supporting Users .............................................................................................347 Overview..............................................................................................................................................347 Creating User Accounts.......................................................................................................................347 Setting User Defaults...........................................................................................................................350 Supplying initial login scripts.................................................................................................352 Supplying an initial .bashrc file..............................................................................................352 Supplying an initial .tcshrc file...............................................................................................353 Configuring systemwide shell options ....................................................................................353 Creating Portable Desktops ..................................................................................................................354 Providing Support to Users..................................................................................................................355 Creating a technical support mailbox.....................................................................................355 Resetting a user’s password....................................................................................................356 Modifying accounts................................................................................................................357 Deleting User Accounts.......................................................................................................................358 Checking Disk Quotas.........................................................................................................................359 Sending Mail to All Users...................................................................................................................361 Summary..............................................................................................................................................362 Chapter 12: Automating System Tasks........................................................................................................363 Overview..............................................................................................................................................363 Understanding Shell Scripts .................................................................................................................363 Executing shell scripts............................................................................................................363 Creating user−defined variables in shell scripts.....................................................................364 Performing arithmetic evaluation in shell scripts...................................................................365 Using programming constructs in shell scripts.......................................................................366 Trying some simple shell scripts............................................................................................370 System Initialization............................................................................................................................372 The inittab file .........................................................................................................................372 System Start−up and Shutdown...........................................................................................................376 Starting run−level scripts........................................................................................................376 Understanding run−level scripts.............................................................................................379 Understanding what startup scripts do....................................................................................382 Changing run−level script behavior ........................................................................................383 Reorganizing or removing run−level scripts..........................................................................384 Adding run−level scripts .........................................................................................................385 Managing xinetd services.......................................................................................................386 Manipulating run levels..........................................................................................................387 Scheduling System Tasks....................................................................................................................388 Using at.allow and at.deny ......................................................................................................388 Specifying when jobs are run ..................................................................................................388 Submitting scheduled jobs......................................................................................................389 Chapter 11: Setting Up and Supporting Users 6/851
  7. Table of Contents Chapter 12: Automating System Tasks Viewing scheduled jobs..........................................................................................................390 Deleting scheduled jobs..........................................................................................................390 Using the batch command .......................................................................................................390 Using the cron facility .............................................................................................................391 Summary..............................................................................................................................................394 Chapter 13: Backing Up and Restoring Files...............................................................................................395 Overview..............................................................................................................................................395 Selecting a Backup Strategy................................................................................................................395 Full backup.............................................................................................................................395 Incremental backup.................................................................................................................395 Disk mirroring .........................................................................................................................396 Network backup......................................................................................................................396 Selecting a Backup Medium................................................................................................................396 Magnetic tape ..........................................................................................................................397 Writable CD−ROM drives......................................................................................................398 Backing Up to a Hard Drive................................................................................................................401 Getting and installing mirrordir to clone directories..............................................................401 Cloning a directory with mirrordir.........................................................................................402 . Automating mirroring.............................................................................................................402 Backing Up Files with dump...............................................................................................................403 Creating a backup with dump.................................................................................................403 Understanding dump levels....................................................................................................405 Automating Backups with cron...........................................................................................................405 Restoring Backed Up Files..................................................................................................................407 Restoring an entire file system ................................................................................................408 Recovering individual files.....................................................................................................408 Backing Up Over the Network............................................................................................................410 Performing Network Backups with Multiple Computers....................................................................411 Getting and installing the Amanda package...........................................................................411 Configuring Amanda for network backups............................................................................411 Performing an Amanda backup..............................................................................................415 Using the pax Archiving Tool.............................................................................................................416 . Summary..............................................................................................................................................418 Chapter 14: Computer Security Issues.........................................................................................................419 Hacker versus Cracker.........................................................................................................................419 Password Protection.............................................................................................................................420 Choosing good passwords......................................................................................................420 Changing passwords periodically...........................................................................................421 Using a shadow password file................................................................................................422 Protection from Break−ins...................................................................................................................425 Testing your passwords with Crack........................................................................................425 Obtaining the Crack package..................................................................................................425 Running the Crack command.................................................................................................426 Showing the progress of a Crack run......................................................................................427 Protecting Your Computer by Filtering Network Access....................................................................429 Securing remote shells and logins..........................................................................................430 Disabling network services.....................................................................................................431 Chapter 13: Backing Up and Restoring Files 7/851
  8. Table of Contents Chapter 14: Computer Security Issues Using TCP wrappers...............................................................................................................432 Protecting Your Network with Firewalls.............................................................................................434 Using filtering or proxy firewalls...........................................................................................434 Configuring Red Hat Linux as a filtering firewall .................................................................435 . Configuring Red Hat Linux as a proxy firewall.....................................................................440 Protection against NFS Vulnerabilities ................................................................................................444 Running Security Audits with Tiger....................................................................................................445 Detecting Intrusions from Log Files....................................................................................................447 The role of syslogd.................................................................................................................447 Redirecting logs to a loghost with syslogd.............................................................................448 Understanding the messages logfile.......................................................................................449 Using Tripwire to Detect Tampered Files...........................................................................................450 Configuring Tripwire..............................................................................................................450 Initializing the Tripwire database...........................................................................................451 Rebuilding the policy file.......................................................................................................451 Checking file integrity............................................................................................................452 Updating the database.............................................................................................................452 Protection from Denial−of−Service Attacks ........................................................................................453 Mailbombing ...........................................................................................................................453 Spam relaying.........................................................................................................................454 Smurfing.................................................................................................................................455 Using Encryption Techniques..............................................................................................................455 Symmetric Cryptography ........................................................................................................455 Public−Key Cryptography......................................................................................................456 Exporting encryption technology ............................................................................................456 Using the Secure Shell package..............................................................................................456 Using the ssh and scp commands...........................................................................................457 Monitoring Log Files with Logcheck..................................................................................................458 Downloading and installing Logcheck...................................................................................458 Setting up Logcheck...............................................................................................................459 Running Logcheck..................................................................................................................459 Using Logcheck......................................................................................................................459 Configuring Logcheck to suit your needs...............................................................................460 Guarding Your Computer with PortSentry..........................................................................................465 Downloading and installing PortSentry..................................................................................466 Using PortSentry as−is...........................................................................................................466 Configuring PortSentry...........................................................................................................467 Testing PortSentry..................................................................................................................471 Tracking PortSentry intrusions...............................................................................................472 Restoring access ......................................................................................................................473 Where to Get More Information about Security..................................................................................473 CERT......................................................................................................................................474 CIAC.......................................................................................................................................475 AntiOnline..............................................................................................................................475 Newsgroups............................................................................................................................475 Other miscellaneous tools and resources................................................................................476 Security−related terminology.................................................................................................477 Summary..............................................................................................................................................478 Chapter 13: Backing Up and Restoring Files 8/851
  9. Table of Contents Part IV: Red Hat Linux Network and Server Setup...................................................................................479 Chapter List.........................................................................................................................................479 . Chapter 15: Setting Up a Local Area Network............................................................................................480 Understanding Red Hat Linux and Local Area Networks...................................................................480 Choosing a network topology and equipment........................................................................481 Choosing peer−to−peer vs. client/server models....................................................................484 Setting Up an Ethernet LAN................................................................................................................485 Choosing an Ethernet card......................................................................................................486 Adding Ethernet during Red Hat installation.........................................................................487 Adding Ethernet after Red Hat is installed.............................................................................488 Adding two Ethernet cards.....................................................................................................488 Configuring Host Computers...............................................................................................................488 Understanding IP addresses....................................................................................................489 Getting IP addresses ................................................................................................................491 Adding host names and IP addresses......................................................................................492 Adding other host addresses...................................................................................................494 Adding Windows computers to your LAN.............................................................................495 Checking Your Ethernet Connection...................................................................................................497 Did Linux find your Ethernet driver at boot−time?................................................................497 Can you reach another computer on the LAN?......................................................................497 Is your Ethernet connection up?.............................................................................................498 Watching LAN traffic with Ethereal...................................................................................................499 . Starting Ethereal.....................................................................................................................499 Capturing Ethernet data..........................................................................................................500 Interpreting captured Ethernet data .........................................................................................503 Summary..............................................................................................................................................504 Chapter 16: Connecting to the Internet........................................................................................................505 Overview..............................................................................................................................................505 Understanding How the Internet Is Structured....................................................................................505 Internet domains.....................................................................................................................506 Hostnames and IP addresses...................................................................................................508 Routing ....................................................................................................................................509 Proxies....................................................................................................................................509 Using Dial−up Connections to the Internet.........................................................................................509 Getting information .................................................................................................................509 Setting up dial−up PPP...........................................................................................................510 Launching your PPP connection.............................................................................................514 Checking your PPP connection ...............................................................................................515 Connecting Your LAN to the Internet.................................................................................................519 Setting Up Red Hat Linux as a Router................................................................................................520 . Configuring the Red Hat Linux router ....................................................................................521 Configuring network clients...................................................................................................523 Configuring Windows network clients...................................................................................524 Setting Up Red Hat Linux as a Proxy Server......................................................................................525 Starting the squid daemon .......................................................................................................526 Using a simple squid.conf file................................................................................................527 Modifying the Squid configuration file..................................................................................528 Debugging Squid....................................................................................................................531 Part IV: Red Hat Linux Network and Server Setup 9/851
  10. Table of Contents Chapter 16: Connecting to the Internet Setting Up Proxy Clients.....................................................................................................................533 Configuring Netscape to use a proxy ......................................................................................533 Configuring Internet Explorer to use a proxy.........................................................................534 Configuring Mosaic and Lynx browsers to use a proxy.........................................................535 Summary..............................................................................................................................................536 Chapter 17: Setting Up a Print Server..........................................................................................................537 Overview..............................................................................................................................................537 Printing in Red Hat Linux....................................................................................................................537 Understanding the lpd print daemon .......................................................................................538 Installing a local printer from the desktop..............................................................................540 Configuring a remote printer from the desktop......................................................................542 Choosing a Printer...............................................................................................................................546 Managing Document Printing in Red Hat Linux.................................................................................548 Using lpr to print.....................................................................................................................549 Removing print jobs with lprm...............................................................................................550 Controlling printers with lpc...................................................................................................551 Configuring Print Servers....................................................................................................................552 Configuring a shared Linux printer in lpd.perms...................................................................552 Configuring a shared NetWare printer...................................................................................552 . Configuring a shared Samba printer.......................................................................................553 Summary..............................................................................................................................................554 Chapter 18: Setting Up a File Server............................................................................................................555 Overview..............................................................................................................................................555 Goals of Setting Up a File Server........................................................................................................555 Setting Up an NFS File Server in Red Hat Linux ................................................................................555 Sharing NFS file systems ........................................................................................................557 Using NFS file systems ...........................................................................................................561 Unmounting NFS file systems................................................................................................564 Other cool things to do with NFS...........................................................................................564 Setting Up a Samba File Server in Red Hat Linux..............................................................................565 Getting and installing Samba..................................................................................................566 Quick−starting Samba............................................................................................................566 Configuring Samba with SWAT .............................................................................................569 Creating the Samba server configuration with SWAT...........................................................569 Setting up Samba clients for Windows systems.....................................................................577 Setting Up a NetWare File Server in Red Hat Linux ...........................................................................579 Creating the NetWare file server............................................................................................579 Using NetWare client commands...........................................................................................581 Summary..............................................................................................................................................583 Chapter 19: Setting Up a Mail Server ...........................................................................................................584 Overview..............................................................................................................................................584 Introduction to SMTP and sendmail....................................................................................................584 Installing and Running sendmail.........................................................................................................585 Starting sendmail....................................................................................................................586 Other programs.......................................................................................................................586 Logging performed by sendmail.............................................................................................587 Chapter 17: Setting Up a Print Server 10/851
  11. Table of Contents Chapter 19: Setting Up a Mail Server Configuring sendmail..........................................................................................................................588 sendmail component files.......................................................................................................589 sendmail local info entries......................................................................................................590 sendmail options.....................................................................................................................593 Message precedences..............................................................................................................605 Trusted users...........................................................................................................................605 Format of headers...................................................................................................................606 Rewriting rules ........................................................................................................................606 Mailer definitions ....................................................................................................................607 Using the m4 macro preprocessor..........................................................................................607 The .forward file.....................................................................................................................608 The aliases file........................................................................................................................609 Administering a Mailing List...............................................................................................................610 Installing majordomo..............................................................................................................611 Configuring majordomo.........................................................................................................611 Running majordomo...............................................................................................................611 Summary..............................................................................................................................................612 Chapter 20: Setting Up an FTP Server.........................................................................................................613 Overview..............................................................................................................................................613 Understanding FTP Servers.................................................................................................................613 Attributes of FTP servers........................................................................................................613 FTP user types........................................................................................................................614 Running the FTP Server......................................................................................................................614 Creating FTP Users..............................................................................................................................616 The anonymous FTP user.......................................................................................................617 Real users................................................................................................................................617 Guest users..............................................................................................................................618 Setting Up FTP Directories, Message Files, and Greetings .................................................................619 Creating the FTP directory structure......................................................................................619 Adding helpful information....................................................................................................620 Changing FTP login greetings................................................................................................620 Controlling FTP access........................................................................................................................621 Creating user classes...............................................................................................................621 Allowing uploading of incoming files....................................................................................622 Limiting the number of concurrent users ................................................................................624 Limiting uploading and downloading.....................................................................................625 Denying access from hosts and users.....................................................................................626 Denying access to host computers..........................................................................................626 Limiting host access to anonymous and guest logins.............................................................626 Denying access to real users...................................................................................................626 Denying/allowing user access by UID and GID .....................................................................627 Shutting Down and Restarting the FTP Server....................................................................................627 Shutting down FTP.................................................................................................................627 Restarting FTP........................................................................................................................628 Monitoring the FTP Server..................................................................................................................628 Logging connections...............................................................................................................628 Logging file transfers..............................................................................................................628 Getting More Information About FTP Servers....................................................................................629 Chapter 20: Setting Up an FTP Server 11/851
  12. Table of Contents Chapter 20: Setting Up an FTP Server Trying Out Your FTP Server...............................................................................................................630 Summary..............................................................................................................................................630 Chapter 21: Setting Up a Web Server ...........................................................................................................632 Overview..............................................................................................................................................632 Introduction to Web Servers................................................................................................................632 Quick Starting the Apache Web Server...............................................................................................634 Configuring the Server .........................................................................................................................636 Configuring httpd.conf...........................................................................................................636 . Starting and Stopping the Server.........................................................................................................664 Monitoring Server Activities...............................................................................................................666 Displaying server information................................................................................................666 Displaying server status..........................................................................................................667 Further security of server−info and server−status..................................................................667 Logging errors .........................................................................................................................668 Logging transfers....................................................................................................................668 Analyzing Web server traffic ..................................................................................................669 Summary..............................................................................................................................................670 Chapter 22: Setting Up a News Server.........................................................................................................671 Overview..............................................................................................................................................671 Understanding News Transports..........................................................................................................671 Planning Your News Server................................................................................................................672 . Do you need a news server?...................................................................................................672 Which newsgroups should you offer?....................................................................................672 How should articles be stored?...............................................................................................672 How long are articles stored? ..................................................................................................673 How are servers to provide your news feeds located?............................................................673 What are your newsgroup policies?........................................................................................673 Configuring an INN News Server.......................................................................................................673 . Starting with INN ....................................................................................................................674 Configuring the INN server....................................................................................................675 Setting Up News Feeds........................................................................................................................686 Configuring hosts to feed you .................................................................................................686 Configuring hosts that you feed..............................................................................................687 Getting a list of active newsgroups.........................................................................................689 Choosing How Articles Are Stored.....................................................................................................689 Activating different storage methods ......................................................................................690 Using the timehash storage method........................................................................................691 Using the cnfs storage method................................................................................................691 Setting Up Expiration Times...............................................................................................................693 Allowing Users to Access Your Server...............................................................................................694 Summary..............................................................................................................................................695 Chapter 23: Setting Up Boot Servers—DHCP and NIS ..............................................................................696 Overview..............................................................................................................................................696 Using Dynamic Host Configuration Protocol......................................................................................696 Setting Up a DHCP Server..................................................................................................................697 Configuring the dhcpd.conf file..............................................................................................697 Chapter 21: Setting Up a Web Server 12/851
  13. Table of Contents Chapter 23: Setting Up Boot Servers—DHCP and NIS Starting the DHCP server.......................................................................................................701 Setting Up a DHCP Client...................................................................................................................702 Understanding Network Information Service......................................................................................704 Setting Up Red Hat Linux as an NIS Client........................................................................................705 Defining an NIS domain name...............................................................................................706 Setting up the /etc/yp.conf file................................................................................................706 Configuring NIS client daemons............................................................................................707 Checking that NIS is working .................................................................................................707 Using NIS maps......................................................................................................................708 Setting Up Red Hat Linux as an NIS Master Server...........................................................................709 Creating NIS maps..................................................................................................................709 Setting Up Red Hat Linux as an NIS Slave Server ..............................................................................712 Summary..............................................................................................................................................712 Chapter 24: Setting Up a MySQL Database Server....................................................................................713 Overview..............................................................................................................................................713 Finding MySQL Packages...................................................................................................................713 Configuring the MySQL Server..........................................................................................................714 . Using mysql user/group accounts...........................................................................................714 Adding administrative users...................................................................................................715 Setting MySQL options..........................................................................................................715 Using sample my.cnf files......................................................................................................720 Starting the MySQL Server.................................................................................................................721 Checking that MySQL Server Is Working ...........................................................................................721 Working with MySQL Databases........................................................................................................722 Starting the mysql command..................................................................................................723 Creating a database with mysql..............................................................................................723 Adding data to a MySQL database table................................................................................725 Understanding MySQL Tables............................................................................................................727 Displaying MySQL Databases .............................................................................................................731 Displaying all or selected records...........................................................................................731 Displaying selected columns..................................................................................................732 Sorting data.............................................................................................................................733 Making Changes to Tables and Records ..............................................................................................733 Altering MySQL tables ...........................................................................................................733 Updating and deleting MySQL records..................................................................................734 Adding and Removing User Access....................................................................................................735 Adding users and granting access...........................................................................................735 Revoking access ......................................................................................................................736 Checking and Fixing Databases...........................................................................................................736 Checking and Fixing Databases...........................................................................................................738 Summary..............................................................................................................................................739 Chapter 25: Building a Wireless Linux LAN...............................................................................................740 Overview..............................................................................................................................................740 Understanding Wireless Networks......................................................................................................742 Choosing Wireless Hardware..............................................................................................................743 Selecting wireless cards..........................................................................................................743 Selecting adapter cards...........................................................................................................745 Chapter 24: Setting Up a MySQL Database Server 13/851
  14. Table of Contents Chapter 25: Building a Wireless Linux LAN Selecting antennas ...................................................................................................................745 Installing Wireless Linux Software.....................................................................................................747 Setting Up a Wireless LAN.................................................................................................................748 Choose equipment..................................................................................................................748 . Insert wireless cards................................................................................................................749 Load the modules....................................................................................................................749 Configure wireless cards .........................................................................................................750 Restart wireless interfaces......................................................................................................754 Testing out distances ...............................................................................................................755 Manually Configuring Wireless Cards................................................................................................756 Setting module options...........................................................................................................756 Setting wireless extensions.....................................................................................................758 Troubleshooting a Wireless LAN........................................................................................................760 Check wireless settings...........................................................................................................760 Check TCP/IP.........................................................................................................................761 Adapt to poor reception..........................................................................................................762 Use debugging tools ................................................................................................................762 Summary..............................................................................................................................................763 Chapter 26: Getting Red Hat Linux “up2date”...........................................................................................764 Checking for Updates..........................................................................................................................764 Red Hat Errata page................................................................................................................764 Project Web sites....................................................................................................................764 Getting Updates from Red Hat Network.............................................................................................765 Running rhn_register..............................................................................................................765 Running up2date.....................................................................................................................767 Using the Red Hat Network.................................................................................................................770 Summary..............................................................................................................................................771 Appendix A: What’s on the CD−ROMs?.....................................................................................................772 Appendix B: Red Hat Linux RPMs ...............................................................................................................773 Package Categories..............................................................................................................................773 The Packages.......................................................................................................................................774 Appendix C: Running Network Services......................................................................................................839 Checklist to Running Networking Services.........................................................................................839 Networking Service Daemons.............................................................................................................840 The xinetd super−server.........................................................................................................840 The init.d start−up scripts.......................................................................................................841 Referencing Network Services............................................................................................................841 Web server..............................................................................................................................845 File servers..............................................................................................................................845 Login servers ...........................................................................................................................846 E−mail servers........................................................................................................................846 News server............................................................................................................................846 . Print server..............................................................................................................................847 Network administration servers..............................................................................................847 Network Time Protocol Server...............................................................................................847 Chapter 26: Getting Red Hat Linux “up2date” 14/851
  15. Table of Contents Appendix C: Running Network Services Portmap server........................................................................................................................847 Information servers.................................................................................................................848 Database services....................................................................................................................849 User services...........................................................................................................................849 Security services.....................................................................................................................851 Summary..............................................................................................................................................851 Chapter 26: Getting Red Hat Linux “up2date” 15/851
  16. Red Hat Linux 7.2 Bible, Unlimited Edition Christopher Negus Hungry Minds, Inc. New York, NY • Cleveland, OH • Indianapolis, IN Published by Hungry Minds, Inc. 909 Third Avenue New York, NY 10022 http://www.hungryminds.com/ Copyright © 2002 Hungry Minds, Inc. All rights reserved. No part of this book, including interior design, cover design, and icons, may be reproduced or transmitted in any form, by any means (electronic, photocopying, recording, or otherwise) without the prior written permission of the publisher. ISBN: 0−7645−3630−3 Printed in the United States of America 10 9 8 7 6 5 4 3 2 1 Distributed in the United States by Hungry Minds, Inc. Distributed by CDG Books Canada Inc. for Canada; by Transworld Publishers Limited in the United Kingdom; by IDG Norge Books for Norway; by IDG Sweden Books for Sweden; by IDG Books Australia Publishing Corporation Pty. Ltd. for Australia and New Zealand; by TransQuest Publishers Pte Ltd. for Singapore, Malaysia, Thailand, Indonesia, and Hong Kong; by Gotop Information Inc. for Taiwan; by ICG Muse, Inc. for Japan; by Intersoft for South Africa; by Eyrolles for France; by International Thomson Publishing for Germany, Austria, and Switzerland; by Distribuidora Cuspide for Argentina; by LR International for Brazil; by Galileo Libros for Chile; by Ediciones ZETA S.C.R. Ltda. for Peru; by WS Computer Publishing Corporation, Inc., for the Philippines; by Contemporanea de Ediciones for Venezuela; by Express Computer Distributors for the Caribbean and West Indies; by Micronesia Media Distributor, Inc. for Micronesia; by Chips Computadoras S.A. de C.V. for Mexico; by Editorial Norma de Panama S.A. for Panama; by American Bookshops for Finland. For general information on Hungry Minds’ products and services please contact our Customer Care department within the U.S. at 800−762−2974, outside the U.S. at 317−572−3993 or fax 317−572−4002. For sales inquiries and reseller information, including discounts, premium and bulk quantity sales, and foreign−language translations, please contact our Customer Care department at 800−434−3422, fax 317−572−4002 or write to Hungry Minds, Inc., Attn: Customer Care Department, 10475 Crosspoint Boulevard, Indianapolis, IN 46256. For information on licensing foreign or domestic rights, please contact our Sub−Rights Customer Care department at 212−884−5000. For information on using Hungry Minds’ products and services in the classroom or for ordering examination copies, please contact our Educational Sales department at 800−434−2086 or fax 317−572−4005. For press review copies, author interviews, or other publicity information, please contact our Public Relations
  17. department at 650−653−7000 or fax 650−653−7500. For authorization to photocopy items for corporate, personal, or educational use, please contact Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, or fax 978−750−4470. Library of Congress Cataloging−in−Publication Data LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND AUTHOR HAVE USED THEIR BEST EFFORTS IN PREPARING THIS BOOK. THE PUBLISHER AND AUTHOR MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS BOOK AND SPECIFICALLY DISCLAIM ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. THERE ARE NO WARRANTIES WHICH EXTEND BEYOND THE DESCRIPTIONS CONTAINED IN THIS PARAGRAPH. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES REPRESENTATIVES OR WRITTEN SALES MATERIALS. THE ACCURACY AND COMPLETENESS OF THE INFORMATION PROVIDED HEREIN AND THE OPINIONS STATED HEREIN ARE NOT GUARANTEED OR WARRANTED TO PRODUCE ANY PARTICULAR RESULTS, AND THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY INDIVIDUAL. NEITHER THE PUBLISHER NOR AUTHOR SHALL BE LIABLE FOR ANY LOSS OF PROFIT OR ANY OTHER COMMERCIAL DAMAGES, INCLUDING BUT NOT LIMITED TO SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR OTHER DAMAGES. FULFILLMENT OF EACH COUPON OFFER IS THE SOLE RESPONSIBILITY OF THE OFFEROR. Trademarks: Red Hat is a registered trademark or trademark of Red Hat, Inc. Linux is a registered trademark or trademark of Linus Torvalds. All other trademarks are the property of their respective owners. Hungry Minds, Inc., is not associated with any product or vendor mentioned in this book. Hungry Minds is a trademark of Hungry Minds, Inc. About the Author Chris Negus has been working with UNIX systems, the Internet, and (more recently) Linux systems for more than two decades. During that time, Chris worked at AT&T Bell Laboratories, UNIX System Laboratories, and Novell, helping to develop the UNIX operating system. Features from many of the UNIX projects Chris worked on at AT&T have found their way into Red Hat and other Linux systems. During the past few years, Chris has written several books on UNIX and the Internet, including Caldera OpenLinux Bible, Internet Explorer 4 Bible, and Netscape Plug−ins For Dummies for Hungry Minds (formerly IDG Books Worldwide). He also co−wrote several books for Que Corporation, including The Complete Idiot’s Guide to Networking (second and third editions) and Using UNIX (second edition). Chris’s other writings include articles for Internet World, NetWare Connection, and Visual Developer magazines. At home, Chris enjoys spending time with his wife, Sheree, and his boys, Caleb and Seth. His hobbies include soccer, singing, and exercising with Sheree. Credits Acquisitions Editor Debra Williams Cauley Project Editor Marcia Brochin
  18. Technical Editor Jason Luster Development/Copy Editor Andrea Boucher Editorial Manager Ami Sullivan Senior Vice President, Technical Publishing Richard Swadley Vice President and Publisher Mary Bednarek Project Coordinator Regina Snyder Graphics and Production Specialists ????? Quality Control Technician ????? Permissions Editor Laura Moss Media Development Specialist Gregory Stephens Media Development Coordinator Marisa Pearman Illustrator Kate Shaw Proofreading and Indexing TechBooks, Inc. I dedicate this book to my wife, Sheree. This book would never have happened without her love and support. The 100% comprehensive guide to Red Hat Linux 7.2. Back Cover Whether you're a Linux newbie looking for goof−proof installation tips or a Red Hat veteran who wants the scoop on the latest networking, desktop, and server enhancements, this authoritative guide delivers all the information you need to make the most of Red Hat Linux 7.2. From customizing a desktop to troubleshooting a network or setting up a Web server, it's the only reference you'll ever need to become a Red Hat Linux pro. Inside, you'll find complete coverage of Red Hat Linux • Take advantage of expert tips for fast, painless installation • Learn your way around the Linux shell, file system, and X Window system
  19. • Master Linux administration, from automating system tasks to locking in security • Discover how easy it is to set up a LAN and connect to the Internet • Find expert help on tracking down and fixing typical problems • Get the scoop on configuring servers, from Web and print servers to e−mail and FTP servers
Đồng bộ tài khoản