Mastering NGINX

Nginx is an http server intended for high traffic websites with a mind toward network scalability. I used NGINX as my primary web server for about 3 years. At the time, I hosted my sites on under-powered hardware that had little memory and had trouble keeping up with demand when I used Apache, but was able to keep this web site up and running the day one of my posts hit the front page of Digg (back when dinosaurs roamed the Earth and Digg was a really cool website). Back then, NGINX was still pretty new and most of the documentation was either in Russian, sporadic, or consisted of random posts on people’s blogs. It has been a couple of years since I upgraded my server to something beefier. At that time, I switched back to Apache, since I have used it for years and know it very well. That could change again, especially now that the official documentation for NGINX is much better, and because of today’s review book.

Mastering NGINX is by Dimitri Aivaliotis, a systems architect for a hosting provider and someone who uses NGINX daily. His experience shows in the quality and depth of the material. Unlike a different book on NGINX from the same publisher that I reviewed in 2010, Nginx HTTP Server, this book is well written and does not suffer from what I have come to call “The Packt Problem.” I hope this is a sign that Packt’s copy editing process has improved and that there is now a stronger commitment to offer titles that are worthy of being read because of the quality of the writing as well as the quality and uniqueness of the technical content.

Mastering NGINX is intended for experienced systems administrators and systems engineers, people who are familiar with using and administering *nix machines and configuring servers. This is not a beginner book. For me, that is a plus. It allows the author to get right down to business with NGINX.

We start with a short and typical installation chapter, complete with a discussion of modules that includes third-party modules and their benefits and risks. Installing using the package managers of several types of Linux distributions is covered along with compiling from source and the various flags and configure options available.

The next chapter jumps right in to the good stuff. Most of the NGINX materials I once used tell you what to change, but not why to change it. For a long time I was left wondering how to tell when to use specific configuration options, which files to find them in, and what the parameters are that I can use. The goal of this book is not to tell you what to do, but to describe these very things, so that in the end, you should be able to find and open an NGINX configuration file and edit it to fit your situation. Well done.

I was a little concerned when I realized that I was nearing the end of the chapter and still had some questions in my mind about some of the parameters and settings. Then I read this on page 40 in the chapter summary:

What we did not cover in this chapter are the configuration options provided by the various modules that may be compiled into your nginx binary. These additional directives will be touched upon through the book, as that particular module is used to solve a problem. Also absent was an explanation of the variables that NGINX makes available for its configuration. These too will be discussed later in this book. This chapter’s focus was on the basics of configuring NGINX.

Bravo! The author was thinking ahead, anticipated my concerns, and addressed them immediately at the point I had them.

The rest of the book gives deeper, more detailed information about specific uses for NGINX. Topics covered include using NGINX for serving mail, reverse proxying, setting up security, HTTP serving, including setting up your server for use with PHP (which is much easier now than when I wrote this outdated post), caching, tracking, and various sorts of troubleshooting. I was thrilled to see the appendices, especially the rewrite rule guide, as when I tried to do rewrites, I couldn’t find any good information (see my now-long-outdated post on the topic.

I was pleased to see how complete and clear the book is. Kudos to the author, the reviewers and editors, and the publisher. I recommend this book to anyone who uses NGINX or wants to do so.

Disclosure: I was given my copy of this book by the publisher as a review copy.

Ubuntu on a Mac

With every copy of Ubuntu Unleashed 2013 Edition we include a DVD of Ubuntu 12.10. This is similar to what we have done with past editions. The contents of the DVD are identical to and taken from the main Ubuntu download page. In the past, this disc has been sufficient to boot live or install on either a Windows machine or a Mac. However, this time around, anyone putting the disc in a Mac will find that the machine will not boot from the disc.

Bummer. We didn’t discover this until after the book was printed, the DVDs were created and attached, and the book shipped. When I read through the install documentation for Ubuntu while doing the editing for the new edition of the book, I failed to see any note of there being a problem. In fact, as I looked today (20 December 2012), there is still no note of any special needs when using Apple Mac hardware on http://www.ubuntu.com/download/desktop or in the install instructions at http://www.ubuntu.com/download/help/install-desktop-latest.

I have found that there is a different install DVD image available for 64 bit Mac that anyone can download from http://releases.ubuntu.com/quantal/, but this is not mentioned anywhere else that I can find and is not available from the main download page. I found it by searching Google and discovering the problem is common and that a new iso was created to circumvent a Mac-specific issue (details below on the actual issue).

If you bought my book and own Mac hardware, I apologize for the inconvenience. The DVD attached to the book will not boot on your machine, but you can download the Mac image mentioned just above and it should work.

For those interested in the technical details of the problem, here is a high-level description.

In past years, computers used a BIOS, or Basic Input/Output System, to load some software necessary for the hardware to then read and load an operating system. The industry has been moving to the UEFI, or Unified Extensible Firmware Interface, which serves a similar purpose to a BIOS but communicates differently and with greater flexibility. Most UEFI software includes legacy support for BIOS services to ensure compatibility across a wide range of hardware. Linux supports UEFI, and as a result, so does Ubuntu.

Because the version of UEFI that is included with Mac hardware only has to support a very limited range of hardware, it does not include that BIOS legacy support (and perhaps other support). This means that Mac hardware using UEFI can not read the files from the disc that are needed to boot Ubuntu. This is a direct result of Apple making a decision to use only the parts of the UEFI standard that support their Apple hardware. While it is not my preference as a geek and tinkerer, it is a reasonable business decision as Apple seems to prefer to control the entire user experience so that everything will “just work” for their users. The downside is that it becomes difficult to use any hardware or software they do not produce or directly sanction. Booting any operating system that is not OS X on Mac hardware is a use case that Apple does not support, so it doesn’t work easily. The workaround is to download the Ubuntu-community-provided modified DVD image linked above and use it as it has received some modifications that enable the version of UEFI on this Mac hardware to recognize the DVD and allow Ubuntu to boot.

VMware Cookbook, second edition

VMware Cookbook

Just released.

I had the privilege to work with Ryan Troy for both the original and for this second edition of
VMware Cookbook
. With scores of step-by-step solutions, this cookbook helps you work with VMware ESXi in a wide range of network environments. You’ll not only learn the basics—how to pool resources from hardware servers, computer clusters, networks, and storage, and then distribute them among virtual machines—but also how to overcome the stumbling blocks you’ll encounter when you monitor systems, troubleshoot problems, and deal with security.

This expanded second edition covers recent advances in vCloud Director and vShield cloud security. Ideal for system administrators of any level, VMware Cookbook also includes valuable information to help you determine your virtualization needs.

ISBN-13: 978-1449314477

The Official Ubuntu Book, sixth edition

I had the privilege to lead the team that updated The Official Ubuntu Book for this sixth edition. The book continues to serve as a quality introduction for newcomers to Ubuntu, both the software and the community that surrounds it.

ISBN-13: 978-0132748506

Link to the Amazon.com page for the book.