100% found this document useful (4 votes)
122 views

Pro Linux System Administration Learn To Build Systems For Your Business Using Free and Open Source Software Lieverdink

build

Uploaded by

tarziacotelo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
122 views

Pro Linux System Administration Learn To Build Systems For Your Business Using Free and Open Source Software Lieverdink

build

Uploaded by

tarziacotelo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 61

Download the full version of the textbook now at textbookfull.

com

Pro linux system administration Learn to


build systems for your business using free
and open source software Lieverdink

https://textbookfull.com/product/pro-linux-system-
administration-learn-to-build-systems-for-your-
business-using-free-and-open-source-software-
lieverdink-2/

Explore and download more textbook at https://textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Pro linux system administration Learn to build systems for


your business using free and open source software
Lieverdink
https://textbookfull.com/product/pro-linux-system-administration-
learn-to-build-systems-for-your-business-using-free-and-open-source-
software-lieverdink-2/
textbookfull.com

Beginning Ubuntu for Windows and Mac Users : Start your


Journey into Free and Open Source Software Haines

https://textbookfull.com/product/beginning-ubuntu-for-windows-and-mac-
users-start-your-journey-into-free-and-open-source-software-haines/

textbookfull.com

Beginning Ubuntu for Windows and Mac Users: Start your


Journey into Free and Open Source Software Nathan Haines

https://textbookfull.com/product/beginning-ubuntu-for-windows-and-mac-
users-start-your-journey-into-free-and-open-source-software-nathan-
haines/
textbookfull.com

CompTIA Network Review Guide Fourth Edition. Edition Craig


Zacker

https://textbookfull.com/product/comptia-network-review-guide-fourth-
edition-edition-craig-zacker/

textbookfull.com
Oral History and Mathematics Education Antonio Vicente
Marafioti Garnica

https://textbookfull.com/product/oral-history-and-mathematics-
education-antonio-vicente-marafioti-garnica/

textbookfull.com

Cultural Perceptions of Violence in the Hellenistic World


1st Edition Michael Champion

https://textbookfull.com/product/cultural-perceptions-of-violence-in-
the-hellenistic-world-1st-edition-michael-champion/

textbookfull.com

Obstetric Imaging: Fetal Diagnosis and Care Joshua A.


Copel Et Al.

https://textbookfull.com/product/obstetric-imaging-fetal-diagnosis-
and-care-joshua-a-copel-et-al/

textbookfull.com

A Murder on Poet's Hill (Ella Daniels Mystery 2) 1st


Edition J. A. Whiting

https://textbookfull.com/product/a-murder-on-poets-hill-ella-daniels-
mystery-2-1st-edition-j-a-whiting/

textbookfull.com

Universe Freedman

https://textbookfull.com/product/universe-freedman/

textbookfull.com
Interactive Storytelling 12th International Conference on
Interactive Digital Storytelling ICIDS 2019 Little
Cottonwood Canyon UT USA November 19 22 2019 Proceedings
Rogelio E. Cardona-Rivera
https://textbookfull.com/product/interactive-storytelling-12th-
international-conference-on-interactive-digital-storytelling-
icids-2019-little-cottonwood-canyon-ut-usa-
november-19-22-2019-proceedings-rogelio-e-cardona-rivera/
textbookfull.com
Pro Linux System
Administration
Learn to Build Systems for Your Business
Using Free and Open Source Software

Second Edition

Dennis Matotek
James Turnbull
Peter Lieverdink
Pro Linux System
Administration
Learn to Build Systems for Your Business
Using Free and Open Source Software

Second Edition

Dennis Matotek
James Turnbull
Peter Lieverdink
Pro Linux System Administration: Learn to Build Systems for Your Business Using Free and Open Source
Software
Dennis Matotek James Turnbull Peter Lieverdink
Footscray, Victoria, Brooklyn, New York, North Melbourne, Victoria,
Australia United States Australia
ISBN-13 (pbk): 978-1-4842-2007-8 ISBN-13 (electronic): 978-1-4842-2008-5
DOI 10.1007/978-1-4842-2008-5
Library of Congress Control Number: 2017935471
Copyright © 2017 by Dennis Matotek, James Turnbull and Peter Lieverdink
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are
not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director: Welmoed Spahr
Editorial Director: Todd Green
Acquisitions Editor: Louise Corrigan
Development Editor: James Markham
Technical Reviewer: Sander van Vugt
Coordinating Editor: Nancy Chen
Copy Editors: Lori Jacobs and Kim Wimpsett
Compositor: SPi Global
Indexer: SPi Global
Artist: SPi Global
Distributed to the book trade worldwide by Springer Science+Business Media New York,
233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail
orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC
and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM
Finance Inc is a Delaware corporation.
For information on translations, please e-mail rights@apress.com, or visit www.apress.com/rights-permissions.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales web
page at www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub via the book's product page, located at www.apress.com/9781484220078. For more
detailed information, please visit www.apress.com/source-code.
Printed on acid-free paper
To Bianca, Ziggy, Anika, Othello, plus the cute little chickens.
And special thanks to Sander whose knowledge and advice were invaluable on this book.

—Dennis
Contents at a Glance

About the Authors���������������������������������������������������������������������������������������������������xxi


About the Technical Reviewer������������������������������������������������������������������������������xxiii


■Part I: The Beginning�������������������������������������������������������������������������� 1

■Chapter 1: Introducing Linux��������������������������������������������������������������������������������� 3

■Chapter 2: Installing Linux���������������������������������������������������������������������������������� 11

■Chapter 3: Introducing VirtualBox, Git, and Vagrant�������������������������������������������� 73

■Chapter 4: Linux Basics��������������������������������������������������������������������������������������� 99

■Chapter 5: Users and Groups����������������������������������������������������������������������������� 147

■Chapter 6: Startup and Services������������������������������������������������������������������������ 181

■Chapter 7: Networking and Firewalls���������������������������������������������������������������� 217

■Chapter 8: Package Management���������������������������������������������������������������������� 297

■Chapter 9: Storage Management and Disaster Recovery���������������������������������� 357


■Part II: Making Linux Work for You������������������������������������������������� 415

■Chapter 10: Infrastructure Services: NTP, DNS, DHCP, and SSH������������������������� 417

■Chapter 11: Web and SQL Services�������������������������������������������������������������������� 473

■Chapter 12: Mail Services��������������������������������������������������������������������������������� 525

■Chapter 13: File Sharing and Printing��������������������������������������������������������������� 595

■Chapter 14: Backup and Recovery�������������������������������������������������������������������� 635

■Chapter 15: Networking with VPNs������������������������������������������������������������������� 701

■Chapter 16: Directory Services�������������������������������������������������������������������������� 733

v
■ Contents at a Glance


■Chapter 17: Performance Monitoring and Optimization������������������������������������ 799

■Chapter 18: Logging and Monitoring����������������������������������������������������������������� 839

■Chapter 19: Configuration Management������������������������������������������������������������ 911

Index��������������������������������������������������������������������������������������������������������������������� 983

vi
Contents

About the Authors���������������������������������������������������������������������������������������������������xxi


About the Technical Reviewer������������������������������������������������������������������������������xxiii


■Part I: The Beginning�������������������������������������������������������������������������� 1

■Chapter 1: Introducing Linux��������������������������������������������������������������������������������� 3
Linux Distributions����������������������������������������������������������������������������������������������������������� 3
Red Hat Enterprise Linux������������������������������������������������������������������������������������������������������������������������ 4
CentOS���������������������������������������������������������������������������������������������������������������������������������������������������� 5
The Fedora Project��������������������������������������������������������������������������������������������������������������������������������� 5
Debian Linux������������������������������������������������������������������������������������������������������������������������������������������� 5
Ubuntu���������������������������������������������������������������������������������������������������������������������������������������������������� 5
Gentoo���������������������������������������������������������������������������������������������������������������������������������������������������� 6
So Which Distribution Should You Choose?�������������������������������������������������������������������������������������������� 6
So Which Distributions Does This Book Cover?�������������������������������������������������������������������������������������� 7

Picking Hardware������������������������������������������������������������������������������������������������������������� 7
Supported Hardware�������������������������������������������������������������������������������������������������������� 8
Getting the Software�������������������������������������������������������������������������������������������������������� 8
Getting Support���������������������������������������������������������������������������������������������������������������� 9
Summary������������������������������������������������������������������������������������������������������������������������ 10

■Chapter 2: Installing Linux���������������������������������������������������������������������������������� 11
LiveCDs and Virtual Machines���������������������������������������������������������������������������������������� 12
LiveCDs������������������������������������������������������������������������������������������������������������������������������������������������� 12
Virtual Machines����������������������������������������������������������������������������������������������������������������������������������� 12

vii
■ Contents

CentOS Server Installation��������������������������������������������������������������������������������������������� 13


Ubuntu Installation��������������������������������������������������������������������������������������������������������� 53
Troubleshooting�������������������������������������������������������������������������������������������������������������� 71
Diagnostic Information������������������������������������������������������������������������������������������������������������������������� 71
Restarting Your Installation������������������������������������������������������������������������������������������������������������������� 71
Troubleshooting Resources������������������������������������������������������������������������������������������������������������������ 71

Summary������������������������������������������������������������������������������������������������������������������������ 72

■Chapter 3: Introducing VirtualBox, Git, and Vagrant�������������������������������������������� 73
VirtualBox Installation���������������������������������������������������������������������������������������������������� 74
Licensing���������������������������������������������������������������������������������������������������������������������������������������������� 74
Creating a New VirtualBox Machine����������������������������������������������������������������������������������������������������� 75
Installing Git������������������������������������������������������������������������������������������������������������������������������������������ 82
Git Basics���������������������������������������������������������������������������������������������������������������������������������������������� 86
Introducing Vagrant������������������������������������������������������������������������������������������������������������������������������ 87
Installing Vagrant���������������������������������������������������������������������������������������������������������������������������������� 88
Vagrant Concepts��������������������������������������������������������������������������������������������������������������������������������� 88
Getting Started with Vagrant���������������������������������������������������������������������������������������������������������������� 89

Summary������������������������������������������������������������������������������������������������������������������������ 97

■Chapter 4: Linux Basics��������������������������������������������������������������������������������������� 99
Getting Started��������������������������������������������������������������������������������������������������������������� 99
Logging In������������������������������������������������������������������������������������������������������������������������������������������� 100

Linux vs. Microsoft Windows���������������������������������������������������������������������������������������� 102


The GUI Desktop��������������������������������������������������������������������������������������������������������������������������������� 103
The Command Line����������������������������������������������������������������������������������������������������������������������������� 104
Shells�������������������������������������������������������������������������������������������������������������������������������������������������� 106
Command-Line Prompt����������������������������������������������������������������������������������������������������������������������� 107
Typing Your First Command���������������������������������������������������������������������������������������������������������������� 108

Remote Access������������������������������������������������������������������������������������������������������������� 110


Using SSH������������������������������������������������������������������������������������������������������������������������������������������� 110

viii
■ Contents

Getting Help������������������������������������������������������������������������������������������������������������������ 112


Users and Groups��������������������������������������������������������������������������������������������������������� 114
Services and Processes����������������������������������������������������������������������������������������������� 114
Packages���������������������������������������������������������������������������������������������������������������������� 117
Files and Filesystems��������������������������������������������������������������������������������������������������� 117
File Types and Permissions���������������������������������������������������������������������������������������������������������������� 122
Links��������������������������������������������������������������������������������������������������������������������������������������������������� 129
Users, Groups, and Ownership����������������������������������������������������������������������������������������������������������� 130
Size and Space����������������������������������������������������������������������������������������������������������������������������������� 130
Date and Time������������������������������������������������������������������������������������������������������������������������������������� 131

Working with Files�������������������������������������������������������������������������������������������������������� 132


Reading Files�������������������������������������������������������������������������������������������������������������������������������������� 132
Searching for Files������������������������������������������������������������������������������������������������������������������������������ 137
Copying Files�������������������������������������������������������������������������������������������������������������������������������������� 138
Moving and Renaming Files��������������������������������������������������������������������������������������������������������������� 141
Deleting Files�������������������������������������������������������������������������������������������������������������������������������������� 142
Linking Files��������������������������������������������������������������������������������������������������������������������������������������� 142
Editing Files���������������������������������������������������������������������������������������������������������������������������������������� 143

Summary���������������������������������������������������������������������������������������������������������������������� 145

■Chapter 5: Users and Groups����������������������������������������������������������������������������� 147
What Happens When You Log In?��������������������������������������������������������������������������������� 147
Working with Users and Groups����������������������������������������������������������������������������������� 148
Introducing sudo��������������������������������������������������������������������������������������������������������������������������������� 149
Creating Users������������������������������������������������������������������������������������������������������������������������������������ 150
Creating Groups���������������������������������������������������������������������������������������������������������������������������������� 153
Deleting Users and Groups����������������������������������������������������������������������������������������������������������������� 156
Managing Users and Groups via the GUI�������������������������������������������������������������������������������������������� 157
Passwords������������������������������������������������������������������������������������������������������������������������������������������ 160
Password Aging���������������������������������������������������������������������������������������������������������������������������������� 161
Disabling Users����������������������������������������������������������������������������������������������������������������������������������� 163

ix
■ Contents

Storing User Data������������������������������������������������������������������������������������������������������������������������������� 164


Storing Group Data����������������������������������������������������������������������������������������������������������������������������� 166
Configuring Your Shell and Environment�������������������������������������������������������������������������������������������� 167

Controlling Access to Your Host������������������������������������������������������������������������������������ 170


Configuring PAM��������������������������������������������������������������������������������������������������������������������������������� 170

More about sudo���������������������������������������������������������������������������������������������������������� 174


Configuring sudo�������������������������������������������������������������������������������������������������������������������������������� 175

Summary���������������������������������������������������������������������������������������������������������������������� 180

■Chapter 6: Startup and Services������������������������������������������������������������������������ 181
What Happens When Your Host Starts?������������������������������������������������������������������������ 181
Powering On��������������������������������������������������������������������������������������������������������������������������������������� 181
Boot Loaders��������������������������������������������������������������������������������������������������������������������������������������� 184
Starting the Operating System����������������������������������������������������������������������������������������������������������� 185

Understanding the GRUB2 Boot Loader������������������������������������������������������������������������ 186


Using the GRUB2 Menu����������������������������������������������������������������������������������������������������������������������� 186
Configuring GRUB2����������������������������������������������������������������������������������������������������������������������������� 188
Securing Your Boot Loader����������������������������������������������������������������������������������������������������������������� 192

What Happens After You Boot?������������������������������������������������������������������������������������� 193


Understanding Systemd��������������������������������������������������������������������������������������������������������������������� 194
Upstart: Ubuntu’s Init�������������������������������������������������������������������������������������������������������������������������� 198
Remembering SystemV���������������������������������������������������������������������������������������������������������������������� 200
Managing Services������������������������������������������������������������������������������������������������������� 203
Managing Services with Systemd������������������������������������������������������������������������������������������������������ 204

Shutting Down and Rebooting Your Linux Host������������������������������������������������������������ 210


Scheduling Services and Commands��������������������������������������������������������������������������� 210
Systemd Timers���������������������������������������������������������������������������������������������������������������������������������� 211
Introducing Cron��������������������������������������������������������������������������������������������������������������������������������� 212

Summary���������������������������������������������������������������������������������������������������������������������� 216

x
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
■ Contents


■Chapter 7: Networking and Firewalls���������������������������������������������������������������� 217
Introduction to Networks and Networking������������������������������������������������������������������� 218
Getting Started with Interfaces����������������������������������������������������������������������������������������������������������� 222
Managing Interfaces��������������������������������������������������������������������������������������������������������������������������� 226
Configuring Networks with Network Scripts�������������������������������������������������������������������������������������� 235
Network Configuration Files for Ubuntu��������������������������������������������������������������������������������������������� 242
TCP/IP 101������������������������������������������������������������������������������������������������������������������������������������������ 247
General Network Troubleshooting�������������������������������������������������������������������������������� 249
Ping!��������������������������������������������������������������������������������������������������������������������������������������������������� 249
MTR���������������������������������������������������������������������������������������������������������������������������������������������������� 250
The tcpdump Command��������������������������������������������������������������������������������������������������������������������� 251
The Netcat Tool����������������������������������������������������������������������������������������������������������������������������������� 254
You Dig It?������������������������������������������������������������������������������������������������������������������������������������������� 255
Other Troubleshooting Tools��������������������������������������������������������������������������������������������������������������� 257
Adding Routes and Forwarding Packets��������������������������������������������������������������������������������������������� 257
Netfilter and iptables�������������������������������������������������������������������������������������������������������������������������� 263
How Netfilter/iptables Work���������������������������������������������������������������������������������������������������������������� 263
Tables������������������������������������������������������������������������������������������������������������������������������������������������� 265
Chains������������������������������������������������������������������������������������������������������������������������������������������������� 265
Policies����������������������������������������������������������������������������������������������������������������������������������������������� 267
Network Address Translation�������������������������������������������������������������������������������������������������������������� 267
Using the Firewall-cmd Command����������������������������������������������������������������������������������������������������� 268
Using the ufw Command�������������������������������������������������������������������������������������������������������������������� 270
Using the iptables Command�������������������������������������������������������������������������������������������������������������� 273
Explaining Firewall Rules������������������������������������������������������������������������������������������������������������������� 279
Logging and Rate Limiting and Securing Netfilter������������������������������������������������������������������������������ 282
Further Exploring firewall-cmd����������������������������������������������������������������������������������������������������������� 286

TCP Wrappers��������������������������������������������������������������������������������������������������������������� 287


Setting Up a ppp Connection���������������������������������������������������������������������������������������� 288
ADSL Setup Using nmcli��������������������������������������������������������������������������������������������������������������������� 288

Summary���������������������������������������������������������������������������������������������������������������������� 295

xi
■ Contents


■Chapter 8: Package Management���������������������������������������������������������������������� 297
Introduction to Package Management������������������������������������������������������������������������� 297
Package Management on CentOS�������������������������������������������������������������������������������� 299
Getting Started����������������������������������������������������������������������������������������������������������������������������������� 300
The Application Installer��������������������������������������������������������������������������������������������������������������������� 300
Yellowdog Updater Modified��������������������������������������������������������������������������������������������������������������� 306
DNF – or Dandified YUM��������������������������������������������������������������������������������������������������������������������� 314
Red Hat Package Management���������������������������������������������������������������������������������������������������������� 315
Package Management on Ubuntu�������������������������������������������������������������������������������� 322
Aptitude���������������������������������������������������������������������������������������������������������������������������������������������� 323
Package Management with Ubuntu Software App����������������������������������������������������������������������������� 335
Using dpkg������������������������������������������������������������������������������������������������������������������������������������������ 343
Examining Package Details���������������������������������������������������������������������������������������������������������������� 346
Examining Package Contents������������������������������������������������������������������������������������������������������������� 347
Performing a File Search�������������������������������������������������������������������������������������������������������������������� 347
Installing Packages����������������������������������������������������������������������������������������������������������������������������� 347
Removing a Package�������������������������������������������������������������������������������������������������������������������������� 348

Compiling from Source������������������������������������������������������������������������������������������������� 348


Configure�������������������������������������������������������������������������������������������������������������������������������������������� 350
Compile and Make������������������������������������������������������������������������������������������������������������������������������ 352
Install�������������������������������������������������������������������������������������������������������������������������������������������������� 353
Uninstall���������������������������������������������������������������������������������������������������������������������������������������������� 354
Creating Packages with FPM�������������������������������������������������������������������������������������������������������������� 354

Summary���������������������������������������������������������������������������������������������������������������������� 355

■Chapter 9: Storage Management and Disaster Recovery���������������������������������� 357
Storage Basics������������������������������������������������������������������������������������������������������������� 357
Devices����������������������������������������������������������������������������������������������������������������������������������������������� 357
Partitions���������������������������������������������������������������������������������������������������������������������� 359
Filesystems������������������������������������������������������������������������������������������������������������������ 366
Creating Swap Filesystem������������������������������������������������������������������������������������������������������������������ 368
Creating an Ext4 Partition������������������������������������������������������������������������������������������������������������������� 370
xii
■ Contents

Tweaking ext2, ext3, and ext4 Filesystem Options����������������������������������������������������������������������������� 371


The XFS Filesystem���������������������������������������������������������������������������������������������������������������������������� 373

The Btrfs Filesystem���������������������������������������������������������������������������������������������������� 374


Filesystems for Data Sharing������������������������������������������������������������������������������������������������������������� 378
Other Filesystems������������������������������������������������������������������������������������������������������������������������������� 379

Using Your Filesystem�������������������������������������������������������������������������������������������������� 379


Automating Mounts���������������������������������������������������������������������������������������������������������������������������� 381
Checking Filesystem Usage���������������������������������������������������������������������������������������������������������������� 384

RAID������������������������������������������������������������������������������������������������������������������������������ 386
Types of RAID�������������������������������������������������������������������������������������������������������������������������������������� 386

Logical Volume Management��������������������������������������������������������������������������������������� 396


Creating Groups and Volumes������������������������������������������������������������������������������������������������������������ 396
Expanding a Logical Volume��������������������������������������������������������������������������������������������������������������� 399
Shrinking a Logical Volume���������������������������������������������������������������������������������������������������������������� 400
LVM Commands���������������������������������������������������������������������������������������������������������������������������������� 401

Recovering from Failure����������������������������������������������������������������������������������������������� 402


Boot Loader Problems������������������������������������������������������������������������������������������������������������������������ 405
Disk Failure����������������������������������������������������������������������������������������������������������������������������������������� 411

Summary���������������������������������������������������������������������������������������������������������������������� 413


■Part II: Making Linux Work for You������������������������������������������������� 415

■Chapter 10: Infrastructure Services: NTP, DNS, DHCP, and SSH������������������������� 417
Keeping Time���������������������������������������������������������������������������������������������������������������� 417
Time with timedatectl������������������������������������������������������������������������������������������������������������������������� 418
Network Time Protocol����������������������������������������������������������������������������������������������������������������������� 419
The Global NTP Server Pool���������������������������������������������������������������������������������������������������������������� 422
Chrony������������������������������������������������������������������������������������������������������������������������������������������������ 424

Domain Name System�������������������������������������������������������������������������������������������������� 427


Root Servers��������������������������������������������������������������������������������������������������������������������������������������� 427
Querying Name Servers���������������������������������������������������������������������������������������������������������������������� 429
Running Caching DNS������������������������������������������������������������������������������������������������������������������������� 437

xiii
■ Contents

Authoritative DNS������������������������������������������������������������������������������������������������������������������������������� 443


Dynamic DNS�������������������������������������������������������������������������������������������������������������������������������������� 454

Dynamic Host Configuration Protocol��������������������������������������������������������������������������� 455


Installing and Configuring������������������������������������������������������������������������������������������������������������������� 455
Static Lease Assignments������������������������������������������������������������������������������������������������������������������ 457
Dynamic DNS Updates������������������������������������������������������������������������������������������������������������������������ 459
Manually Changing DNS Entries��������������������������������������������������������������������������������������������������������� 463

Secure Shell����������������������������������������������������������������������������������������������������������������� 463


Creating and Distributing Keys����������������������������������������������������������������������������������������������������������� 464
Using SSH Agent��������������������������������������������������������������������������������������������������������������������������������� 465
Tweaking SSH Configuration�������������������������������������������������������������������������������������������������������������� 466
Performing Quick and Secure File Transfers�������������������������������������������������������������������������������������� 470

Summary���������������������������������������������������������������������������������������������������������������������� 471

■Chapter 11: Web and SQL Services�������������������������������������������������������������������� 473
Apache Web Server������������������������������������������������������������������������������������������������������ 473
Installation and Configuration������������������������������������������������������������������������������������������������������������� 474
HTTPD Performance��������������������������������������������������������������������������������������������������������������������������� 482
Access Restriction������������������������������������������������������������������������������������������������������������������������������ 483
Modules���������������������������������������������������������������������������������������������������������������������������������������������� 486
File and Directory Permissions����������������������������������������������������������������������������������������������������������� 488

SQL Database��������������������������������������������������������������������������������������������������������������� 488


Installation������������������������������������������������������������������������������������������������������������������������������������������ 489
Testing the Server������������������������������������������������������������������������������������������������������������������������������ 491
MariaDB Storage Engines������������������������������������������������������������������������������������������������������������������� 492
Basic Tuning for XtraDB���������������������������������������������������������������������������������������������������������������������� 493
Basic MariaDB Administration������������������������������������������������������������������������������������������������������������ 496

Managing Web Site Contents��������������������������������������������������������������������������������������� 499


Web Presence������������������������������������������������������������������������������������������������������������������������������������� 500
Securing Your Web Services with SSL/TLS Certificates��������������������������������������������������������������������� 505
Creating HTTPS Certificates with Let’s Encrypt���������������������������������������������������������������������������������� 514
Other Web Applications����������������������������������������������������������������������������������������������������������������������� 518

xiv
■ Contents

Web Caching���������������������������������������������������������������������������������������������������������������� 518


Squid-Cache��������������������������������������������������������������������������������������������������������������������������������������� 519

Summary���������������������������������������������������������������������������������������������������������������������� 524

■Chapter 12: Mail Services��������������������������������������������������������������������������������� 525
How Does E-mail Work?����������������������������������������������������������������������������������������������� 525
What Happens When You Send an E-mail?����������������������������������������������������������������������������������������� 526
What Happens After You Send an E-Mail?������������������������������������������������������������������������������������������ 529

Configuring E-mail������������������������������������������������������������������������������������������������������� 530


Installation������������������������������������������������������������������������������������������������������������������������������������������ 530
Starting Postfix����������������������������������������������������������������������������������������������������������������������������������� 531
Understanding Postfix Configuration�������������������������������������������������������������������������������������������������� 532
Initial Configuration���������������������������������������������������������������������������������������������������������������������������� 535
Testing Postfix������������������������������������������������������������������������������������������������������������������������������������ 537
Choosing a Mailbox Format���������������������������������������������������������������������������������������������������������������� 541

Extending Postfix Configuration����������������������������������������������������������������������������������� 544


Using Encryption��������������������������������������������������������������������������������������������������������������������������������� 544
Authentication������������������������������������������������������������������������������������������������������������������������������������ 549

Postfix Lookup Tables and Virtual Domains������������������������������������������������������������������ 559


Getting Help for Postfix������������������������������������������������������������������������������������������������ 561
Combating Viruses and Spam�������������������������������������������������������������������������������������� 562
Fighting Spam������������������������������������������������������������������������������������������������������������������������������������ 562
Antivirus��������������������������������������������������������������������������������������������������������������������������������������������� 573
Installing ClamAV�������������������������������������������������������������������������������������������������������������������������������� 574
Configuring ClamAV���������������������������������������������������������������������������������������������������������������������������� 578
What to Do with an Infected E-mail?�������������������������������������������������������������������������������������������������� 579

Configuring IMAP and POP3����������������������������������������������������������������������������������������� 585


IMAP��������������������������������������������������������������������������������������������������������������������������������������������������� 585
POP3��������������������������������������������������������������������������������������������������������������������������������������������������� 585
What’s the Difference?����������������������������������������������������������������������������������������������������������������������� 585
Choosing Between IMAP and POP3���������������������������������������������������������������������������������������������������� 586
Introducing Dovecot IMAP������������������������������������������������������������������������������������������������������������������ 586
xv
■ Contents

Virtual Domains and Users������������������������������������������������������������������������������������������� 592


Alternative Mail Servers for Linux�������������������������������������������������������������������������������� 592
Summary���������������������������������������������������������������������������������������������������������������������� 593

■Chapter 13: File Sharing and Printing��������������������������������������������������������������� 595
File Sharing with Samba and NFS�������������������������������������������������������������������������������� 595
Samba�������������������������������������������������������������������������������������������������������������������������� 596
Configuring Samba AD������������������������������������������������������������������������������������������������������������������������ 597
Testing Samba������������������������������������������������������������������������������������������������������������������������������������ 599
Configuring Samba Shares����������������������������������������������������������������������������������������������������������������� 601
Adding Users to Samba���������������������������������������������������������������������������������������������������������������������� 605
Required iptables Rules for Samba���������������������������������������������������������������������������������������������������� 608

Mounting Samba Shares on Linux������������������������������������������������������������������������������� 609


Mounting Shares on macOS��������������������������������������������������������������������������������������������������������������� 611
Resources������������������������������������������������������������������������������������������������������������������������������������������� 613

NFS Shares: Linux to Linux������������������������������������������������������������������������������������������� 614


Troubleshooting NFS��������������������������������������������������������������������������������������������������������������������������� 616
Resources������������������������������������������������������������������������������������������������������������������������������������������� 616

Distributed Network Filesystems��������������������������������������������������������������������������������� 616


GlusterFS�������������������������������������������������������������������������������������������������������������������������������������������� 617

Managing Documents�������������������������������������������������������������������������������������������������� 626


Using Document Management Systems��������������������������������������������������������������������������������������������� 626

Print Servers���������������������������������������������������������������������������������������������������������������� 627


CUPS��������������������������������������������������������������������������������������������������������������������������������������������������� 627

Summary���������������������������������������������������������������������������������������������������������������������� 634

■Chapter 14: Backup and Recovery�������������������������������������������������������������������� 635
Disaster Recover Planning������������������������������������������������������������������������������������������� 635
Backup Process������������������������������������������������������������������������������������������������������������ 637
Things to Think About������������������������������������������������������������������������������������������������������������������������� 638

Network Backups��������������������������������������������������������������������������������������������������������� 639

xvi
■ Contents

Using rsync������������������������������������������������������������������������������������������������������������������� 640


Using rsync over SSH������������������������������������������������������������������������������������������������������������������������� 641

Backing Up with Duply������������������������������������������������������������������������������������������������� 652


Setting Up S3 Buckets������������������������������������������������������������������������������������������������������������������������ 652
AWS User Policies������������������������������������������������������������������������������������������������������������������������������� 656
Testing S3 Bucket Access������������������������������������������������������������������������������������������������������������������� 657
Installing and Configuring Duply��������������������������������������������������������������������������������������������������������� 659

Using Bareos���������������������������������������������������������������������������������������������������������������� 666


Getting the Software��������������������������������������������������������������������������������������������������������������������������� 667
Configuring the Database������������������������������������������������������������������������������������������������������������������� 668
Configuring Bareos����������������������������������������������������������������������������������������������������������������������������� 670
Managing Bareos with bconsole�������������������������������������������������������������������������������������������������������� 686
Using GlusterFS for Backup Storage�������������������������������������������������������������������������������������������������� 690
Backing Up Databases with Bareos Plug-Ins������������������������������������������������������������������������������������� 694
Introducing the Bareos Web-UI����������������������������������������������������������������������������������������������������������� 697

Summary���������������������������������������������������������������������������������������������������������������������� 700

■Chapter 15: Networking with VPNs������������������������������������������������������������������� 701
Our Example Network�������������������������������������������������������������������������������������������������� 701
Introducing OpenVPN��������������������������������������������������������������������������������������������������� 703
Installing OpenVPN����������������������������������������������������������������������������������������������������������������������������� 703
Starting and Stopping OpenVPN��������������������������������������������������������������������������������������������������������� 704
Configuring OpenVPN������������������������������������������������������������������������������������������������������������������������� 704
Exposing Head Office Resources with OpenVPN�������������������������������������������������������������������������������� 717
VPN Connections for Mobile Users����������������������������������������������������������������������������������������������������� 719

Troubleshooting OpenVPN�������������������������������������������������������������������������������������������� 730


Summary���������������������������������������������������������������������������������������������������������������������� 731

■Chapter 16: Directory Services�������������������������������������������������������������������������� 733
Overview���������������������������������������������������������������������������������������������������������������������� 734
What Is LDAP?�������������������������������������������������������������������������������������������������������������� 734
General Considerations������������������������������������������������������������������������������������������������ 737

xvii
■ Contents

Implementation������������������������������������������������������������������������������������������������������������ 738
Installation�������������������������������������������������������������������������������������������������������������������� 739
CentOS Installation Guide������������������������������������������������������������������������������������������������������������������� 740
Ubuntu Installation Guide������������������������������������������������������������������������������������������������������������������� 740

Configuration���������������������������������������������������������������������������������������������������������������� 740
Requirements������������������������������������������������������������������������������������������������������������������������������������� 741
Configuring SLAPD����������������������������������������������������������������������������������������������������������������������������� 742
Listing, Adding, and Creating a Schema��������������������������������������������������������������������������������������������� 749
Access Control Lists��������������������������������������������������������������������������������������������������������������������������� 754
Working with the slapd Daemon��������������������������������������������������������������������������������������������������������� 762
Setting Up Your LDAP Client���������������������������������������������������������������������������������������������������������������� 765

LDAP Management and Tools��������������������������������������������������������������������������������������� 765


LDIFs and Adding Users���������������������������������������������������������������������������������������������������������������������� 766
Adding Users from LDIF Files������������������������������������������������������������������������������������������������������������� 768
Searching Your LDAP Tree������������������������������������������������������������������������������������������������������������������� 772
Deleting Entries from Your LDAP Directory����������������������������������������������������������������������������������������� 773
Password Policy Overlay��������������������������������������������������������������������������������������������������������������������� 774
Testing Your Access Control Lists������������������������������������������������������������������������������������������������������� 775
Backing Up Your LDAP Directory��������������������������������������������������������������������������������������������������������� 777
LDAP Account Manager: Web-Based GUI�������������������������������������������������������������������������������������������� 779
Installation and Configuration������������������������������������������������������������������������������������������������������������� 779
Adding the Apache Virtual Host for LAM��������������������������������������������������������������������������������������������� 781

Integration with Other Services������������������������������������������������������������������������������������ 786


Single Sign-On: Centralized Linux Authentication������������������������������������������������������������������������������ 786
How PAM Works���������������������������������������������������������������������������������������������������������������������������������� 792
LDAP and Apache Authentication������������������������������������������������������������������������������������������������������� 794

Summary���������������������������������������������������������������������������������������������������������������������� 797

■Chapter 17: Performance Monitoring and Optimization������������������������������������ 799
Basic Health Checks����������������������������������������������������������������������������������������������������� 799
CPU Usage������������������������������������������������������������������������������������������������������������������������������������������ 799
Memory Usage������������������������������������������������������������������������������������������������������������������������������������ 800

xviii
■ Contents

Disk Space������������������������������������������������������������������������������������������������������������������������������������������ 801


Logs���������������������������������������������������������������������������������������������������������������������������������������������������� 802

Advanced Tools������������������������������������������������������������������������������������������������������������� 802


CPU and Memory Use������������������������������������������������������������������������������������������������������������������������� 802
Swap Space Use��������������������������������������������������������������������������������������������������������������������������������� 806
Disk Access���������������������������������������������������������������������������������������������������������������������������������������� 807
Deeper with dstat������������������������������������������������������������������������������������������������������������������������������� 808

Continuous Performance Monitoring���������������������������������������������������������������������������� 810


Collectd����������������������������������������������������������������������������������������������������������������������������������������������� 810
Graphite���������������������������������������������������������������������������������������������������������������������������������������������� 815
Grafana����������������������������������������������������������������������������������������������������������������������������������������������� 824

Performance Optimization�������������������������������������������������������������������������������������������� 831


Resource Limits���������������������������������������������������������������������������������������������������������������������������������� 831
sysctl and the proc File System���������������������������������������������������������������������������������������������������������� 833
Storage Devices���������������������������������������������������������������������������������������������������������������������������������� 834
File System Tweaks���������������������������������������������������������������������������������������������������������������������������� 835
I/O Schedulers������������������������������������������������������������������������������������������������������������������������������������ 836

Summary���������������������������������������������������������������������������������������������������������������������� 837

■Chapter 18: Logging and Monitoring����������������������������������������������������������������� 839
Logging������������������������������������������������������������������������������������������������������������������������ 839
journald���������������������������������������������������������������������������������������������������������������������������������������������� 839
rsyslogd���������������������������������������������������������������������������������������������������������������������������������������������� 846
Configuring rsyslog����������������������������������������������������������������������������������������������������������������������������� 847
Configuring RELP�������������������������������������������������������������������������������������������������������������������������������� 855
Starting and Stopping rsyslog������������������������������������������������������������������������������������������������������������ 857
Testing Logging with logger��������������������������������������������������������������������������������������������������������������� 857
Log Management and Rotation����������������������������������������������������������������������������������������������������������� 858
Log Analysis and Correlation���������������������������������������������������������������������������������������� 861
Introducing Beats and Logstash��������������������������������������������������������������������������������������������������������� 861
Elasticsearch for Log Stashing����������������������������������������������������������������������������������������������������������� 871

xix
■ Contents

Kibana Installation and Configuration������������������������������������������������������������������������������������������������� 873


Further Information���������������������������������������������������������������������������������������������������������������������������� 876

Monitoring�������������������������������������������������������������������������������������������������������������������� 876
Introducing Nagios-Core��������������������������������������������������������������������������������������������������������������������� 877
Installing Nagios��������������������������������������������������������������������������������������������������������������������������������� 879
Starting Nagios����������������������������������������������������������������������������������������������������������������������������������� 881
Nagios Configuration�������������������������������������������������������������������������������������������������������������������������� 881
Setting Up the Nagios Console����������������������������������������������������������������������������������������������������������� 901
Troubleshooting Nagios���������������������������������������������������������������������������������������������������������������������� 908

Summary���������������������������������������������������������������������������������������������������������������������� 909

■Chapter 19: Configuration Management������������������������������������������������������������ 911
Provisioning������������������������������������������������������������������������������������������������������������������ 912
Provisioning with CentOS Cobbler������������������������������������������������������������������������������������������������������ 912
MAAS�������������������������������������������������������������������������������������������������������������������������������������������������� 936

Configuration Management������������������������������������������������������������������������������������������ 936


Introducing Puppet����������������������������������������������������������������������������������������������������������������������������� 937
Installing Puppet��������������������������������������������������������������������������������������������������������������������������������� 939
Configuring Puppet����������������������������������������������������������������������������������������������������������������������������� 940
Writing the Manifest��������������������������������������������������������������������������������������������������������������������������� 941
Connecting Our First Client����������������������������������������������������������������������������������������������������������������� 944
Creating Our First Configuration��������������������������������������������������������������������������������������������������������� 946
Applying Our First Configuration��������������������������������������������������������������������������������������������������������� 949
Specifying Configuration for Multiple Hosts��������������������������������������������������������������������������������������� 950
Relating Resources����������������������������������������������������������������������������������������������������������������������������� 953
Using Templates��������������������������������������������������������������������������������������������������������������������������������� 955
More Puppet��������������������������������������������������������������������������������������������������������������������������������������� 956
Troubleshooting Puppet���������������������������������������������������������������������������������������������������������������������� 957
Introducing Ansible����������������������������������������������������������������������������������������������������������������������������� 957
Serverspec Testing����������������������������������������������������������������������������������������������������������������������������� 973
Summary���������������������������������������������������������������������������������������������������������������������� 980

Index��������������������������������������������������������������������������������������������������������������������� 983
xx
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
About the Authors

Dennis Matotek lives and works in Melbourne, Australia—possibly the


birthplace of great coffee and the home to several exemplary coffeehouses
and many, many average ones too.
He works as a senior development operations engineer at Envato,
an online digital marketplace where a community of creatives can help
bring ideas to life. There he helps a team of engineers deploy code, build
infrastructure, and monitor performance for varying systems, mostly
written in Rails. He usually works with AWS rather than bare metal and
appreciates not having to change failed disks.
With two young children, Ziggy and Anika, he happily lives with his
partner Bianca and a number of pets—one dog and six chickens.

James Turnbull is the CTO at Empatico, co-chair of O’Reilly’s Velocity conference, an advisor at AccessNow
and Docker Inc.
Previously CTO at Kickstarter, VP of Engineering at Venmo and was an early employee and executive at
Docker and Puppet Labs.
He is a contributor to a number of open source projects and regularly speaks on topics related
to writing, systems administration, and open source technologies. He is the author of several books:
https://terraformbook.com/, https://www.artofmonitoring.com/, https://www.dockerbook.com/,
https://www.logstashbook.com/, Pro Puppet (Apress, 2011), Pulling Strings with Puppet: Systems
Administration Made Easy (Apress, 2008), Hardening Linux (Apress, 2008), and Pro Nagios 2.0
(Apress, 2006).

Peter Lieverdink was born in a small Dutch country town. He owns a pair of clogs but has never eaten tulips
or lived in a windmill. On his 22nd birthday, Peter moved to Australia and briefly worked in an office cubicle.
He now runs his own business, Creative Contingencies Pty, Ltd. The business depends on open source
software for infrastructure and development as well as daily office tasks.
Peter specializes in web application development and helping other businesses implement open source
solutions using Linux on both desktops and servers.

xxi
About the Technical Reviewer

Sander van Vugt is a best-selling author and technical trainer, living in the
Netherlands. In his professional life, Sander focuses on enterprise Linux
distributions and has authored several books and video courses about
them. For more information, visit his web site, www.sandervanvugt.com.

xxiii
PART I

The Beginning
CHAPTER 1

Introducing Linux

By James Turnbull, Peter Lieverdink, and Dennis Matotek


You’ve decided to learn more about System Administration or run your business on free and open source
(FOSS) infrastructure? Congratulations and welcome to the world of Linux and open source software! This
chapter will take you through the first steps into implementing that infrastructure. We cover choosing a
platform or distribution, choosing appropriate and supported hardware, and finding the software you need.
We also provide you with the location of some resources to help you support your Linux environment. Then,
in Chapter 2, we’ll show you how to install your first Linux hosts.

Linux Distributions
What is a Linux distribution? Well, in simple terms it is a collection of applications, packages, management,
and features that run on top of the Linux kernel. The kernel is what all distributions have in common (it is
sometimes customized by the distribution maintainers), but at their core they all run Linux.

■■Note So what’s a kernel, you ask? Don’t panic, we’ll fill you in. The kernel is the core of all computer
operating systems and is usually the layer that allows the operating system to interact with the hardware in
your computer. The kernel contains software that allows you to make use of your hard disk drives, network
cards, RAM, and other hardware components. In the Linux world, the kernel is based on code originally
developed by the founder of Linux, Finnish developer Linus Torvalds. The kernel is now maintained by a
community of open source developers, and changes go through a software life-cycle process. Your distribution
will come with a version of that kernel, and like Windows or other operating systems it can be updated and
upgraded to provide new features or fix bugs.

The world of Linux distributions may at first seem a little confusing. You are probably thinking, “If they
are all ‘Linux,’ why are there so many different names, and which do I choose?” You may have heard names
like Red Hat, Fedora, Debian, and the more oddly titled Ubuntu (it’s a Zulu word that loosely translates as
“humanity toward others”!). In this section, we’ll explain what a distribution is, describe the ways in which
distributions differ, and suggest some strategies for selecting the right distribution for you.

© Dennis Matotek, James Turnbull and Peter Lieverdink 2017 3


D. Matotek et al., Pro Linux System Administration, DOI 10.1007/978-1-4842-2008-5_1
Chapter 1 ■ Introducing Linux

Distributions differ in several ways, and three of the most important are
• Purpose
• Configuration and packaging
• Support model
First, different distributions are often designed for different purposes and provide different user
experiences. Some distributions are designed as servers and others as desktops, and some are designed to
perform particular functions, for example, as embedded systems. The majority of Linux installations still
tend to be servers. While more Linux desktops are appearing, the numbers do not yet challenge Windows
and Apple OS X dominance of the desktop market.
The second major difference between distributions is in their configuration. While some distributions
keep all their configuration settings and files in the same locations, others vary their locations. Additionally,
the process of installing and updating applications (which are usually installed by a package) is not
consistent across distributions. Many distributions use different application installation and management
tools (generally called package management tools). This can be confusing and can make administration
difficult if you have an environment with differing distributions. In Chapter 19, we’ll look closely at
configuration management tools and how to overcome these sorts of issues.
The third difference is that distributions also have differing support models. Some, like Debian, CentOS,
and Fedora, are maintained by a community of volunteers. Others, like Red Hat Enterprise Linux and
Ubuntu, are maintained and supported by a commercial vendor. The software is still open source, but you
can pay for support and maintenance. Most commercial Linux vendors support themselves through the sale
of maintenance and support services.
Let’s look at some of the available choices; this won’t be a comprehensive list, but we’ll cover most of
the major popular distributions and then present some reasons for selecting particular platforms. We’ll
also group together some of the like distributions, particularly focusing on distributions derived from two
major distributions: CentOS (derived from the Red Hat distribution) and Ubuntu (itself a derivation from the
Debian distribution).

■■Note So how can one distribution be “derived” from another distribution? Well, open source software
means that the source code is available to developers. Developers can pick and choose the features they
want in a distribution and potentially create their own distribution. Many of the major distributions appeared
because a developer or group of developers decided to create their own version of another distribution. These
new derivations often have their own branding and features. Some remain close to the parent distribution, and
others follow their own path.

Red Hat Enterprise Linux


Red Hat Enterprise Linux (www.redhat.com/rhel/) is a popular commercially supported Linux platform.
It comes in a number of versions, the two most common being Red Hat Enterprise Linux (also known as
RHEL) and Red Hat Enterprise Linux Advanced Platform (RHELAP). The major difference between the
versions is the number of CPUs (central processing units) supported, with RHEL supporting up to two CPUs
and RHELAP supporting an unlimited number.
Red Hat platforms are commonly used by corporate organizations as server platforms due to the
dedicated support and service levels available from the vendor. Red Hat, and most distributions based on it,
make use of the Red Hat Package Management (RPM) packaging system.

4
Random documents with unrelated
content Scribd suggests to you:
picture in Rome, to give concerts there and elsewhere in Europe,
taking his family along. In Rome he rented the fabulous Villa
Badaglio, where crystal chandeliers gleamed on statuary and marble
floors and old masters decorated the walls.
In London he failed to appear at the Albert Hall concert that had
been arranged for him; same thing in Hamburg, where crowds
jeered his name. He died in Rome, aged thirty-eight, suffering from
phlebitis and a blood clot in a coronary artery. His enormous bulk
created some macabre problems for the undertakers. Not long after,
when Betty Lanza had brought her children back to Beverly Hills, her
mother tried to get her committed for psychiatric care. Betty would
listen to no one, any more than she’d listened when Mario’s sanity
was at stake. There were five more months left before drugs took
Betty’s life. Love for the man she’d lost? Desperation? The verdict
simply said: cause unknown.
All of us, within ourselves, carry the seed of our own
destruction. But in some there is an inner core beyond our powers to
destroy. Jack Barrymore was one of these. I watched him try to pull
himself down. He was a man embittered, disillusioned, broken in
health and finances, burlesquing his own genius with a devil’s grin.
He saw the same public that idolized him in The Jest, Richard III,
Hamlet shriek with sadistic laughter over his antics on and off the
camera.
During a lull on the set one afternoon, some jokester said to
him: “Come on, Jack, give us one of your old tear jerkers.” He
agreed, with a shrug; started hamming Mark Antony’s lines from
Julius Caesar. “Friends, Romans, countrymen.... My heart is in the
coffin there with Caesar, and I must pause till it comes back to me.”
After the first few lines something had happened. As the voice
steadied and deepened the set grew quiet. Grips, carpenters,
electricians, extras approached, soft-footed. When Mark Antony
finished, Hamlet took his place. The years fell away and there, on
the cluttered sound stage, stood the young Hamlet, the greatest any
theater ever knew.
In complete silence Barrymore walked to his dressing room.
Then such a storm of applause broke out that the whole stage shook
with it. More faces than one were streaked with tears. We knew we
had seen an indestructible human spirit fighting its way clear of the
dross of a reckless and ill-spent life.
Nineteen
We used to go riding in the moonlight, raising the dust down roads
shadowed by palm trees, walking the horses through citrus groves and
fields of barley, up into the trackless red hills, where we’d turn to catch
a glimpse of the Pacific gleaming like pewter under the night sky. Now
cowboys have to learn how to climb into a saddle before they can
gallop away into the sunset for another TV horse opera. There are
none of the genuine, Bill Hart variety left.
When I first saw Hollywood, Sam Goldwyn was still Goldfish, and a
grain store stood on Sunset Boulevard at the corner of Cahuenga. Cecil
B. De Mille, looking for some place to produce The Squaw Man, had
rented a livery stable at Selma and Vine, founding the motion-picture
capital, the wonderland that clothed dreams in flesh for millions of the
world’s inhabitants. Bill Farnum reigned in splendor in a suite at the
Hollywood Hotel; I made my movie debut with him, played his leading
lady for $100 a week, which was a fortune to me then.
Life was simple, exciting, and, most of all, fun. We worked hard
and loved it. People were neighborly, kind, and didn’t know the
meaning of class distinction—that came later when the big money
rolled in and changed everything. We used to borrow sugar, bake cakes
for the folks next door, stop by each other’s houses to gossip about the
wonders of this bouncing new baby, the movie business, and the
climate, and the everlasting sunshine. Where is it now? Hidden by fog
and smog.
Now the dirty-post-card boys have moved in, churning out pictures
reeking of violence, prostitution, perversion, and decay. Anybody can
produce a movie—it takes no great talent. Everybody can try to make a
quick killing in hard times and the devil with the consequences. Of
course, we always knew there were such things as sewers, but never
before have audiences had their noses pushed over so many gratings.
A different odor used to hang over our town—the smell of fresh
money. It poured from the four corners of the earth like the tide
coming in. That’s the scent that drew the founders of our industry, a
bunch of shrewd dishwashers, nickelodeon proprietors, glove salesmen,
dress manufacturers, junk dealers. They knew a good thing when they
saw it, and who should worry about tomorrow?
They were freebooters at heart, most of them, set on carving out
empires and ruling them like despots. They started by despoiling the
land when they lopped down the trees to make room for the shabby
warehouses and barns we call studios. My office desk is placed
nowadays so that I can turn my back on Hollywood. If I faced the
window, the sun would be in my eyes, and I like the sun on my back.
They despoiled the actors and actresses, too, whose names
became better known than those of presidents and kings. Money
ruined many of the stars, washed over them in a deluge, then left them
high and dry when their few working years were over. Lionel
Barrymore, for instance, earned a gigantic reputation as director and
star, with enough talent left over to make him more than competent in
other arts—a water color and two etchings hang in my den, and he was
a fine composer, too. But he left very little property behind, and that
was seized by federal agents a few hours after his funeral, to be
auctioned to pay his income tax.
He lies beside his wife, Irene Fenwick; Jack Barrymore was buried
on her other side by Lionel’s order. Years before, Jack had been in love
with her, but his big brother broke up the romance and later tried to
commit suicide. Then Lionel fell in love with her, and to marry her, he
left his wife and two sons, both of whom died in their early teens. Few
people knew he had children.
Studio heads dangled the carrots at contract-signing time and
cracked the whip once the ink on the paper was dry. Not so long ago
David Selznick was reminiscing about those tightly disciplined days with
me: “I’ve called Jack Barrymore into my office for not knowing his
lines; he was contrite and apologetic. I had to speak to Leslie Howard,
who was embarrassing Vivien Leigh by not being prepared for the
scene. But you never had to speak a second time. They recognized
their fault and corrected it.”
Garbo was never late. She appeared on the set at 9 a.m. sharp,
made up and ready to work and no nonsense. But she was patience
itself if an older member of the company had trouble remembering
lines. She was considered demanding when she wanted to know who
would produce, who co-star, who direct. Once she turned down a story
Metro wanted her to make, David remembered, “and they cast her
opposite Tim McCoy in a Western as punishment. When Lionel
Barrymore heard it he said: ‘That’s like cutting Tolstoy’s beard so he
wouldn’t write any revolutionary novels.’”
Now we have Elizabeth Taylor picking up more than $2,000,000 for
Cleopatra, jeopardizing the whole future of Twentieth Century-Fox by
her behavior, and getting herself proposed for a seat on the board of
directors by a disgruntled stockholder. We have Mr. Brando collecting
more than a million from Mutiny on the Bounty, plus overtime for every
day’s delay his antics caused. Selznick calls such ventures “movies of
desperation.”
“The men who make movies have been digging their own graves,”
he says. “They’ll put up with anything for a transient advantage. They
have no long-term concern because they’re busy getting dollars for the
next statement, watching the effect that statement will have on the
company’s stock.” I second that.
What went wrong with Hollywood? Well, something like this....
The founding fathers didn’t know what competition was. They had
it all their own, undisputed way so long. They hit on something, motion
pictures, that the world took to like babies take to candy. The handful
of families that ran the big studios made a cozy little clique by
intermarriage, bringing in their relatives, sticking together like mustard
plasters.
The same men owned the studios, the distributing companies, and
many of the biggest movie theaters. Right down the line, they
controlled what audiences saw and how much they paid to see it. An
independent theater owner in any town at home or abroad either was
deprived of the pictures he wanted or else had to accept block booking.
To lay hold of, say, a sure-fire Humphrey Bogart picture from Warners,
he had to take three others that he’d have to take a chance on.
But a picture had to be a real turkey not to pay its way, at least. If
people wanted an evening out, in most cases, they had no place to go
except the movies. There’s never been a monopoly that brought such
sweet rewards to the men who ran it. Radio proved to be no kind of
competition. If I paid them enough—and some big stars demanded
$5000 to stand up and read a script—I could get virtually anybody I
wanted, including Dore Schary, on my weekly show when I crashed
into broadcasting. A loud-speaker was no substitute for the screen,
where a kind of earthy paradise was on view. Illusion had to be put into
pictures, not just into words.
The film factories were organized like an automobile assembly line.
They had to be. The demand for movies was insatiable. Our town
turned out four, five hundred pictures a year, with close to a thousand
actors and actresses under contract. Every year the bosses prepared
lavish promotion programs to light a gleam in the exhibitors’ eyes,
listing the four colossal musicals, the half dozen scintillating comedies,
the seven searing dramas, and so forth which the particular studio
would deliver in the months ahead. Many times these promises were
pure blue sky. They’d invent a title, pencil in the stars, then a team of
contract writers would knock out a story. Today no production head can
promise what next year will bring because the system’s out of his
control and he just doesn’t know about tomorrow.
On top of the heap sat the Mayers, Schencks, Warners, Goldwyn,
most of them ruling like pharaohs, unapproachable by underlings
except by invitation. At the next level down, among the producers and
directors, came the real pros who kept the wheels aturning. A man like
Byrnie Foy, the “Keeper of the B’s” at Warners, could look at a script for
a Western, rip out a page after a single glance, and order: “Don’t have
them cross a bridge, or you’ll have to build it. Have them cross a gulch
and save $20,000.”
That’s a far cry from Something’s Got to Give, where Fox watched
$2,000,000 disappear down the gutter and all they got for it was some
footage of Marilyn Monroe slipping into a swimming pool naked. Most
of the old-time professional producers are dead. Our town needs the
likes of them the way a burning house needs firemen.
We had directors whom actors and actresses gave their eyeteeth to
work for; it was the cracker-jack directors who made the stars.
Beginners in grease paint slogged their way up through bit parts in “B”
pictures until they’d picked up enough experience for bigger things and
better contracts. Sometimes the lightning would strike an actor like Bob
Mitchum, glimpsed by Bill Wellman as he strode down Hollywood
Boulevard. Bill had G.I. Joe to make, didn’t fancy Gary Cooper for it
because he needed a man with a look of sweat on his skin and the
devil inside him. Bill tapped Bob Mitchum for stardom on the spot. Bob,
after more than his share of headlines, ranks now as one of our more
solid citizens.
Like a ride on a roller coaster, Hollywood reached peak prosperity
just before the final dive began. World War II brought in profits that
overflowed the tills and burst the bank vaults. It also brought on the
first of the catastrophic decisions that wrecked the industry.
A soldier with a precious pass or an off-duty hour to spare, a war
worker on the swing shift—the whole world flocked to the movies to
escape reality for a few moments. You couldn’t produce a picture, any
picture, without it turning a handsome profit. So we promptly made the
worst claptrap and flung it on the screens.
By way of gratitude toward the men who fought the war, our town
let them wander by the thousands around the streets when they drifted
in on leave, craning their necks to see a famous face or ready to settle
for a pretty one. Aside from limited efforts like the much-publicized
Hollywood Canteen, our hospitality was mostly private. Many towns put
cots down for GI’s to sleep on in town halls and firehouses if they were
caught without accommodations for the night. Not us. I campaigned for
vacant sound stages to be converted into temporary quarters for our
visitors in uniform. For all I achieved, I was talking to myself.
The catastrophe that the studios invited was the death of glamour,
which had filled the air we breathed. The stars were asked to stop
wearing the golden glow of gods and goddesses and look like plain
folks, as homey as apple pie and lawn mowers. You couldn’t pick up a
magazine without coming across publicity shots of Betty Grable out
marketing, Bette Davis washing dishes, or Alice Faye changing diapers.
Nobody had ever seen a picture of Dietrich hanging out wet wash or
Jack Barrymore in a life-with-father layout. We were busy bringing stars
down out of the sky, lousing up the act, cutting our own throats.
Realism strangled the dream stuff, and it’s slowly slaughtering
Hollywood. I see very little hope unless glamour is given its rightful
place again. I believe that audiences wanted it then and want it now.
More and more people share that point of view. Jerry Lewis is one of
them.
“It wasn’t good to take the soft lights off the tinsel,” said Jerry.
“The days of the stars must return. There’s been too much haphazard
mingling with the public by the stars. It killed a beautiful illusion, the
illusion that helped make Hollywood and picture stars important to the
public.”
When the GI’s came back from the war, the lean years set in for
our industry. They’d seen strange sights and found new dreams. They
were a restless generation, looking for fresh excitements. They turned
to bowling alleys, night baseball, the race tracks. Suddenly there were
a whole lot of other things to do besides going to the movies. The
money that went for new pastimes used to go into movie-house tills.
They reacted by bumping up admission prices. It didn’t help.
Instead of a couple being able to see a double feature, cartoons, and a
newsreel at thirty-five cents a head, for a first-run picture the tab
leaped up to $1.50 and more apiece. Coincidentally, another great
American invention had come along in the postwar years, the baby
sitter.
Only a handful of households could afford living-in servants after
the maids and cooks and butlers had enjoyed a taste of wartime wages
on factory assembly lines. It was no longer the thing to do to ask a
neighbor to mind the baby while Dad took Mother to the movies. They
had to hire a baby sitter at accelerating hourly rates. If Dad stood
Mother dinner out somewhere first, a couple of hours watching Luise
Rainer knocked the family budget for ten or fifteen dollars. It just
wasn’t worth that much. The tide on the sea of gold was ebbing fast.
Then the government started huffing and puffing, and the big
empires were gone with the wind. What happened was that the
independent theater owners, who’d been pushed around for years,
finally nudged the Justice Department into declaring that it was illegal
under the anti-trust laws for the same organization to make movies,
distribute them, and screen them in its own picture palaces.
This was like the Ford Motor Company waking up one morning to
find it had lost all its showrooms. Or Fanny Farmer discovering she
could cook up her candy but not run the stores she sold it in. The
movie makers, who had never smelled real competition up to date,
suddenly realized they were in a tougher grind than the cloak-and-suit
business ever was.
There was a moment when they could have had another gilt-edged
guarantee of money by the billions if they’d had the sense to see it.
The early runners of the television industry came on their knees to
Hollywood and begged the movie men to help them. “You’ve got the
factories to make the product, we’ll get the outlets to show it,” they
said. “Let’s co-operate, and we’ll all grow rich.”
Oh, but the studio heads were too smart for that! They could have
held television in the palms of their hands. Instead they jeered: “Who’s
going to stay home and watch a little box?” They sneered: “What have
you got—women wrestlers and bike races? It’s a fad like Yo-yo. It can’t
last. Movies are better than ever.”
Only Paramount sensed the potential in the little boxes when there
were no more than half a million of them, with post-card-sized screens,
in the country. That studio joined hands with Dr. Allen Du Mont, the
pioneer TV scientist, hoping to build a network of Channel Fives. But he
was an inventor, not an executive who could put together the
necessary hours of daily programming. The idea failed, the network
amounted to nothing, and all that Y. Frank Freeman, head of
Paramount, could do was watch NBC and CBS forge ahead, while he
speculated on what might have been.
The bankers moved deeper and deeper into the faltering movie
industry. They had to. They were the people with money to keep it
going. They didn’t know a thing about it, but they knew a star when
they saw one. To a banker, a star looked like the safest bet in a
business beset with more hazards than a steeplechase. The studios
found out you could always raise the financing if you showed Mr.
Moneybags a big enough star and a script the star liked. Independent
producers learned the same lesson and flocked around, waving
contracts. Directors, cameramen, every other key employee necessary
to make good movies—the banks didn’t want to hear about them.
The ever-loving agents grabbed hold hard. If the industry lived or
died on names like Gable, Brando, Hepburn, and Taylor, then, by crikey,
their clients were going to grab the steering wheel from the
professional producers and studio heads. The only way the stars could
be guaranteed enough money to tempt them to work was to give them
a slice of the picture’s potential profits on top of salary. The slice grew
bigger and bigger and bigger.
In the old days we used to wait impatiently for the studio gates to
open at 9 a.m. I couldn’t get there soon enough. Nowhere else did you
have such fun. You had companions of your own kind to work with,
many of them the finest talents in the worlds of the theater, concert
platform, fashion salon. On Saturdays and Sundays we’d hurry back to
the studios to hear the orchestras record sound tracks with stars of the
musicals, or maybe listen to four hundred Negroes sing spirituals for a
Lawrence Tibbett picture.
When George Cukor was preparing The Women, I was so eager to
play in it that I called him on the quiet after Dema Harshbarger had set
a price on my head of $1000 minimum, whether for a day’s work or a
week’s. “Confidentially, I’d work for nothing,” I told him. A contract was
drawn at a cut-down figure and sent to Dema.
She asked me into her office, next to mine. “I’d like to give you a
farewell luncheon at some smart place,” she said, her dark eyes
gleaming bright. “We won’t have any unpleasantness, and we’ll stay
friends, but I don’t want any business dealings with you unless you let
me set a value on you.” I got the point—and a revised contract.
At least two once-powerful studios, Fox and MGM, were driven into
a corner from which they may never emerge, thanks to the present,
overpriced star system. Rome and Madrid today are the temporary
movie capitals of the world. Tokyo, London, Paris—all compete for the
title. Soaring costs at home push more and more production overseas.
The peccadilloes of foot-loose stars and producers who hanker for far-
off places favor foreign production. Some countries freeze profits from
the screening of American movies, so the money must be used to stake
new pictures inside those countries’ frontiers. Then, too, the big screen
demands the real locations; you can no longer paint a mountain on a
piece of glass and make it look like the Rockies.
So pictures like Lawrence of Arabia and Ben-Hur are made
anywhere except in Hollywood. William Holden won’t come home from
Switzerland for reasons of taxes—and his pictures get picketed by our
town’s movie unions. Even Tom and Jerry are refugees now. They were
made at Culver City before the animation studios were shut five years
ago. Now Tom and Jerry are drawn in Italy, Popeye is a Yugoslav
sometimes, and Bullwinkle comes to life on drawing boards in Mexico.
Walt Disney remains one of the all-Americans.
MGM prayed it would be helped out of its Mutiny hole by the oil
well that started to flow on the back lot at Culver City at about the time
that Brando was stumbling through the final scenes of the picture in
Hollywood.
Twentieth Century-Fox went in for sterner stuff, very late in the
day. They tried to hurry Cleopatra production to a conclusion by cutting
off the salary in Rome of Walter Wanger. They fired Marilyn Monroe and
sued her for $500,000 for absenteeism from the set of Something’s Got
to Give after she had given five days of performance in seven weeks of
shooting.
The Fox counterrevolution against stars found her colleague, Dean
Martin, in the line of fire next. He’d promptly announced after Marilyn
was dismissed that so far as he was concerned it was Monroe or
nobody. He walked out; the picture was shut down. Equally promptly
the studio threw a record-breaking suit for $5,678,000 at his head,
claiming breach of contract, and Dean’s attorneys filed countercharges.
He was no hero to the unions, though they sat back and did
nothing. An official said to me: “He’s putting people out of work at a
time when we’re all faced with unemployment due to runaway
production. He’s certainly demonstrating his unconcern for his co-
workers.”
When a star got out of line, the crew used to have a peculiar way
of handling the situation. Jack Barrymore would be performing his
heart out when out of the blue a crystal chandelier came crashing
down, missing his head by inches. If his behavior didn’t improve, the
next one fell even closer.
If the handful of stars still left to us disappears, who will replace
them? Who’s in sight to give Hollywood the color and excitement that it
needs to live? Where are the newcomers to be discovered and how can
they be trained? The answers, so far as the eye can see, are Nobody
and Nowhere. Opera has been stirred by new names in the past decade
—Joan Sutherland, Birgit Nilsson, Maria Callas. The concert stage has
its Van Cliburns. Politics has its Kennedys and Nixons. The movies have
virtually nothing at the top except the same names that were shining in
lights ten years ago—Bob Hope, Burt Lancaster, Cary Grant, John
Wayne, Jimmy Stewart and the rest politely called “middle-aged.”
Television’s no better off. The surge of talent there was mostly in
writers and directors—Rod Serling, Delbert Mann, and others—who
subsequently migrated to Hollywood. But the surge is about over. The
TV networks pretend to foster young talents. But do they?
They got going on their own account when Hollywood turned them
down as partners, then was compelled to sell its old movies to them to
raise cash to keep the studios open. The young, untried talents who
came out of the war swarmed like flies into TV. They couldn’t find a
place in the movie industry or in the Broadway theater. Early television
was like early movie making all over again, a great adventure filled with
fun but not much money; a wonderful place for experiment and
experience, because everybody could afford to make mistakes.
The networks needed that mysterious thing called programming,
meaning a dependable timetable of big hits and steady features,
spectaculars blended with Lassie. Without programming, they couldn’t
get TV sets sold, and a network like NBC, owned by RCA, was primarily
in business not to entertain its audiences but to sell sets.
NBC programming was in the hands of Pat Weaver, a farsighted
pioneer at his business with a special, rare ability to spend other
people’s money without being frightened by the cost. Before he
departed network headquarters in Rockefeller Center, he had brought
in “Wide, Wide World,” Groucho Marx, Milton Berle, Sid Caesar.
CBS had an executive, too, in Hubbell Robinson, who also ran a
good store. ABC had its problems as the little brother fighting to break
into a situation where its rivals divided most of the country between
themselves. But along came men like Bob Kintner, Oliver Treyze, Tom
Moore, and Dan Melnick. They took a backward look at what Warner
Brothers had done when they had to crack open a similar situation in
the movies and the big studios closed ranks against them.
Jack and Harry Warner, with stars like Bogart and Cagney on the
payroll, broke in with action pictures, with gang bullets flying and fists
swinging in every reel. ABC copied a leaf from that book. Never had
such a volley of blank bullets resounded over the land before. Critics
threw up their hands in horror, but ABC arrived with a bang and stayed
there.
It’s a tragedy of the entertainment industry that the networks were
as blind to the future needs of their business as the movie makers had
been to theirs. Like Pharaoh, the television tycoons let the people go;
the big talents left when the money wasn’t put up to keep them
together. The tycoons thought they made television, not the writers,
directors, and producers. They wouldn’t dream of setting up a studio
system, a great pool of brains that could have made NBC or CBS or
ABC the biggest creator there ever was of entertainment and the lively
arts. They put no funds aside for research, as General Motors,
Westinghouse, Du Pont and the others do.
Now TV by and large has become a dime-store business so far as
creativity and talent are concerned. The half-hour and sixty-minute
series rattle off the production lines like cans of beans, with an
occasional dab of ham inside. If the finished film doesn’t make sense,
no matter. If the kid with the six-shooter can’t act to save his mother’s
life, who cares?
The idea is that if enough people are watching, some of the
advertisers’ message will rub off on them to make the series worth
while. But if enough people stop watching the stuff that’s put on their
screens, then commercial television faces a similar fate to the movies,
in spite of color sets or tomorrow’s gimmicks such as giant screens to
hang on your living-room wall.
I believe the only possible solution for television and movies alike is
a recognition of the eternal values of real talent, excitement, and
glamour. Audiences are starved for all three. Entertainment must be a
satisfying emotional experience, a stirring of the heart. We need all
kinds of young men and women. Those people with an artist’s eye and
an executive’s brain that we term directors. Those wrestlers with their
souls and typewriters known as authors. The beggars on horseback
called actors and actresses.

* * * * *
Hollywood is my home, and most of my friends live there. I like to
travel sometimes, but I find scenery as a diet doesn’t nourish me. So I
intend to stick around and watch what happens, remembering a few
more words from the plaque that stands on my desk:

I do the very best I know how—the very best I can; and I


mean to keep doing so until the end. If the end brings me out
all right, what is said against me won’t amount to anything. If
the end brings me out wrong, ten angels swearing I was right
would make no difference.
Transcriber’s Notes
Punctuation, hyphenation, and spelling were made
consistent when a predominant preference was found in
the original book; otherwise they were not changed.
Obvious typographical errors were corrected;
unbalanced quotation marks were remedied when the
change was obvious, and otherwise left unbalanced.
All of the photographs are in one section, as they
were in the original book. Originally, the section followed
the first page of Chapter Ten, but to avoid disrupting the
flow of reading, in this eBook, that section has been
moved to precede Chapter Ten.
In the original book, there usually were 2-4
photographs per page, with descriptions for all of them
in the middle of the page. Here, the photographs are
separate and contiguous with their descriptions.
References such as left/right/above/below have been
removed from those descriptions, as they are not needed
here.
*** END OF THE PROJECT GUTENBERG EBOOK THE WHOLE TRUTH
AND NOTHING BUT ***

Updated editions will replace the previous one—the old editions will
be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States copyright in
these works, so the Foundation (and you!) can copy and distribute it
in the United States without permission and without paying
copyright royalties. Special rules, set forth in the General Terms of
Use part of this license, apply to copying and distributing Project
Gutenberg™ electronic works to protect the PROJECT GUTENBERG™
concept and trademark. Project Gutenberg is a registered trademark,
and may not be used if you charge for an eBook, except by following
the terms of the trademark license, including paying royalties for use
of the Project Gutenberg trademark. If you do not charge anything
for copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such as
creation of derivative works, reports, performances and research.
Project Gutenberg eBooks may be modified and printed and given
away—you may do practically ANYTHING in the United States with
eBooks not protected by U.S. copyright law. Redistribution is subject
to the trademark license, especially commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the free


distribution of electronic works, by using or distributing this work (or
any other work associated in any way with the phrase “Project
Gutenberg”), you agree to comply with all the terms of the Full
Project Gutenberg™ License available with this file or online at
www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand, agree
to and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or
destroy all copies of Project Gutenberg™ electronic works in your
possession. If you paid a fee for obtaining a copy of or access to a
Project Gutenberg™ electronic work and you do not agree to be
bound by the terms of this agreement, you may obtain a refund
from the person or entity to whom you paid the fee as set forth in
paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only be


used on or associated in any way with an electronic work by people
who agree to be bound by the terms of this agreement. There are a
few things that you can do with most Project Gutenberg™ electronic
works even without complying with the full terms of this agreement.
See paragraph 1.C below. There are a lot of things you can do with
Project Gutenberg™ electronic works if you follow the terms of this
agreement and help preserve free future access to Project
Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law
in the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name associated
with the work. You can easily comply with the terms of this
agreement by keeping this work in the same format with its attached
full Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.

1.E. Unless you have removed all references to Project Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project Gutenberg” appears,
or with which the phrase “Project Gutenberg” is associated) is
accessed, displayed, performed, viewed, copied or distributed:
This eBook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this eBook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is derived


from texts not protected by U.S. copyright law (does not contain a
notice indicating that it is posted with permission of the copyright
holder), the work can be copied and distributed to anyone in the
United States without paying any fees or charges. If you are
redistributing or providing access to a work with the phrase “Project
Gutenberg” associated with or appearing on the work, you must
comply either with the requirements of paragraphs 1.E.1 through
1.E.7 or obtain permission for the use of the work and the Project
Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is posted


with the permission of the copyright holder, your use and distribution
must comply with both paragraphs 1.E.1 through 1.E.7 and any
additional terms imposed by the copyright holder. Additional terms
will be linked to the Project Gutenberg™ License for all works posted
with the permission of the copyright holder found at the beginning
of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files containing a
part of this work or any other work associated with Project
Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute this


electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the Project
Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™ works
unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or providing


access to or distributing Project Gutenberg™ electronic works
provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™


electronic work or group of works on different terms than are set
forth in this agreement, you must obtain permission in writing from
the Project Gutenberg Literary Archive Foundation, the manager of
the Project Gutenberg™ trademark. Contact the Foundation as set
forth in Section 3 below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on, transcribe
and proofread works not protected by U.S. copyright law in creating
the Project Gutenberg™ collection. Despite these efforts, Project
Gutenberg™ electronic works, and the medium on which they may
be stored, may contain “Defects,” such as, but not limited to,
incomplete, inaccurate or corrupt data, transcription errors, a
copyright or other intellectual property infringement, a defective or
damaged disk or other medium, a computer virus, or computer
codes that damage or cannot be read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for


the “Right of Replacement or Refund” described in paragraph 1.F.3,
the Project Gutenberg Literary Archive Foundation, the owner of the
Project Gutenberg™ trademark, and any other party distributing a
Project Gutenberg™ electronic work under this agreement, disclaim
all liability to you for damages, costs and expenses, including legal
fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR
NEGLIGENCE, STRICT LIABILITY, BREACH OF WARRANTY OR
BREACH OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH
1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK
OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL
NOT BE LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT,
CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF
YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of receiving
it, you can receive a refund of the money (if any) you paid for it by
sending a written explanation to the person you received the work
from. If you received the work on a physical medium, you must
return the medium with your written explanation. The person or
entity that provided you with the defective work may elect to provide
a replacement copy in lieu of a refund. If you received the work
electronically, the person or entity providing it to you may choose to
give you a second opportunity to receive the work electronically in
lieu of a refund. If the second copy is also defective, you may
demand a refund in writing without further opportunities to fix the
problem.

1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of damages.
If any disclaimer or limitation set forth in this agreement violates the
law of the state applicable to this agreement, the agreement shall be
interpreted to make the maximum disclaimer or limitation permitted
by the applicable state law. The invalidity or unenforceability of any
provision of this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation,


the trademark owner, any agent or employee of the Foundation,
anyone providing copies of Project Gutenberg™ electronic works in
accordance with this agreement, and any volunteers associated with
the production, promotion and distribution of Project Gutenberg™
electronic works, harmless from all liability, costs and expenses,
including legal fees, that arise directly or indirectly from any of the
following which you do or cause to occur: (a) distribution of this or
any Project Gutenberg™ work, (b) alteration, modification, or
additions or deletions to any Project Gutenberg™ work, and (c) any
Defect you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new computers.
It exists because of the efforts of hundreds of volunteers and
donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project Gutenberg™’s
goals and ensuring that the Project Gutenberg™ collection will
remain freely available for generations to come. In 2001, the Project
Gutenberg Literary Archive Foundation was created to provide a
secure and permanent future for Project Gutenberg™ and future
generations. To learn more about the Project Gutenberg Literary
Archive Foundation and how your efforts and donations can help,
see Sections 3 and 4 and the Foundation information page at
www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-profit
501(c)(3) educational corporation organized under the laws of the
state of Mississippi and granted tax exempt status by the Internal
Revenue Service. The Foundation’s EIN or federal tax identification
number is 64-6221541. Contributions to the Project Gutenberg
Literary Archive Foundation are tax deductible to the full extent
permitted by U.S. federal laws and your state’s laws.

The Foundation’s business office is located at 809 North 1500 West,


Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up
to date contact information can be found at the Foundation’s website
and official page at www.gutenberg.org/contact

Section 4. Information about Donations to


the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission of
increasing the number of public domain and licensed works that can
be freely distributed in machine-readable form accessible by the
widest array of equipment including outdated equipment. Many
small donations ($1 to $5,000) are particularly important to
maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws regulating


charities and charitable donations in all 50 states of the United
States. Compliance requirements are not uniform and it takes a
considerable effort, much paperwork and many fees to meet and
keep up with these requirements. We do not solicit donations in
locations where we have not received written confirmation of
compliance. To SEND DONATIONS or determine the status of
compliance for any particular state visit www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states where


we have not met the solicitation requirements, we know of no
prohibition against accepting unsolicited donations from donors in
such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot make


any statements concerning tax treatment of donations received from
outside the United States. U.S. laws alone swamp our small staff.

Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could be
freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose network of
volunteer support.
Project Gutenberg™ eBooks are often created from several printed
editions, all of which are confirmed as not protected by copyright in
the U.S. unless a copyright notice is included. Thus, we do not
necessarily keep eBooks in compliance with any particular paper
edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how
to subscribe to our email newsletter to hear about new eBooks.

You might also like