About This eBook
ePUB is an open, industry-standard format for eBooks. However, support of ePUB and its many features varies across reading devices and applications. Use your device or app settings to customize the presentation to your liking. Settings that you can customize often include font, font size, single or double column, landscape or portrait mode, and figures that you can click or tap to enlarge. For additional information about the settings and features on your reading device or app, visit the device manufacturers Web site.
Many titles include programming code or configuration examples. To optimize the presentation of these elements, view the eBook in single-column, landscape mode and adjust the font size to the smallest setting. In addition to presenting code and configurations in the reflowable text format, we have included images of the code that mimic the presentation found in the print book; therefore, where the reflowable format may compromise the presentation of the code listing, you will see a Click here to view code image link. Click the link to view the print-fidelity code image. To return to the previous page viewed, click the Back button on your device or app.
The Official Ubuntu Server Book
Third Edition
Kyle Rankin
Benjamin Mako Hill
Upper Saddle River, NJ Boston Indianapolis San Francisco
New York Toronto Montreal London Munich Paris Madrid
Capetown Sydney Tokyo Singapore Mexico City
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals.
The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein.
The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact:
U.S. Corporate and Government Sales
(800) 382-3419
For sales outside the United States please contact:
International Sales
Visit us on the Web: informit.com/ph
Cataloging-in-Publication Data is on file with the Library of Congress.
Copyright 2014 Canonical, Ltd.
All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, write to:
Pearson Education, Inc.
Rights and Contracts Department
501 Boylston Street, Suite 900
Boston, MA 02116
Fax: (617) 671-3447
The Introduction and .
ISBN-13: 978-0-13-301753-3
ISBN-10: 0-13-301753-2
Text printed in the United States on recycled paper at Edwards Brothers Malloy in Ann Arbor, Michigan.
First printing, July 2013
Praise for The Official Ubuntu Server Book
Murphys Law is never truer than when it comes to administering a Linux server. You can pretty much count on something happening to your machine at a time when you need it the most. Thats when a book with some basic troubleshooting instructions is worth every penny you paid for it. covers the steps you should take when something goes wrong.
Paul Ferrill, LinuxPlanet.com reviewer
College-level collections catering to Linux programmers and developers will find The Official Ubuntu Server Book, a top addition to the collection, covering a complete, free server operating system in a guide to getting going quickly. From making the most of Ubuntu Servers latest technologies to automating installs and protecting the server using Ubuntus built-in security tools, The Official Ubuntu Server Book, is packed with keys to success for any Ubuntu user.
Jim Cox, Midwest Book Review
This book will get you started on the path of the server admin, both within the context of Ubuntu server and in the larger realm of managing a server infrastructure. The desktop and server versions of Ubuntu are continuing to mature. Read this book if you want to keep up.
James Pyles, author
I dedicate this book to my wife, Joy. It is not easy to balance a full-time
job and writing a book while still having time for a family. She has
endured many a book-writing process at this point and has always been
my main source of support and motivation.
Kyle Rankin
Preface
Welcome to the third edition of The Official Ubuntu Server Book!
When most people talk about Ubuntu these days, they tend to talk about the Ubuntu Desktop. After all, its the easy-to-use, just works approach to the desktop that has made Ubuntu one of the most popular desktop Linux distributions. What has gotten less attention, although even that is starting to change, is Ubuntu Server. It turns out that desktop Linux users arent the only ones who want their distribution to just worksystem administrators appreciate that on their servers as well. In Ubuntu Server you will find all of the powerful server infrastructure from the Debian project plus that extra bit of Ubuntu polish, innovation, and focus on ease of use.
About This Book
This book is the result of the collaborative effort of not just the principal authors, but of the Ubuntu Server team itself. As it is the official, authorized book on Ubuntu Server, the focus has been on a server guide based on our collective experience. Beyond that, the goal is to have something to offer to both the beginner system administrator and the battle-hardened senior sysadmin. On the surface it might seem a tough balance to achieve, but in reality both groups ultimately want the same thing: for their servers to work. Now its true that some administrators revel in doing things the hard way. Some even treat it as a point of pride. The thing is, all of us who have administered servers for years can do and have done things the hard way as well, but ultimately you realize that theres nothing particularly impressive in doing everything by handin the end you just have too much to do and any time-saving steps are welcome.
As you will see, most of this book takes a pragmatic approach to server management. Where Ubuntu offers new programs or features to ease administration and save time, you will find them mentioned here. If you are a beginner administrator, you will find that administering an Ubuntu server isnt nearly as difficult as you might think. Experienced administrators, especially those coming from other platforms, will find numerous time-saving tips and programs, as well as where Ubuntu has updated how a service is organized (Apache being a good example); you can treat this book as a map to point you to all of the right directories.
One great thing about Ubuntu as a server is that there are so many great server packages available for it. Of course, this creates a dilemma for us as writers: Its just not possible to feature every available e-mail and IMAP/POP3 server, for instance. In these cases weve tried to pick out programs that are easy to install, configure, and use under Ubuntu, as well as highlight programs that are preferred by the authors and server team. While doing that, theres a good chance that your favorite program for X, Y, and Z was left out. Its certainly no slight against any of those programswe just had to draw the line somewhere.