Pro linux system administration Learn to build systems for your business using free and open source software Lieverdink download
Pro linux system administration Learn to build systems for your business using free and open source software Lieverdink download
https://textbookfull.com/product/pro-linux-system-administration-
learn-to-build-systems-for-your-business-using-free-and-open-
source-software-lieverdink-2/
https://textbookfull.com/product/pro-linux-system-administration-
learn-to-build-systems-for-your-business-using-free-and-open-
source-software-lieverdink-2/
https://textbookfull.com/product/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-nathan-haines/
https://textbookfull.com/product/beginning-ubuntu-for-windows-
and-mac-users-start-your-journey-into-free-and-open-source-
software-second-edition-haines/
Pro HTML5 Games. Learn to build your own Games using
HTML5 and JavaScript Aditya Ravi Shankar
https://textbookfull.com/product/pro-html5-games-learn-to-build-
your-own-games-using-html5-and-javascript-aditya-ravi-shankar/
https://textbookfull.com/product/incorporating-the-digital-
commons-corporate-involvement-in-free-and-open-source-software-
benjamin-j-birkinbine/
https://textbookfull.com/product/forge-your-future-with-open-
source-build-your-skills-build-your-network-build-the-future-of-
technology-1st-edition-vm-vicky-brasseur/
https://textbookfull.com/product/how-open-source-ate-software-
understand-the-open-source-movement-and-so-much-more-gordon-haff/
https://textbookfull.com/product/how-open-source-ate-software-
understand-the-open-source-movement-and-so-much-more-gordon-
haff-2/
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
[email protected], 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 [email protected], 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
■
■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
■
■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
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
viii
■ Contents
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
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
Summary���������������������������������������������������������������������������������������������������������������������� 216
x
■ 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
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
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
RAID������������������������������������������������������������������������������������������������������������������������������ 386
Types of RAID�������������������������������������������������������������������������������������������������������������������������������������� 386
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
xiii
■ Contents
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
xiv
■ Contents
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
Summary���������������������������������������������������������������������������������������������������������������������� 634
■
■Chapter 14: Backup and Recovery�������������������������������������������������������������������� 635
Disaster Recover Planning������������������������������������������������������������������������������������������� 635
Backup Process������������������������������������������������������������������������������������������������������������ 637
Things to Think About������������������������������������������������������������������������������������������������������������������������� 638
xvi
■ Contents
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
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
Summary���������������������������������������������������������������������������������������������������������������������� 797
■
■Chapter 17: Performance Monitoring and Optimization������������������������������������ 799
Basic Health Checks����������������������������������������������������������������������������������������������������� 799
CPU Usage������������������������������������������������������������������������������������������������������������������������������������������ 799
Memory Usage������������������������������������������������������������������������������������������������������������������������������������ 800
xviii
■ Contents
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
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
Index��������������������������������������������������������������������������������������������������������������������� 983
xx
About the Authors
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
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.
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.
4
Chapter 1 ■ Introducing Linux
At the time of writing, RHEL costs start at approximately $350 a year for basic support and range up to
$1,500 for premium support. Its more advanced cousin, RHELAP, ranges in cost from $1,500 to $2,500+ per
year depending on the hardware architecture and level of support desired. These costs provide you with
technical support and any needed patches or updates to the distribution.
Red Hat used to be run by a community of volunteers too until the distribution became so important
to the technical infrastructure of commercial organizations that people were happy to pay for guaranteed
support. Their original volunteer community still lives on as the Fedora Project.
CentOS
CentOS (www.centos.org/) is a derivation of the Red Hat Enterprise Linux platform. Based on the same
source code, it is available at no charge (and without Red Hat’s support). People who wish to make use of
the Red Hat platform and its stability without paying for additional support commonly use it. It employs the
same packaging system, RPM, and many of the same administration tools as the Red Hat product. It is one of
the distributions we will be using in this edition of the book.
Debian Linux
The Debian Linux distribution (www.debian.org) is a free community-developed and community-managed
distribution with a diverse and active group of developers and users. It was started in 1993 and built around
a social contract (www.debian.org/social_contract). The Debian distribution strives toward freedom,
openness, and maintaining a focus on delivering what users want.
The Debian distribution is well known for the dpkg packaging system and the availability of nearly
23,000 applications and tools for the distribution.
Ubuntu
Initiated by South African technologist and entrepreneur Mark Shuttleworth, the Ubuntu operating system
(www.ubuntu.com/) is free and based on the Debian Linux platform. It is community developed, and
upgrades are released on a six-month cycle. Commercial support is also available from its coordinating
organization, Canonical, as well as third-party support providers. It comes in different flavors to be used
as desktops or servers. Some pundits believe the ubiquitous nature and stability of Ubuntu heralds the
increased use of Linux as a desktop platform. Many people consider Ubuntu one of the easiest Linux
platforms to use and understand, and much of its development is aimed at ease of use and good user
experience. Ubuntu makes use of Debian’s packaging system and a number of its administration tools.
5
Chapter 1 ■ Introducing Linux
Gentoo
The Gentoo distribution (www.gentoo.org/) is another community-developed platform. It is notable
because it provides the option to compile the entire distribution from source code on your hardware.
This allows you to customize every option to suit your particular hardware combination but can take a
considerable time to complete. Gentoo can also be installed in a precompiled form for those with less
technical skill who don’t wish to compile everything. Gentoo is also well known for its frequent use as a
platform for MythTV, an open source media center application similar to Microsoft Media Center. Gentoo
makes use of a packaging system unique to the platform called Portage.
■■Tip You can learn about the myriad of distributions available in the Linux world at DistroWatch
(http://distrowatch.com/).
■■Tip Online you’ll find a useful unscientific automated quiz for selecting an appropriate Linux distribution
available at www.proprofs.com/quiz-school/story.php?title=which-linux-distribution-are-you-1
and an article on the topic at http://lifehacker.com/5889950/how-to-find-the-perfect-linux-
distribution-for-you.
With the exception of Red Hat Enterprise Linux, which requires a support contract to receive updates
and patches, all of the distributions we’ve discussed are available free of charge. You can download and
install them without having to pay a license fee.
■■Note You can get the Red Hat Enterprise Linux software for free and install it without having to pay a
license—the only trouble is that you will not be able to get any updates without a support agreement, which
can leave you with a buggy and insecure host.
Several of the distributions we’ve discussed have commercial support, and if your technical skills are
not strong, it is worth considering such a distribution, such as Red Hat Enterprise Linux or Ubuntu (with
support provided by Canonical, their coordinating company). You should also remember that technical
support may be available from a local provider. For example, a number of information technology (IT)
companies and systems integrators provide Linux support, and there are frequently small-to-medium
companies in the IT support business that could also provide relevant support services.
If you don’t wish to pay for the third-party or vendor-provided commercial technical support, you might
want to choose from a number of distributions that are noted for their large active communities where you
can find support and assistance. Ubuntu support resources in particular have grown in recent years due to
the many newcomers to Linux who have adopted that distribution.
6
Chapter 1 ■ Introducing Linux
Finally, don’t discount your own personal experience. Explore the distributions yourself. Try out
LiveCDs, install a few of the distributions, and get a feel for the various administration tools and interfaces.
Your own feelings about which distribution suits you and is the easiest for you to work with shouldn’t be
underestimated.
■■Note LTS is an abbreviation for “long-term support.” The Ubuntu project updates its server and desktop
releases every six months. The Ubuntu project guarantees that an LTS release will be supported (e.g., bugs fixed
and security issues patched) for a period of five years after its release. Red Hat also has a similar release cycle
where Red Hat tries to maintain binary compatibility for the life of the release (meaning it doesn’t change major
packages for life of the release). Red Hat also has an ELS (extended life-cycle support). For further information,
see https://wiki.ubuntu.com/LTS and https://access.redhat.com/support/policy/updates/errata
Each chapter will provide examples of configuration for each distribution and document any
differences between the distributions such as the location of configuration files or the names of packages.
Picking Hardware
Detailed analysis on choosing appropriate hardware is beyond the scope of this book. We generally
recommend you purchase hardware with sufficient reliability and support to meet your organization’s
requirements. If you need to rely on your infrastructure 24/7/365 and require high levels of availability,
you should purchase hardware with redundant features, such as backup power supplies. You should also
purchase appropriate support capabilities such as spare parts and onsite, phone, or online support.
Of course buying your own hardware may not be a cost-effective way of implementing your services.
Cloud providers may be your better option depending on your requirements. You can purchase a dedicated
or virtual server from providers like Rackspace (www.rackspace.com) or Linode (www.linode.com). And if
you want fully virtualized servers you can also look at Amazon Cloud Services (https://aws.amazon.com) or
Google Compute Engine (https://cloud.google.com/compute) and even simple services like DigitalOcean
(www.digitalocean.com)
7
Chapter 1 ■ Introducing Linux
■■Note The decision to go to the Cloud or buy your own hardware comes down to various factors. Is there
any real reason for the server to be in your office or data center? Do you have enough Internet bandwidth and
stability to put your services into the Cloud. You can always settle on a combination of in house hardware and
PaaS (Platform as a Service) depending on your requirements.
Supported Hardware
In addition to purchasing the right hardware, you should take into account some important selection and
performance considerations. The most important consideration is that not all hardware is supported by the
Linux operating system. While rare, some hardware components (e.g., some wireless network cards) lack
drivers and support on some or all Linux platforms.
You should confirm that whatever hardware you purchase is supported by the distribution you have
selected. Most distributions have Hardware Compatibility Lists (HCLs) you can use to verify your hardware
is supported. Here are some of the currently maintained HCL sites:
• https://access.redhat.com/ecosystem (relevant for Red Hat, CentOS, and Fedora)
• www.ubuntu.com/certification (Ubuntu)
• http://kmuto.jp/debian/hcl/wiki/ (Debian, but also relevant for Ubuntu)
• www.linuxquestions.org/hcl/index.php (generic listing)
There are also many large-scale hardware vendors that provide systems with OEM (Original Equipment
Manufacturer) Linux software. You can choose from companies such as Dell, HP, and IBM to provide
hardware guaranteed to work with a specified list of supported Linux distributions.
■■Note We’ll discuss a variety of specific performance issues in later chapters when we look at particular
applications and tools.
■■Note We’ll look at processes for automated, network-based provisioning of servers in Chapter 19.
Following is a list of some of the sites where you can get CD-ROMs and DVDs:
• www.ubuntu.com/download
• www.debian.org/distrib/
8
Another Random Scribd Document
with Unrelated Content
Oil, Paper. Syn. Rag oil, Pyrothonidæ; Oleum chartæ, L. On the small scale,
by burning paper on a cold tin plate, and collecting the oil; on the large scale,
by the destructive distillation of paper or linen rags. In baldness, toothache,
ear-ache, &c.
Oil, Par′affin. See Oils, Mineral.
Oil, Petro′′leum. See Oils, Mineral, Petroleum.
Oil, Rag. See Oil, Paper, above.
Oil, Rock. See Naphtha, Oils, Mineral, Petroleum.
Oil, Shale. See Oils, Mineral.
Oil of Soot. Syn. Oleum fuliginis (Ph. L. 1746), L. From wood-soot. Fetid;
reputed antispasmodic and nervine.
Oil of Tar. Syn. Spirit of t.; Oleum pini, O. p. rubrum, O. tædæ, O. picis
liquidæ, L. By simple distillation from wood-tar. Reddish and strong scented.
By one or more rectifications it becomes colourless and limpid. It soon gets
thick. Used in ringworm and several other skin diseases, made into an
ointment with lard. It is poisonous if swallowed in large doses.
Oil of Tobac′co (Empyreumatic). Syn. Oleum tabaci empyreumaticum (Ph.
U. S.), L. From tobacco, in coarse powder, gradually heated in a green-glass
retort to dull redness, and kept at that temperature as long as any oil passes
over; the oily portion is then separated from the water in the receiver, and
kept for use. Highly narcotic and poisonous.
Oil of Wax. Syn. Oleum ceræ, L. From beeswax and sand distilled
together; the product is rectified once or oftener. Reputed diuretic.—Dose, 3
to 6 drops.
OILS (Fixed). Syn. Fat oils, Unctuous o.; Olea fixa, O. expressa, L.; Huiles
grasses, Fr. The fixed oils are compounds of carbon, hydrogen, and oxygen
(oxyhydro-carbons), obtained from the organic kingdom, and characterised by
their insipidity, unctuosity, insolubility in water, and being lighter than that
fluid. Olive oil, which is obtained from the vegetable kingdom, and spermaceti
oil, which is obtained from the animal kingdom, may be taken as types of the
rest.
The fixed oils are chiefly found in the fruit and seeds of plants, and in
thin membranous cells, forming what is called the adipose tissue, in the
bodies of animals. According to their consistence, they may be classed into
‘OILS,’ ‘BUTTERS,’ and ‘TALLOWS,’
Prop., &c. Among the best-known properties of the fixed oils are—the
permanent stain they give to paper, which they render translucid; their non-
volatility at the ordinary temperature of the atmosphere, or at that of boiling
water, or, indeed, at any temperature insufficient for their decomposition; their
constantly floating on the surface of water when added to it; and, lastly, their
inability to mix with that fluid. Some of them, as palm oil and cocoa-nut oil,
are solid at ordinary temperatures; but the majority are fluid, unless they
have been considerably cooled, when they separate into two portions—the
one solid, consisting chiefly of stearin, or some analogous substance, and the
other liquid, consisting chiefly of olein or elain. Nearly all of them, when
exposed to the air, absorb oxygen rapidly, and either gradually harden or
become rancid and nauseous. From the first are selected the ‘drying oil’ used
by painters; the last are used as food, in cookery, and for machinery, lamps,
&c. The whole of these oils, when heated to their boiling points (500° to 600°
Fahr.), suffer decomposition, yielding various hydrocarbons; and when
suddenly exposed to a red heat, they furnish a gaseous product (oil-gas),
which was formerly employed for illumination. It is owing to this property of
oil and liquid fats that candles and lamps give their light. The wick is a gas-
producing apparatus in miniature. With the caustic alkalies and water the
fixed oils unite to form soap. When some of these oils are absorbed by porous
bodies, and thus expose a vastly increased surface to the air, they absorb
oxygen with such rapidity as to generate a considerable degree of heat. Paper,
tow, cotton, wool, straw, shavings, &c., slightly embued with oil, and left in a
heap, freely exposed to the air or sun, often spontaneously inflame. In this
way many extensive fires have arisen. The above is more particularly the case
with linseed, rape, nut, and olive oil. The first, made into a paste with
manganese, rapidly becomes hot, and ultimately inflames spontaneously.
The specific gravities of the fixed oils range between ·865 and ·970,
water being 1·000.
Prep. The fixed oils, except where otherwise directed, are obtained from
the bruised or ground fruit or seed, by means of powerful pressure, in screw
or hydraulic presses, and are then either allowed to clarify themselves by
subsidence or are filtered. Both methods are frequently applied to the same
oil. In some cases the impurities are removed by ebullition with water, and
subsequent separation of the pure oil. Heat is frequently employed to increase
the liquidity of the oil, and thus lessen the difficulty of its expulsion from the
mass. With this object the bruised mass, placed in bags, is commonly exposed
to the heat of steam, and then pressed between heated plates of metal. This
is always necessary with the ‘butyraceous oils.’
Another method is by boiling the bruised seed in water, and skimming off
the oil as it rises to the surface. This is the plan adopted for castor oil in the
West Indies.
In a few cases, for medicinal purposes, the bruised mass is mixed with
1⁄ 2its weight, or an equal weight, of alcohol or ether, and after 24 hours’
digestion the whole is submitted to pressure, and the alcohol or ether
removed by distillation at a gentle heat. The first menstruum is commonly
employed for croton oil on the Continent; the second, for that of ergot of rye.
Purif. Several methods are adopted for refining or purifying the fixed oils,
among which are the following:—
1. The oil is violently agitated along with 1 1⁄ 2 to 2% of concentrated
sulphuric acid, when it assumes a greenish colour, and, after about a
fortnight’s repose, deposits much colouring matter, becomes paler, and burns
with greater brilliancy, particularly if well washed with steam or hot water, and
clarified by subsequent repose or by filtration. This answers well for most of
the recently expressed vegetable oils. It also greatly improves most of the fish
oils.
2. A modification of the last method is to well mix the acid with the oil,
then to blow steam through the mixture for some time, and afterwards to
otherwise proceed as before.
3. Fish oil (WHALE, SEAL, &c.) is purified by—
a. Violently agitating it with boiling water or steam, by placing it in a deep
vessel with perforated bottom, through which high pressure steam is forced
for some time; it is afterwards clarified by repose, and filtered through coarse
charcoal.
b. The oil is violently agitated with a boiling hot and strong solution of
oak bark, to remove albumen and gelatin, and next with high-pressure steam
and hot water; it is, lastly, dried and filtered.
c. The oil, gently heated, is stirred for some time with about 1% of good
chloride of lime, previously made into a milk by trituration with water; about
1 1⁄ 2% of oil of vitriol, diluted with 20 times its weight of water, is then added,
and the agitation renewed and maintained for at least 2 hours; it is, lastly,
well washed with steam or hot water.
d. Mr Davidson treats the oil first with a strong solution of tan, next with
water and chloride of lime, then with dilute sulphuric acid, and lastly, with hot
water.
e. Mr Dunn’s method, which is very effective, and admirable on account
of its simplicity, is to heat the oil by steam to from 180° to 200° Fahr., and
then to force a current of air of corresponding temperature through it, under
a flue or chimney, until it is sufficiently bleached and deodorised; it is, lastly,
either at once filtered or is previously washed with steam or hot water.
f. Another method, formerly very generally adopted and still in use, is to
violently agitate the oil for some time with very strong brine, or with a mixed
solution of blue vitriol and common salt, and then either to allow it to clarify
by repose or to filter it through freshly burnt charcoal.
4. Almond, CASTOR, LINSEED, NUT, OLIVE, RAPE, and some other vegetable
oils, are readily bleached by either of the following processes:—
a. Exposure in glass bottles to the sun’s rays, on the leads or roofs of
houses, or in any other suitable position, open to the south-east and south.
This is the method employed by druggists and oilmen to whiten their castor
and linseed oils. 14 to 21 days’ exposure to the sun in clear weather during
summer is usually sufficient for castor oil when contained in 2 to 4-quart pale
green glass bottles (preferably the former), and covered with white gallipots
inverted over them. The oil is filtered before exposing it to the light, as, if only
in a slight degree opaque, it does not bleach well. Almond and olive oil are,
when thus treated, apt to acquire a slight sulphurous smell; but this may be
removed by filtration through a little animal charcoal, or, still better, by
washing the oil with hot water.
b. Another method employed to decolour these oils is to heat them in a
wooden, tinned, or well-glazed earthen vessel along with some dry ‘filtering
powder’ (1 to 2 lbs. per gall.), with agitation for some time, and lastly, to filter
them in the usual manner through an oil-bag. In this way the West-end
perfumers prepare their ‘WHITE ALMOND OIL’ (OLEUM AMYGDALÆ ALBUM), and
their ‘WHITE OLIVE OIL’ (OLEUM OLIVÆ ALBUM). Formerly, freshly burnt animal
charcoal was used for this purpose, and is still so employed by some houses.
5. Mr Bancroft refines OILS FOR MACHINERY AND LUBRICATING PURPOSES
generally, by agitating them with a lye of caustic soda of the sp. gr. 1·2. A
sufficient quantity is known to have been added when, after repose, a portion
begins to settle down clear at the bottom. About 4% to 8% is commonly
required for lard oil and olive oil. After 24 hours’ repose the clear supernatant
oil is decanted from the soapy sediment, and filtered.
6. Not only the oils above referred to, but all other oils and fats, may be
rendered perfectly colourless by the use of a little chromic acid; or, what is the
same, by a mixture of a solution of bichromate of potassa and sufficient
sulphuric, hydrochloric, or nitric acid, to seize on all the alkali, and thus
liberate the chromic acid.
7. Palm oil and Cocoa-nut oil are generally refined and bleached by either
chromic acid or chlorine, or by heat:—
a. The ‘butyraceous oil’ is liquefied by heat in a wooden vessel, and 7%
to 9% of good chloride of lime, previously made into a smooth cream with
water, is added, and the whole assiduously stirred until the ingredients appear
united; the mixture is then allowed to cool, and is next cut up into small
lumps, which are exposed to a free current of air for 2, 3, or even 4 weeks;
these are melted in a wooden vessel heated by high-pressure steam
circulating through leaden pipes, or in a cast-iron boiler lined with lead, and
an equal weight of oil of vitriol (diluted with about 20 times its weight of
water) is poured in, and the whole gently boiled until the oil is discoloured
and runs clear; the fire is then moderated, and the whole allowed to settle;
lastly, the fire is removed, and the oil is left to cool very slowly.
b. The process with chromic acid has been already noticed, but is more
fully explained below.
c. The oil, heated to the temperature of about 250° Fahr., is exposed to
the action of high-pressure steam, which is continuously ‘blown’ through it for
10 or 12 hours, or even longer. The process is greatly facilitated by the
introduction of some chromic acid.
8. Mr Watt’s methods of purifying fats and oils are very effective, more
especially for those intended for illumination. They are as follows:—
a. (For FISH OILS.) Each ton is boiled for 1⁄ 2 an hour with caustic soda,
1⁄ 2 lb., previously made into a weak lye with water; or steam is blown
through the mixture for a like period; oil of vitriol, 1⁄ 2 lb., diluted with 6 times
its weight of water, is next added, the whole again boiled for 15 minutes, and
allowed to settle for an hour or longer, when the clear oil is run off from the
water and sediment into the bleaching tubs; here solution of bichromate of
potash, 4 lbs., in oil of vitriol, 2 lbs., previously diluted with water, q. s.,
together with a little nitric acid and some oxalic acid, are added, and after
thorough admixture of the whole, by blowing steam through it, strong nitric
acid, 1 lb., diluted with water, 1 quart, is poured in, and the boiling continued
for 1⁄ 2 an hour longer; a small quantity of naphtha or rectified spirit of
turpentine is then mixed in, and the oil is, finally, well washed with hot water,
and left to settle.
b. (For PALM OIL.) The oil is melted by the heat of steam, and, after it has
settled and cooled down to about 130° Fahr., is carefully decanted from the
water and sediment into the steaming tubs; here a mixture of a saturated
solution of bichromate of potash, 25 lbs., and oil of vitriol, 8 or 9 lbs., is
added, and after thorough admixture, hydrochloric acid, 50 lbs., is poured in;
the whole is then constantly stirred until it acquires a uniform greenish colour,
or is sufficiently decoloured, a little more of the bleaching materials being
added if the latter is not the case, after which it is allowed to repose for half
an hour to settle; it is next run into a wooden vat, where it is washed, &c., as
before.
c. (For VEGETABLE OILS.) These are treated with a solution of chromic acid,
or with a solution of bichromate of potassa, or some mineral acid, as noticed
at No. 6. For COLZA, LINSEED, MUSTARD, NUT, and RAPE OIL, a little hydrochloric
acid is added; but for ALMOND, CASTOR, OLIVE OIL, and POPPY OIL, no such
addition (at least in excess) is required.
9. Rancid oils and FATS are recovered by boiling them for about 15
minutes with a little water and calcined magnesia; or, by filtering them
through freshly burnt charcoal.
In reference to the above processes, it may be useful to remark, that
chlorine, the common bleacher and deodoriser of other substances, cannot be
well employed directly in the purification of oils, as certain chemical reactions
occur when these substances are brought together, which increase the colour
instead of removing it, and are often otherwise injurious. The same remarks
apply to the use of the ‘chlorides,’ which frequently fails in unskilful hands,
and is, indeed, of questionable utility, except, perhaps, in the case of palm oil.
Even charcoal exerts little of its usual energy on the oils, and whilst it removes
or lessens their offensive odour, sometimes increases their colour. The
addition of 1% or 2% of very pure and recently rectified naphtha or oil of
turpentine (camphine) to lamp oil is a real improvement, since it increases its
combustibility and its illuminative power.
Oils for medical purposes, as CASTOR OIL, COD-LIVER OIL &c., must not be
subjected to any process beyond mere clarification by subsidence, filtration
through Canton flannel or porous paper, or, at the utmost, washing with warm
water, as otherwise their active and valuable properties, if not wholly
removed, will be considerably lessened. See Filtration.
Purity. The fixed oils vary greatly in their value, and hence the constant
inducement which leads the unprincipled dealer to adulterate the more
expensive ones with those of a similar character, but of an inferior kind of
grade. Various methods are adopted to detect these frauds, among which the
following are the most valuable of those capable of general application.
Others referring to individual oils will be found under the respective heads.
1. (From the odour.) The method of applying this test is to heat a few
drops of the oil under examination in a small porcelain, platinum, or silver
spoon or capsule (a watch-glass answers well), and to carefully compare the
odour evolved with that arising from a known pure sample of the same kind
and quality of the oil similarly treated. The odour of the two, when each is
pure, is precisely alike, and immediately suggests the plant or animal from
which it has been obtained. The presence of LINSEED, NUT, RAPE, SEAL, TRAIN,
or WHALE OIL, is thus readily detected, and the imperfections of the sample,
even if pure, rendered much more perceptible.
2. (From the density.)—a. According to M. Penot, every oil supposed to
come from the same plant, or the same animal, has its own particular density,
which, at the same temperature, never deviates more than a few
thousandths. To apply this test, the relative density or specific gravity of the
sample must be determined. This may be done by means of a thousand-grain
bottle or an ordinary ‘AREOMETER,’ or, more conveniently, by an ‘ELAÏOMETER’ or
‘OLEOMETER,’ constructed and graduated for the purpose. ‘Fischer’s ELAÏOMETER’
or ‘OIL-BALANCE’ is much employed on the Continent for this purpose, and is a
very useful instrument. On the large scale, the weight of an accurately
measured imperial gallon of the oil may be taken.
b. M. Lauret, an eminent Parisian chemist, a short time since observed
that the variations of the density of an oil from adulteration are rendered
much more apparent when it is examined in a heated state. To render this
discovery practically available, he plunges an ‘elaïometer,’ graduated for the
given temperature, into a small tin cylinder nearly filled with the oil, and then
places this in a vessel containing boiling water; as soon as the whole has
acquired a uniform temperature, he observes the point on the scale of the
instrument at which it floats. This point for—
Colza oil is 0°
Fish oil 83°
Poppy oil 124°
Hemp-seed oil 136°
Linseed oil 210°
Reagents.
Solution of Bichromate of
Name of Oil. Sulphuric Acid.
Potash.
Not stirred. Stirred. Stirred.
Rape oil with More red ground Brownish- Small reddish lumps on a
whale-train oil than with rape oil olive coloured grey ground.
No perceptible Small and more numerous
Rape oil with Olive
difference from the red lumps on a very dark-
linseed oil coloured
rape oil green ground.
Rape oil with No perceptible
Greenish Small brownish lumps on
olein or oleic difference from the
brown an olive-coloured ground.
acid rape oil
Rise of Temperature.
Almond oil 72·5°
Olive oil 68·0°
Poppy oil 127·0°
Rape or colza oil 100·0°
Linseed oil (with Nordhausen or fuming acid only) 133·0°
The above method is less liable to error when a larger quantity of the
substances are thrown together.
5. The presence of FISH OIL in the vegetable oils may be readily detected
by passing a stream of chlorine through them; the pure vegetable oils are not
materially altered, but a mixture of the two turns dark brown or black.
6. Mr Coleman states that the presence of mineral oils in animal or
vegetable oils can be easily detected by two characteristic tests—(1) the
fluorescent properties they impart to all animal or vegetable oils. (2) The
strongly marked aromatic burning flavour they communicate to mixtures
containing them. The first-mentioned property is brought out by smearing a
metallic surface, such as tin plate or steel, with the oil, and then viewing it at
different angles in the open air or sunlight. Mr Coleman suggests that, in
examining a dark-coloured oil, it may first be necessary to refine the sample
by successive treatments with concentrated sulphuric acid and weak soda
solution or lime water, so small a quantity as 2 1⁄ 2 per cent. may then be
detected by the bluish colour noticed on viewing the oil at certain angles and
by tasting it.
The absence of resin oil must also be proved. Nitric acid is said to be a
good test, as the colour developed is much greater than in pure oils.
Sometimes it may be detected by the smell. The presence of 10 per cent. of
resin or mineral oil in non-drying oils delays their solidification with the nitrate
of mercury test.[50]
[50] ‘Journal of Applied Chemistry,’ Dec., 1874.
7. Miss Kate Crane[51] states that the cohesion figures of oils may be
usefully employed as tests of the identity and purity of the oils. She says, “A
number of experiments on this subject have led her to the conclusion that a
little patient practice will teach the eye of the observer in a short time to
detect the characteristic differences of the figures. To make these perfect it is
necessary to observe the time in forming, for at different periods some
varieties form figures very like; but with this precaution each is entirely
characteristic.
[51] ‘American Journal of Pharmacy,’ iv, 406.
“It is essential that the dish used, &c., be perfectly clean, so that when
filled with water no dust or lint floats upon the surface, as this materially
interferes with the perfect formation of the figure.
“A single drop is let fall from a burette or glass rod held steadily above
the water, upon the centre of the surface. The experiments made with fixed
oils are as follows:—Poppy-seed oil spreads instantly to a large figure,
retaining an entire outline, and for a few seconds the surface is unbroken,
except the bare intimation of a beaded edge.
“In a few moments little holes appear round the edge, and soon the
whole surface is broken in like manner; these increase in size very slowly. In
fifteen minutes the edge begins to open, forming indentations, which
gradually work their way across the figure. As they increase in length these
begin to curve, and in three quarters of an hour have doubled themselves two
or three times.
“Cod-liver oil spreads in a large film; a little way from the edge a row of
small holes appears, and in a minute or two the surface is covered with them;
these gradually enlarge, assuming irregular shapes, soon separated by
branching lines.
“Cod-liver oil with lard oil spreads very like the former, but in a few
moments the edge opens, and the film separates partly across; in a moment
one of the projecting points begins to curve itself towards the centre, bending
more and more until it forms a coil; meanwhile a few holes have appeared,
which spread irregularly, throwing out projecting points.
“Castor oil spreads instantly, the edge remaining entire; openings appear
quickly in thirty seconds, and increase gradually, but unevenly, those nearer
the edge being larger, and lengthening out irregularly as they spread. The
figure lasts some time.
“Castor with a little lard oil makes a smaller figure, and not nearly so
much broken; in five minutes the holes open into each other, and the figure
breaks up from the edge.
“A mixture of castor and poppy-seed oils spreads to form a lacework
border, but smooths out to an entire edge soon, and within a few seconds
openings appear. The figure, in size and general appearance, is more like
castor oil alone, but the holes spread less uniformly in a given time, a few
being larger, but the greater portion much smaller. In fifteen minutes there is
a general tendency to break up.
“Castor with a little croton oil throws out a spray, which in a few moments
unites into a thin film. The spray, as it spreads, draws out the inner portion
into radiate points, which open into a beautiful network, the centre cohering
closely.
“Croton oil throws out, in spreading, a fine spray in advance of the more
closely cohering portion, which follows quickly. The outer edge breaks up
unevenly into little indentations, the border of the inside portion being quite
broken, but gradually becomes nearly entire. The surface, too, has openings,
which increase quite rapidly in size, the outer ones being much the larger. In
the final breaking up, before the holes open one into another, the outlines are
beautifully fringed.
8. “Spontaneous combustion ensues when a handful of cotton waste is
embued with oil and placed in an air bath at 130° to 200° F. Boiled linseed oil
required 1 1⁄ 4 hour; raw linseed oil, 4 hours; lard oil, 4 hours; refined rape
about 9 hours.”[52]
[52] J. J. Coleman, ‘Journal of Applied Chemistry,’ Dec., 1874.
The quantity of metal destroyed, in equal times and under equal conditions,
increases with the acidity of the oil.
The table on page 1128, by Mr Bottome, describes the most striking physical
properties of some of the principal fixed oils.
⁂ The following are the principal fixed oils met with in commerce, or which
are objects of interest or utility:
Oil of Al′monds. Syn. Oleum amygdalæ (B. P., Ph. L), O. amygdalarum (Ph. D.),
O. amygdali communis (Ph. E.), L. “The oil expressed from the kernels.” (Ph. L.)
“Bruise the fresh almonds in a stone mortar, then put them into a hempen sack,
and express the oil, without heat.” (Ph. E.) The oil of almonds B. P. and of
commerce is obtained from either the bitter or sweet almond, but chiefly from the
first, on account of their less value, and the marc being employed in the
manufacture of essential oil.
Prop., &c. Oil of almonds is black, demulcent, emollient, and nutritious;
possesses a purely oleaginous taste, and is one of the most agreeable of the fixed
oils; when taken in quantity it is mildly laxative; it is little affected by cold, and
congeals with difficulty; is soluble in 35 parts of cold and 6 parts of boiling
alcohol; ether dissolves it freely. Sp. gr. ·915 to ·918. Av. prod. Sweet almonds,
46%; bitter a., 41%.
Pur. It is extensively adulterated with poppy, nut, and teel oil, and not
unfrequently with refined rape or colza oil. (See above.)
Oil of Bay. 1. (Expressed o. of b.; Oleum lauri, O. laurinum, L.) By expression
from either fresh or dried bayberries, as castor oil. Limpid; insipid.
2. (By decoction; Butter of b.; Oleum lauri nobilis, O. l. verum, L.) From the
berries, by boiling them in water, and skimming off the oil. Green, buttery; chiefly
imported from Italy. Used by the vulgar in bruises, sprains, rheumatism, deafness,
&c. Prod. 20%.
Oil of Beech. Syn. Oleum fagi, L. From the nuts of Fagus sylvatica (Linn.) or
beech mast. Clear; keeps well; when washed with hot water, it is used for salads,
and burnt in lamps. Sp. gr. ·9225. Prod. 16%.
Oil of Belladon′na. Syn. Oleum belladonnæ seminum, O. b. baccæ, L. From the
seeds or berries of Atropa belladonna or deadly nightshade. Yellow; insipid. Used
for lamps in Swabia and Wurtemberg, and as an application to bruises. The marc
is poisonous. It freezes at 34° Fahr. Sp. gr. ·9250.
Oil of Ben. Syn. Oil of behen; Oleum balatinum. From the seeds of Moringa
pterygosperma (ben nuts). Scentless, colourless; keeps long without growing
rank; by standing, it separates into two parts, one of which freezes with difficulty,
and is hence much used in perfumery.
Oil of Benne Seed. See Oil of Gingelly.
Oil of Brazil-nuts. Syn. Oleum bertholletiæ. From the kernels of the fruit of
Bertholletia excelsa, or Brazil-nuts. An oil of a bright amber colour, congealing at
24° Fahr. Sp. gr. ·917. It has been used as a substitute for olive oil in plasters and
ointments.
Oil of Caca′o. Syn. Butter of c.; Oleum cacao concretum, Butyrum cacao, L. From
the seeds of Theobroma Cacao, or chocolate nuts, gently heated over the fire,
and then decorticated, and pressed between hot iron plates. Sp. gr. ·892.
Column headings:
A. Name of Oil.
B. Specific Gravity at 15°C., Water = 1,000.
C. Combustibility. Grms. consumed per hour in a Lamp with Wick.
D. Freezing Point in degrees Centigrade.
E. Colour.
F. Taste.
G. Smell.
H. Limpidity. Time (in seconds) required to trickle a given distance.
I. Drying Power.
A. B. C. D. E. F. G. H. I.
Plum Brownish Non-
0·9127 68 -9 Amygdalaceous Very slight 93
kernel yellow drying.
Rape Non-
0·9128 30 -4 Yellow Nauseous Nauseous 159
seed drying.
Non-
Colza 0·9136 40 -9·25 Yellow Nauseous Nauseous 162
drying.
Cabbage Non-
0·9139 48·5 -8 Yellow Nauseous Nauseous 148
seed drying.
White Light Non-
0·9142 29·8 -16·25 Pleasant Very slight 157
mustard yellow drying.
Pale
Ground Not Non-
0·9163 ? -3 greenish Like peas Like peas
nut tested drying.
yellow
Black Non-
0·9170 25 -17·5 Yellow Pleasant Very slight 141
mustard drying.
Non-
Olive 0·9176 62 -6[54] Yellow Sweet Peculiar 195
drying.
Sweet Non-
0·9180 52·8 -21·5 Amber Agreeable None 150
almond drying.
Horse-
Yellowish Non-
radish 0·9187 43 -16·25 Pleasant None 143
brown drying.
seed
Grape Gold Dries
0·9202 37 -16·25 Sweet None 99
seed yellow slowly.
Beech Non-
0·9225 50 -17·5 Amber Very sweet None 158
nut drying.
Pale
Dries
Pumpkin 0·9231 43 -15 brown Sweet None 185
slowly.
yellow
Land- Brownish Dries
0·9240 42 -15 Acrid Disagreeable 103
cress yellow slowly.
Non-
Hazel nut 0·9242 53·4 -10 Amber Sweet None 166
drying.
Pale
Poppy 0·9243 31 -18[55] Flat None 123 Drying.
yellow
Camelina 0·9252 34 -18 Yellowish Peculiar Peculiar 119 Drying.
Light
Walnut 0·9260 45 -27·5 Flat None 88 Drying.
yellow
Dries
Sunflower 0·9262 51·8 -16 Colourless Sweet None 114
slowly.
Dark
Hemp
0·9276 46 -27·5 greenish Disagreeable Disagreeable 87 Drying.
seed
yellow
Cotton Reddish Not
0·9316 ? -2·5 Strong None Drying.
seed brown tested
Bright Pleasant, Not Non-
Sesame 0·9320 ? -5 None
yellow slightly piquant tested drying.
Linseed 0·9347 38 -27 Dark Strong Disagreeable 88 Drying.
greenish
yellow
Not
Wood 0·9358 44 Green Unpleasant None 73 Drying.
noted
Reddish Non-
Spindle 0·9360 61 -20 Acrid Slight 143
brown drying.
Dries
Castor 0·9611 47 -18 Colourless Sickly Very slight 1,830
slowly.
[54] Though these oils do not become quite solid till the point indicated is
reached, yet they begin to become grainy at +4° C.
[55] Once solidified, this oil does not liquify until the temperature reaches
2°C.
Table giving the reactions of various OILS with SULPHURIC ACID and with a saturated
solution of BICHROMATE OF POTASH in sulphuric acid. Re-arranged from M.
Penot’s table, with additions, by Mr Cooley.
⁂ The result indicated is obtained in each case by the action of one drop of
the REAGENT on twenty drops of OIL.
Reagents
Saturated Solution of Bichromate of
Name of Oil Sulphuric Acid
Potassa in Sulphuric Acid
Not stirred Stirred Stirred
Greenfinch yellow, with orange Yellowish,
Almond oil Dirty green
spots small lumps
Castor oil Yellow, with slight spots Little reaction Slightly green
Deep purple in the centre,
rapidly turning brown, whilst Deep purple, passing
violet or purple clouds or into purple brown, Reddish-brown
Cod-liver oil
streaks spread out towards the reddish brown, and clots, changing
(fine sample
circumference, the colour of gradually deepening to a clear
of pale oil)
which remains minutes after to an intense brown, bright green
the central portion turned approaching black
nearly black
Small yellow
Hemp-seed Small brown lumps or clots on lumps or clots
Greenish brown
oil a yellow ground on a green
ground
Linseed oil Dark reddish brown Brown small lumps Brown small
(from the on a grey ground lumps on an
almost
Upper colourless
Rhine) ground
Brown small
Reddish brown, less dark Brown clots on a
(from Paris) lumps on a
coloured green ground
green ground
Brown lumps
Brown clots on a
(English) Chestnut brown on a greenish-
greenish-grey ground
grey ground
Liver-train
Dark red Dark red Dark red
oil
Light brown
small lumps on
Madia-sativa Slightly reddish brown
Olive green an olive-
oil underneath a thin greyish film
coloured
ground
Black-
Bluish green Olive green Olive brown
mustard oil
Brown spots
Neat’s-foot
Yellow slight spots Dirty brown on a brownish
oil
ground
Nut oil Small brown
Yellowish brown Clotted, dark brown
(recent) lumps or clots
(one year Dirty brown, less Small brown
Yellow
old) dark coloured lumps
Small
(still older) Orange yellow Dirty brown brownish
lumps
Olein, oleic Bright
Reddish spots, with reddish
acid, lard, Reddish brown chestnut
circles
or tallow oil colour
Olive oil Yellow Dirty brown Olive brown
(another
Orange yellow Brownish grey Brown
sample)
(from
fermented Orange yellow Brownish grey Brown
olives)
Poppy oil Small yellow
(recent cold Yellow spots Olive brown lumps on a
drawn) white ground
(recent, Greenish-yellow spots Olive brown, turning Small yellow
expressed more on the green lumps on a
with slight greenish-grey
heat) ground
(one year
Small yellow
old,
Greenish spots Olive green lumps on a
expressed
green ground
with heat)
Rape or Yellowish-brown streaks Yellow small
Brownish, turning on
colza oil surrounded by a bluish-green lumps on a
the olive green
(trade) ring green ground
Yellow small
(recent) Green Bluish green lumps on a
green ground
Yellow lumps
(one year
Green Bluish green on a brighter
old)
green ground
Small yellow
(one year
lumps, more
old, rough
Green Olive green numerous, on
hot-
an olive-green
pressed)
ground
Small, bright,
chestnut-
Whale-train Small reddish lumps on a
Resembles wine lees coloured
oil brownish ground
lumps on a
brown ground
Oil, Cas′tor. Syn. Ricini oleum (B. P.), Oleum castorei, O. ricini (Ph. L., E., &
D.), L. “The oil prepared by heat, or by pressure, from the seed” of “Ricinis
communis, Linn.” (Ph. L.), the Palma Christi, or Mexican oil-bush.
The best castor oil (COLD-DRAWN CASTOR OIL; OLEUM RICINI SINE IGNE)is
prepared by pressing the shelled and crushed fruit (seed) in hemp bags, in an
hydraulic press, and heating the oil thus obtained along with water in well tinned
vessels, until the water boils and the albumen and gum separate as a scum; this
is carefully removed, and the oil as soon as it has become cold is filtered through
Canton flannel, and put into canisters. The commoner kinds are prepared by
gently heating the crushed seeds, and pressing them whilst hot. Another method,
sometimes adopted, is to put the crushed seed into loose bags, to boil these in
water, and to skim off the floating oil.
Prop. It is the most viscid of all the fixed oils; when pure it mixes in all
proportions with alcohol and ether, and also dissolves, to a certain extent, in
rectified spirit, but a portion of the oil separates on standing. Camphor and
benzoic acid increase its solubility in spirit. By long exposure to the air it becomes
rancid, thick, and is ultimately transformed into a transparent yellow mass; light
hastens these changes. Exposed to cold, a solid, white crystalline fat separates
from the liquid portion, and when cooled to 0° it congeals into a yellow
transparent mass, which does not again liquefy until the temperature rises to
about 18° Fahr. Sp. gr. ·9611 to ·9612, at 60°; ·9690, at 55° (Saussure); ·9575,
at 77° (Saussure). Prod. 38% to 40% (62%—Ure).
Pur. Castor oil is sometimes adulterated with rape oil or with lard oil, a fraud
which may be detected by its diminished density; and, when the added oil
exceeds 33%, by its insolubility in its own weight of alcohol of ·820. In many
cases croton oil is added to increase the purgative quality of the mixture. A
compound of this kind is vended in gelatine capsules under the name of
‘CONCENTRATED CASTOR OIL,’ the use of which is fraught with danger. “I have heard
of several cases in which very violent and dangerous effects were produced by
these capsules.” (Pereira.) The best is imported from the East Indies in tin
canisters. The oil obtained from the seeds of Ricinus viridis (Willd.), or lamp-oil
seeds, is often mixed with or sold for castor oil.
Uses, &c. Castor oil is an exceedingly useful mild purgative, particularly when
abdominal irritation should be avoided, as in inflammations of the stomach and
bowels, pregnancy, surgical operations, &c.—Dose, 2 fl. dr. to 1 fl. oz.
Oil, Cocoa-nut. Syn. Cocoa-nut butter; Oleum cocois nuciferæ, L. By
expression from the kernels of the cocoa nut, or fruit of the Cocos nucifera.
Oil, Cod-liver. Syn. Morrhuæ oleum (B. P.), Cod-fish oil; Oleum jecoris aselli, O.
gadi, O. g. morrhuæ, Oleum morrhuæ (Ph. L.), L. “The oil extracted from the fresh
liver of the Gadus morrhua by a steam heat or water bath not exceeding 180°
Fahr. Yellow.” “The oil prepared from the liver of Gadus morrhua, Linn.” (Ph. L.)
The common cod-liver oil of commerce drains from the livers of the cod-fish
when freely exposed to the sun, and just beginning to putrefy. It is dark coloured,
strong, and nauseous, and is now chiefly employed in this country by the curriers,
for dressing leather. It is the ‘OLEUM JECORIS ASELLI FUSCUM’ of Continental writers.
Formerly, the less fetid varieties of this crude oil, after the impurities were
removed, either by subsidence or filtration, constituted the only cod-liver oil used
in medicine. As its employment as a remedy increased, its revolting flavour, and
its great tendency to permanently disorder the stomach and bowels, was found,
however, to be a serious obstacle to its general use. It was observed that the oil
as it exists in the liver of the cod is bland and nearly colourless, and has only a
slight fishy, but not a disagreeable flavour. The attention of persons interested
was therefore immediately directed to the subject, and improved methods of
obtaining the oil were suggested, and ere long adopted on the large scale.
The methods of preparing cod-liver oil are noticed in another part of this
work, but we think it advisable to add to these a description of the plan adopted
by Messrs Charles Fox and Co., of Newfoundland, Scarborough, and London, the
well-known manufacturers and importers of cod-liver oil:—
“The Newfoundland fisheries are entirely carried on in small boats, principally
by the hand-line system, and quite close to the shore. The boats go out early in
the morning, and return about four o’clock in the afternoon. The fish, on landing,
are handed over to a ‘fish-room keeper,’ whose duty it is to split and open the
fish, and to deposit the livers in small tubs holding 17 or 18 gallons each. The
tubs are soon afterwards collected from the different ‘fish-rooms,’ and conveyed
to the manufactory. The livers are here thrown into tubs filled with clean cold
water, and, after being well washed and jerked over, are placed on galvanised
iron-wire sieves to drain. They are next put into covered steam-jacket-pans, and
submitted to a gentle heat for about three quarters of an hour, after which the
steam is turned off, cold air again admitted, and the whole allowed to repose for
a short time, during which the livers subside, and the oil separates and floats on
the top. The oil is then skimmed off into tin vessels, and passed through flannel
strainers into tubs, where it is left to subside for about 24 hours. From these the
purer upper portion of oil is run into a very deep, galvanized-iron cistern, and
again left to clarify itself by defecation for a few days. It is now further refined by
carefully passing it through clean and very stout mole-skin filters, under pressure.
The transparent filtered oil is received in a clean, galvanised-iron cistern
containing a pump, from which the casks are filled for exportation. The latter,
before being filled, are carefully seasoned and cleaned, to prevent their imparting
either flavour or colour to the pure oil.”
The superiority of the oil prepared as above consists essentially in every part
of the process of extraction being performed whilst the livers are fresh, and in no
chemical means being adopted to give the oil a factitious appearance. Its natural
pale colour is thus preserved from contamination, and its medicinal virtues
maintained intact.
Much of the light brown oil of commerce is obtained from Gadus callarius
(the dorse). G. carbonarius (the coal-fish), and G. pollachius (the pollack).
Pur., &c. “The finest oil,” remarks Dr Pereira, “is that which is most devoid of
colour, odour, and flavour. The oil, as contained in the cells of the fresh liver, is
nearly colourless, and the brownish colour possessed by ordinary cod-liver oil is
due to colouring matters derived from the decomposition (putrefying) of hepatic
tissues and fluids, or from the action of the air on the oil (age). Chemical analysis
lends no support to the opinion, at one time entertained, that the brown oil was
superior, as a therapeutic agent, to the pale oil. Chemistry has not discovered any
substance in the brown oil that would confer on it superior activity as a medicine.
On the other hand, the disgusting odour and flavour and nauseating qualities of
the brown oil preclude its repeated use. Moreover, there is reason to suspect that,
if patients could conquer their aversion to it, its free use, like that of other rancid
and empyreumatic fats, would disturb the digestive functions, and be attended
with injurious effects.”[56]
[56] ‘Elem. Mat. Med.,’ &c., 3rd edit., iii, 2339.
Among the tests of purity, that generally relied on is known as the ‘sulphuric
acid test.’ See Oils (Fixed): Purity.
Dorse oil, and other FISH OIL, sold as ‘LIGHT-BROWN COD-LIVER OIL,’ exhibit with
this test much lighter reactions, which closely resemble those of LIVER-TRAIN and
WHALE-TRAIN OIL.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com