Lighttpd Book Review
Packt Publishing have released the first book devoted solely to Lighttpd that I have come across. With chapters covering compiling, configuring, virtual hosting, CGI, streaming, logging, SSL, optimizing, migrating from Apache, Lua and even writing your own lighttpd modules, Andre Bogus has attempted to cover everything you will need to know. In this post, I will discuss what I think are the good and bad points about this book.
The first chapter guides the user through compiling the latest version from source, and recommends it on live servers. I think this is bad advice, and that wherever possible, you should use your distro's package manager, which will automatically deal with dependencies and provide an easy route to revert your system state. However, lighttpd 1.5.0 has some major changes on the 1.4 series, and it currently unavailable any other way. It would have been nice to have more emphasis on apt-get, yum, and other package managers.
Chapters 2 and 3 cover basic configuration, virtual hosting and CGI. It starts off simple and covers everything you need to know about the configuration syntax and slowly builds up. It is well written and not too daunting for a beginner. The introduction on regular expressions was a nice touch too. One thing to watch out for is that some distributions split their configuration into multiple files (Debian has the commands lighttpd-enable-mod and lighttpd-disable-mod, that automatically symlink config files for modules into a folder of active config files. You can save a lot of time by starting with these instead of typing everything from scratch)
Chapters 4-7 cover directory listings, downloads and streaming, geoIP, logging, tracking, SSL and user authentication. This is done mostly by short extracts of example configuration files. This works well, and the surrounding text makes it clear what's going on. Unlike some other authors, Bogus guides you through every step of making an SSL certificate.
Bogus then explains chrooting, load testing and profiling which is probably not needed by most users, but is nice for completeness, as well as covering how to migrate from Apache. This part is handy in that it shows Apache configuration examples along with their lighttpd equivalents.
Chapter 11 expands on CGI, including how to make lighttpd launch a specified number of Rails apps and respawn them if they die. This is especially useful, as documentation on this is hard to find on the internet. He also covers installation of Wordpress, trac, phpmyadmin, etc. Finally, for those looking to become lighttpd gurus, he covers Lua scripting and writing your own lighttpd modules. These were beyond the scope of what I needed, but will no doubt be helpful if you want to do advanced things with lighttpd.
Overall, the book is good and worth buying if you plan to use lighttpd for more than just serving static files. Although some parts feel like padding (such as how to install MySQL), it has plenty of examples and explanation of the most common things lighttpd is used for, as well as covering some of the lesser known but useful things that give lighttpd its edge. Armed with this book, I feel confident in migrating my Django and PHP-powered sites away from Apache.




comments