334 linux system administration

297 205 0
334 linux system administration

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

www.it-ebooks.info www.it-ebooks.info LINUX SYSTEM ADMINISTRATION www.it-ebooks.info Other Linux resources from O’Reilly Related titles Linux Books Resource Center DNS and BIND Linux in a Nutshell Linux iptables Pocket Reference Linux Pocket Guide Linux Network Administrator’s Guide Running Linux LPI Linux Certification in a Nutshell Linux Server Hacks™ Linux Security Cookbook™ linux.oreilly.com is a complete catalog of O’Reilly’s books on Linux and Unix and related technologies, including sample chapters and code examples ONLamp.com is the premier site for the open source web platform: Linux, Apache, MySQL and either Perl, Python, or PHP Conferences O’Reilly brings diverse innovators together to nurture the ideas that spark revolutionary industries We specialize in documenting the latest tools and systems, translating the innovator’s knowledge into useful skills for those in the trenches Visit conferences.oreilly.com for our upcoming events Safari Bookshelf (safari.oreilly.com) is the premier online reference library for programmers and IT professionals Conduct searches across more than 1,000 books Subscribers can zero in on answers to time-critical questions in a matter of seconds Read the books on your Bookshelf from cover to cover or simply flip to the page you need Try it today with a free trial www.it-ebooks.info LINUX SYSTEM ADMINISTRATION Tom Adelstein and Bill Lubanovic Beijing • Cambridge • Farnham • Kưln • Paris • Sebastopol • Taipei • Tokyo www.it-ebooks.info Linux System Administration by Tom Adelstein and Bill Lubanovic Copyright © 2007 O’Reilly Media, Inc All rights reserved Printed in the United States of America Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472 O’Reilly books may be purchased for educational, business, or sales promotional use Online editions are also available for most titles (safari.oreilly.com) For more information, contact our corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com Editor: Andy Oram Production Editor: Laurel R.T Ruma Copyeditor: Rachel Wheeler Proofreader: Laurel R.T Ruma Indexer: John Bickelhaupt Cover Designer: Karen Montgomery Interior Designer: David Futato Illustrators: Robert Romano and Jessamyn Read Printing History: March 2007: First Edition Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc The Linux series designations, Linux System Administration, images of the American West, and related trade dress are trademarks of O’Reilly Media, Inc Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks Where those designations appear in this book, and O’Reilly Media, Inc was aware of a trademark claim, the designations have been printed in caps or initial caps While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein This book uses RepKover™, a durable and flexible lay-flat binding ISBN-10: 0-596-00952-6 ISBN-13: 978-0-596-00952-6 [M] www.it-ebooks.info Table of Contents Preface ix Requirements for a Linux System Administrator About This Book How Can We Help? Where Do You Start? Do You Need a Book? Who Needs You? What System Managers Should Know About Linux What’s Next 2 3 Setting Up a Linux Multifunction Server Server Requirements Installing Debian Logging in Remotely Configuring the Network Changing the Default Debian Packages Setting Up Quotas Providing Domain Name Services Adding a Relational Database: MySQL Configuring Mail Securely with Postfix, POP3, and IMAP Putting Apache to Work Adding FTP Services with ProFTPD Summarizing Your Web Statistics with Webalizer Synchronizing the System Clock Installing Perl Modules Needed by SpamAssassin What’s Next 10 12 13 15 16 18 20 22 33 34 35 36 36 37 v www.it-ebooks.info The Domain Name System 38 DNS Basics Getting into the BIND Setting Up a DNS Server Configuring an Authoritative DNS Server Editing the Configuration Files BIND Tools Troubleshooting BIND What’s Next 38 40 41 44 50 62 66 71 An Initial Internet-Ready Environment 73 Installing ISPConfig Setting Up a Server and Users with ISPConfig Safeguarding a Linux Web Server What’s Next 74 83 96 101 Mail 102 Key Mail Service Terms Postfix, Sendmail, and Other MTAs The Postfix SMTP Mail Server on Debian Adding Authentication and Encryption Configuring POP3 and IMAP Mail Delivery Agents Email Client Configuration What’s Next 103 103 105 111 119 120 121 Administering Apache 122 Static and Dynamic Files A Simple LAMP Setup Installation Apache Configuration Files Logfiles SSL/TLS Encryption suEXEC Support Benchmarking Installing and Administering Drupal Troubleshooting Further Reading vi | Table of Contents 122 123 124 127 140 142 143 144 145 149 153 www.it-ebooks.info Load-Balanced Clusters 154 Load Balancing and High Availability Scaling Without LB and HA Further Reading 154 162 162 Local Network Services 163 Distributed Filesystems Introduction to Samba Configuring the Network DHCP Gateway Services Print Services User Management 164 164 165 168 173 181 186 Virtualization in the Modern Enterprise 194 Why Virtualization Is Popular High-Performance Computing Installing Xen on Fedora Installing VMware Virtualization: A Passing Fad? 194 196 199 204 210 10 Scripting 211 bash Beginnings Useful Elements for bash Scripts Scripting Language Shootout Further Reading 212 218 226 235 11 Backing Up Data 236 Backing Up User Data to a Server with rsync tar Archives Saving Files on Optical Media Backing Up and Archiving to Tape with Amanda Backing Up MySQL Data 237 242 245 251 254 Appendix bash Script Samples 257 Index 273 Table of Contents | vii www.it-ebooks.info www.it-ebooks.info Preface As Bill Lubanovic and I were putting the final touches on this book, I overheard a conversation between two coworkers in our Cisco lab discussing Linux The senior networking guru of the two made an interesting remark He said that despite all his knowledge, he felt incomplete as a professional because he had never learned Linux A moment later he and the other gentleman turned to me and looked me square in the eyes I smiled and went on working That evening, our director of Information Technology made an offhand remark to me during a conference that struck me as unusual He said that he wanted to learn Apache, and when I asked him why he replied, “I just want to learn it,” and left it at that Later in the conference, our director requested feedback from the group on a solution for patch management, explaining and using the example of rsync He said he wanted something similar, while launching into a detailed technical discussion of incremental and cumulative patch management I have a good working knowledge of rsync, but hadn’t heard such a detailed academic explanation of any open source tool in any forum In both of those cases and many others, I wished I had this book ready to hand over to highly trained and skilled people who wanted to learn Linux administration Perhaps you have had similar experiences and wished you had a book like this one at hand I venture to guess that conversations like the ones I’ve just described occur many times in many places daily When Andy Oram and I began discussing a Linux system administration book, we had a slightly different idea of what we wanted to accomplish Andy talked about a book in which each chapter took users through the steps of building and deploying application servers without co-mingling detailed discussions He suggested that the discussion reside in one place in each chapter and the technical steps in another ix ...www.it-ebooks.info LINUX SYSTEM ADMINISTRATION www.it-ebooks.info Other Linux resources from O’Reilly Related titles Linux Books Resource Center DNS and BIND Linux in a Nutshell Linux iptables Pocket... iptables Pocket Reference Linux Pocket Guide Linux Network Administrator’s Guide Running Linux LPI Linux Certification in a Nutshell Linux Server Hacks™ Linux Security Cookbook™ linux. oreilly.com is... www.it-ebooks.info LINUX SYSTEM ADMINISTRATION Tom Adelstein and Bill Lubanovic Beijing • Cambridge • Farnham • Köln • Paris • Sebastopol • Taipei • Tokyo www.it-ebooks.info Linux System Administration

Ngày đăng: 06/03/2019, 17:11

Từ khóa liên quan

Mục lục

  • Linux System Administration

    • Table of Contents

    • Preface

      • How This Book Is Organized

      • Conventions Used in This Book

      • Using Code Examples

      • Safari® Enabled

      • How to Contact Us

      • Acknowledgments

    • Requirements for a Linux System Administrator

      • About This Book

      • How Can We Help?

      • Where Do You Start?

      • Do You Need a Book?

      • Who Needs You?

        • Help Wanted

        • Analyzing Skill Sets

      • What System Managers Should Know About Linux

      • What’s Next

    • Setting Up a Linux Multifunction Server

      • Server Requirements

      • Installing Debian

      • Logging in Remotely

      • Configuring the Network

      • Changing the Default Debian Packages

      • Setting Up Quotas

      • Providing Domain Name Services

      • Adding a Relational Database: MySQL

      • Configuring Mail Securely with Postfix, POP3, and IMAP

      • Putting Apache to Work

      • Adding FTP Services with ProFTPD

      • Summarizing Your Web Statistics with Webalizer

      • Synchronizing the System Clock

      • Installing Perl Modules Needed by SpamAssassin

      • What’s Next

    • The Domain Name System

      • DNS Basics

        • Advantages of Localized DNS Administration

      • Getting into the BIND

        • Components of BIND

      • Setting Up a DNS Server

        • Using a chroot Environment for Security

      • Configuring an Authoritative DNS Server

        • Your Responsibility in DNS

        • The Distributed Method of Resolving Domain Names

        • Finding a Domain

        • Answering Queries

        • Primary and Secondary DNS Servers

        • Caching-Only Servers

      • Editing the Configuration Files

        • named.conf

        • The Primary Zone File

          • Enhancements and advanced features

          • Putting it all together

        • The Reverse Zone File

          • PTR records

        • Testing Lookups

        • Configuring the Secondary Nameserver

      • BIND Tools

        • nslookup

        • rndc

      • Troubleshooting BIND

        • Cannot Connect Using rndc

        • named Starts but Does Not Resolve Names

        • Hosts Aren’t Recognized

      • What’s Next

    • An Initial Internet-Ready Environment

      • Installing ISPConfig

        • Requirements

        • Getting Started

        • ISPConfig Directory Structure

      • Setting Up a Server and Users with ISPConfig

        • Adding Clients and Web Sites

        • Managing Users and Email

          • User, email, home, and public web directories

        • Email Client Configuration

      • Safeguarding a Linux Web Server

        • The Role of a Daemon-Monitoring Daemon

        • Installing and Configuring monit

      • What’s Next

    • Mail

      • Key Mail Service Terms

      • Postfix, Sendmail, and Other MTAs

      • The Postfix SMTP Mail Server on Debian

        • Debian Postfix-Related Packages

        • Installing Postfix on Debian

        • Basic Postfix Configuration

        • Testing Mail

      • Adding Authentication and Encryption

        • SASL Authentication

          • Configuring Postfix with SASL to authenticate users with accounts

          • The saslauthd daemon

          • Configuring Postfix with SASL to authenticate users without accounts

        • TLS Encryption

      • Configuring POP3 and IMAP Mail Delivery Agents

      • Email Client Configuration

      • What’s Next

    • Administering Apache

      • Static and Dynamic Files

      • A Simple LAMP Setup

      • Installation

        • Apache

        • PHP

        • MySQL

      • Apache Configuration Files

        • Configuration File Directives

          • User and Group directives

          • Listen directive

          • DocumentRoot directive

        • Authentication and Authorization

          • User files

          • Group files

        • Containers and Aliases

          • Absolute pathnames: Directory

          • Relative pathnames: Location

          • Pattern matching: Files and FilesMatch

          • Aliases

        • Limits

        • Server-Side Includes

        • CGI

          • Location

          • File suffix

        • PHP Module-Specific Directives

        • Virtual Hosts

          • IP-based virtual hosts

          • Name-based virtual hosts

          • mod_vhost_alias

      • Logfiles

        • Log Splitting and Rotation

        • Splitting Logs with vlogger

        • Analyzing Logs with Webalizer

      • SSL/TLS Encryption

      • suEXEC Support

      • Benchmarking

      • Installing and Administering Drupal

        • Installing Drupal with apt-get

        • Installing Drupal from Source

        • Configuring Drupal

      • Troubleshooting

        • Web Page Doesn’t Appear in Browser

        • Virtual Hosts Don’t Work

        • SSI Doesn’t Work

        • CGI Program Doesn’t Run

        • SSL Doesn’t Work

      • Further Reading

    • Load-Balanced Clusters

      • Load Balancing and High Availability

        • Load-Balancing Software

        • IPVS on the Load Balancer

        • ldirectord

        • Configuring the Realservers (Apache Nodes)

        • Configuring the Load Balancer

        • Testing the System

        • Adding HA to LB

        • Adding Other LB Services

      • Scaling Without LB and HA

      • Further Reading

    • Local Network Services

      • Distributed Filesystems

      • Introduction to Samba

      • Configuring the Network

      • DHCP

        • Installing DHCP

        • Starting Your DHCP Service

        • Providing Static IP Addresses

        • Assigning IPv6 Addresses with radvd

      • Gateway Services

        • Another Approach to Gateway Services

      • Print Services

        • Printing Software Considerations

        • Cross-Platform Printing

        • Controlling Print Queues from the Command Line

      • User Management

        • Removing a User

        • Sealing the Home Directory

        • Graphical User Managers

    • Virtualization in the Modern Enterprise

      • Why Virtualization Is Popular

      • High-Performance Computing

        • Business Continuity and Workload Management

        • Rapid Provisioning

        • How Virtualization Helps

      • Installing Xen on Fedora 5

        • Installing a Xen Guest OS

          • Fedora Core 5

          • Other guests

      • Installing VMware

        • Installing a VMware Guest OS

      • Virtualization: A Passing Fad?

    • Scripting

      • bash Beginnings

        • Pathnames and Permissions

        • The Default Path

        • I/O Redirection

        • Variables

      • Useful Elements for bash Scripts

        • Expressions

        • Arithmetic

        • If...

        • Troubleshooting a Simple Script

        • Loops

        • cron Jobs

      • Scripting Language Shootout

        • Data Format: The /etc/passwd File

        • Script Versions

          • The bash script

          • The Perl script

          • The PHP script

          • The Python script

        • Choosing a Scripting Language

      • Further Reading

    • Backing Up Data

      • Backing Up User Data to a Server with rsync

        • rsync Basics

        • Making a User Backup Script

        • Listing Files on the Backup Server

        • Restoring Lost or Damaged Files

        • Automated Backups

      • tar Archives

        • Creating a New Archive

        • Extracting from an Archive

        • A Complete Example of Packing and Unpacking with tar

        • Summary

      • Saving Files on Optical Media

        • Accessing Your CD-R Drive

        • Setting Defaults

        • Preparing Files to Record on a CD-R

        • Recording the CD-R

        • Verifying the Recording

      • Backing Up and Archiving to Tape with Amanda

        • Installing Amanda

        • Configuring Amanda

        • Restoring Files Backed Up by Amanda

      • Backing Up MySQL Data

    • bash Script Samples

      • Adding Users

      • Random Password Generator

      • Authoritative DNS Lookup

        • Sending Files Between Shell Sessions

      • Integrating ssh and screen

    • Index

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan