Slashdot Mirror


Open Source Web Development With LAMP

Alan Eibner submitted this review of Addison-Wesley's Open Source Web Development With LAMP. He writes "The number of books about Web development technologies is astounding. Some claim you can learn everything you need to know in 24 hours. Others require several complementary volumes in order to learn the subject. Why another web development book? And what sets this one apart from the rest?" Read on for the rest of Alan's chapter-by-chapter review. Update: 04/11 18:22 GMT by T : I'd called this an O'Reilly book rather than Addison-Wesley; sorry, now fixed. Open Source Web Development with LAMP author James Lee, Brent Ware pages 496 publisher Addison-Wesley rating 10 reviewer Alan Eibner ISBN 020177061X summary All the Open Source web technologies in one easy to read place.

Open Source Web Development with LAMP (henceforth OSWB) has a difficult goal: to teach you enough about all the LAMP (Linux, Apache, MySQL, Perl/Mod_Perl/PHP) technologies that you can start developing static and dynamic websites right away. How on earth can they cover so much in one ~500 page book, you ask?

The Theory The authors do not intend to teach every little bit about the web technologies they cover. No book binding is that strong, but the reason is more subtle than that. When you try to cover everything, you lose perspective about the pros and cons of the technologies.

Instead, the authors try to teach you enough about the technologies to hit the road running, and provide you pointers to websites, man pages, and other books where you can learn the pieces they don't cover. I think the authors' words themselves describe it best -- quoting from the Introduction:

"Based on experience, we believe that 80 percent of the utility of any complicated tool is the result of knowing 20 percent of the uses of that tool, whether that tool be software, hardware, mechanical, or electronic. Swiss Army knives are excellent and versatile tools, but most of the time, you just use the blade or the screwdriver.

The purpose of this book is to introduce you to that 20 percent -- the blade and the screwdriver -- that opens up the most functionality, and to make you aware of the remaining 80 percent so you can use the other tools when most appropriate."

This is the goal of the book -- a goal that I believe they fulfilled superbly.

The Authors James Lee is the lead author of OSWB. He's a Perl and Open Source trainer, programmer, hacker and who-knows-what-else at Onsight, Inc.. He's also co-author of Hacking Linux Exposed first and second editions. (./ review of HLE 2nd edition)

Brent Ware, co-author of OSWB, has a PhD in Physics, has done the Dot Com thing, failed to get independently wealthy, and now gets paid to play with lasers, but would rather be climbing mountains. He was also a contributing author to Hacking Linux Exposed.

(Descriptions are based on their Bios, intuition, and unsubstantiated rumors.)

The Book

  • Part I: Structural

    • Chapter 1: The Web Explained
    • Chapter 2: Linux - the Choice of a GNU generation

      These two chapters are mainly here for folks new to Web development in a Linux/Non-Microsoft environment. They do a superb job of explaining why LAMP is a good solution for both technology and monetary reasons. A great read, especially for your manager who keeps asking why you shouldn't use some proprietary development tools. It also shows you what HTTP actually looks like, and the difference between static HTML, dynamic websites, and embedded web programming languages.

    • Chapter 3: Apache Webserver

      Next they provide information about configuring Apache, creating password-restricted access, and other security considerations. At about 20 pages, this is fast and concise, but contains all you really need to know when setting up your Apache server.

    • Chapter 4: Perl

      Following the 20/80 rule, the authors manage to teach you the Perl you'll need to know in order to generate web content. They don't go into things like creating network sockets, shared memory, or the Foo::Bar::Never::Necessary module. What you do get is all the I/O, flow control, datatypes, regexps, system access, scoping, best practices (use strict, etc), and enough OO to use modules that require it. (Database access via DBI is covered later, don't worry.)

    • Chapter 5: MySQL

      Here they teach you to install MySQL databases, tables, and enough SQL to do what you need to do. The examples are excellent and frequently amusing. This is also where the book starts to really begin its integration of multiple technologies. We'll be referring back here later when we start programming web front-ends to MySQL databases.

  • Part II: Static

    • Chapter 6: WML

      For those that don't know, WML is the Website Meta Language. WML allows you to create static HTML files using a very powerful suite of pre-processing, macros, eperl, and HTML shortcuts. By creating site templates, WML can manage all your links and layout, leaving you to concentrate on the content of each page. OSWB is the only book I know of that discusses WML.

  • Part III: Dynamic

    • Chapter 7: CGI

      First, the authors discuss how dynamic HTTP actually works -- GET/POST requests, variable passing, types of fields, and security implications. This will be important for all the remaining chapters of the book. The chapter then continues with a focus on perl and CGI.pm for CGI development, including a fully functional CGI/MySQL/DBI project.

    • Chapter 8: mod_perl

      For those who want to get more performance out of dynamic perl-created content, mod_perl is the answer. The authors explain the ways you can create mod_perl code, the differences between this and the CGI.pm environment, and then continue with a mod_perl MySQL/DBI project. This chapter is worth the cost of the book alone.

  • Part IV: Embedded Languages

    • Chapter 9: Server Side Includes

      I think most people agree that SSI is pretty much dead, when compared to the more functional languages we have nowadays. The authors give a very complete synopsis in about 10 pages.

    • Chapter 10: Embperl
    • Chapter 11: Mason
    • Chapter 11: PHP

      If you want to use an embedded language (where the code is inside the HTML files themselves) then you're much more likely to use one of these three languages. I'd never heard of Embperl or Mason before, but they seem to be an excellent middle ground between CGI and mod_perl. They both are explained extremely well. Since they are based on Perl, much of the background was already covered in Chapter 4, so the authors concentrate on the important features, rather than the language constructs.

      PHP is, of course, completely different than Perl, and thus Chapter 11 needs to teach everything from the constructs and datatypes up to database integration. Yet somehow it manages to do so with ease. It also concludes with a database-driven project ripe for you to modify for your own needs.

Short notes

Some short comments that didn't seem to fit anywhere else in this review:

  • Distro: OSWB does assume a Red Hat installation for its example configurations, but does a good job of remaining distro-agnostic aside from pathnames, and letting you know the differences you're likely to face.

  • Humor: Lee and Ware are funny - reading this book is really enjoyable because they are constantly weaving humor into it.

  • Security: Security is discussed whenever appropriate in the book, which is not a surprise, given the authors' association with Hacking Linux Exposed.

  • Omissions: The "What We Didn't Talk About" section is excellent. Most books deny what they haven't covered. OSWB tells you exactly what they haven't taught you, and point you to the places you can get more information if you need it.

  • Projects: The book has many projects that let you learn and experiment with the languages directly. Each one could serve as a branching-off point for your own website's needs.

  • Integration: Since OSWB covers all the technologies, you don't have constant overlap or redundancies; that lets it stay lean and tight. For example WML allows you to include perl code, but since you already learned perl in Chapter 4 the authors don't need to start from the ground up. However, they do keep introducing us to new and neat features in all their subsequent code examples.

The Website

The OSWB website at OpenSourceWebBook.com is written in the languages they discuss, and all the original source code used to build the website and the rest of the code in the book is available for download. Snippets of the code for the website is shown as examples with commentary in the book, letting you really see how everything fits together. These guys fall squarely into the practice-what-you-preach category.

The Verdict By not trying to teach every nuance and advanced feature of each of these languages and technologies fully, you actually have a much better book. At the end you have an excellent understanding of what tools are out there, and can best choose the ones you should use for a given purpose. I came away from this book and immediately used a combination of WML templates + mod_perl + MySQL to create a very robust dynamic web application using only the info in the book and a few choice man pages.

I'd recommend this book both to nitty-gritty web developers, and also to non-techies who want to be able to understand the technologies that are out there, to help create informed decisions when starting any web development project.

You can purchase Open Source Web Development With LAMP from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

7 of 104 comments (clear)

  1. Great Book by Squid+Monkey · · Score: 5, Interesting
    I was applying for a web development position. I'd had CGI under my belt for ages (I still have a copy of the original NCSA web server running on one of my machines for grins) but never really got into the other languages and way of writing dynamic code. When I lost my job as a sys admin, I wasn't able to find any "honest" work in that field, so I thought I might need to fall back on my historic web development skills.

    In the store one day I was looking for a good book to get me up to speed on all the languages I'd been thumbing my nose at all this time. I came across OSWD w/LAMP, and flipping through it could tell it was just what I needed. When I noticed that it was by one of the guys who wrote Hacking Linux Exposed I knew that not only would it be useful in helping me do dynamic websites, but it would contain the security pointers I'd need to be able to do so in a secure manner.

    Ironically, the day I bought it, a company scheduled an interview for me for a web development position the following day. So I read the entire book, cover to cover, in one night without the chance to actually try out the code. Nonetheless, I learned so much just from reading it without even typing a line of code that I totally smoked the interview. The interview was very technical, asking differences between the languages and pros/cons, as well as having me write code off the top of my head to do things in the different languages.

    I can't recommend this book enough.

  2. Excellent Review by TheFlyingGoat · · Score: 3, Interesting

    This is one of the better book reviews I've read on Slashdot. Kudos to Alan Eibner for putting together a clear, concise, and complete article. Note to future book reviewers: don't list the chapters and a summary of the book... try breaking down each chapter, and then the book as a whole. It seems to come out much better. :)

    --
    You have enemies? Good. That means you've stood up for something, sometime in your life. --Winston Churchill
  3. Re:I don't know... by Alan+Eibner · · Score: 4, Interesting
    Aaaaaaaahhhhhhhhhhh!

    I worked long and hard on this review, and I make a totally stupid mistake like that? Crap.

    Hey timothy - care to fix my review?

    (Words fall on deaf ears...)

    Great, I'm going to look like an idiot in slashdot archives for all time. Yes, of course they cover MySQL - the entire second half of the book has project after project that uses it.

  4. Free Alternatives by Vilk · · Score: 5, Interesting

    Even as a professional web developer I cannot help but feel that books like these are, useful as they may be, totally redundant and devourers of perfectly good shelf space. The intricacies of setting up, maintaining, and administering a Linux webserver are numerous enough to warrant their own book and I suspect that one would be better suited buying a text on that particular topic and sticking to online resources for the others.

    The Internet is teeming with websites full of introductory material such as this. I'm almost positive that to establish a respected computing site you are required to have an Apache and/or mod_perl tutorial; these are so unnervingly common that one would think the entire world is stuck in a cycle of endlessly installing Apache. It's a great credit to the creators that it is so easy to install and administrate that the entire process of setting up a production-ready server can be covered in a few poorly-written online tutorials. Why buy a book if your needs can be satisfied by a quick Google search?

    I'll admit that the subjects of Apache and Linux administration may be too complex without a handy book, but PHP and perl? PHP's online manual is absolutely superb. No matter the size of the project or its complexity, if I have a question it will most assuredly be answered by a quick rifle through the documentation. And perl? PerlMonks is all you need. The monastery blows my mind.

    I'll be the first to recommend books on operating system design, theory, and microprocessor internals, and in fact my shelves are lined with them. It is, however, the unfortunate truth that introductory material is everywhere on the Internet but getting any deeper will require a speciality textbook; that is, of course, and not very ironically, unless you're a web developer. For the shallow depths that this book plumbs, I'd recommend saving the money for a guide to webserver administration and taking a visit to http://www.php.net and http://www.perlmonks.org.

    --
    Vilk, from the ranks of the freaks
    1. Re:Free Alternatives by bware · · Score: 2, Interesting

      We wouldn't disagree with you on most of this. In fact, we spend a fair portion of the intro discussing online resources, and many if not most of our references are to online resources. I'm pretty sure that the two websites you mention are referenced in the book in appropriate places. We even say that Google and Google News are your best friends.

      That said, lots of those online resources are out of date, poorly maintained, contradictory, and even if they weren't, how is a person new to the game supposed to figure out which ones to use and which ones to ignore, and even whether they should be using Perl or mod_perl or Embperl or CGI?

      (I realize that any printed book will be out of date soon also, but at least it will be out of date in consistent ways.)

      The purpose of the book was to put all those things together in one place, be consistent, show the differences and similarities, so that someone new to doing this could make intelligent choices.

      We'd have been just as happy to not have to write Linux and Apache sections either, but those seemed necessary both from completeness, consistency, and security aspects.

      This is probably not a necessary book for you as a professional web designer, but imagine someone just starting. We hope at least that it is useful to that person. And maybe even to you, if you had to take one book to a desert island to set up www.desertisland.com.

    2. Re:Free Alternatives by Vilk · · Score: 2, Interesting

      Online resources truly can be horrendous and antiquated, especially considering that the open source movement chugs along at a good clip compared to commercial products. All things considered, however, PHP.net is still the best and most up to date resource for PHP and PerlMonks.org moves just as quickly and is chock-full of innovation and brilliant code.

      I'm honestly not trying to detract from the product of your efforts; you and the reviewer both clearly tout this book as a wide introduction to web development with an emphasis on exposing the reader to different approaches and within that context it looks like it is very successful. My major gripe is with books on web development in general, though I certainly cannot hold you personally responsible. (And I won't rule out the possibility that, speaking as a grizzled web developer, I can't appreciate this book and what it teaches.)

      Of course, it all boils down to the fact that reviewers and critics may have differing opinions but they're meaningless if you find that the book personally works for you.

      Kudos on getting published.

      --
      Vilk, from the ranks of the freaks
  5. Re:LAMP? I used it on my FreeBSD box by tmark · · Score: 2, Interesting

    I don't believe for one second the emphasis was on Linux because it made for a better acronym. Why not go with "AMP" ? Sticking "Linux" on the cover just helps the publishers capitalize on the Linux buzz, which makes me immediately wary of the book.