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. LAMP? I used it on my FreeBSD box by andy+braaten · · Score: 5, Insightful
    Linux, linux, linux, oh how I hate that buzzword.

    Not counting the installation instructions, this book applies to any Unix machine. The authors did cover configuration in just the right amount of depth, which applies everywhere, but were brief about the installation, which is actually a good thing. I got this book for new web developers at our company. We have about 50 FreeBSD servers in our server farm that do all the web stuff, and other than the install notes in this book, every byte was applicable to us as well.

    My only objection? Having a title that implies that only Linux can do this.

  2. I don't know... by kafka93 · · Score: 5, Insightful
    "goal: to teach you enough about all the LAMP (Linux, Apache, Perl/Mod_Perl/PHP) technologies "
    .. you'd think that if the book was so good it would've left the reviewer with the knowledge that LAMP stands for "Linux Apache MySQL Perl". But there we go.
  3. Great read for the powers that be by drgroove · · Score: 2, Insightful

    Looks like it would be a great book to use for the purpose of informing corporate managers how an open-source web architecture would function, and what its advantages are over closed source. It ties together each of the disparate aspects of the necessary open source techonologies in a way that even a manager could understand & appreciate. Would be useful as a tool for convincing management to move from a propretary closed system (ie, Windows, IIS, ASP, MSSQL || Solaris, iPlanet, JSP, Oracle || Windows, CFMX, CFML, xSQL) to LAMP.

  4. Re:LAMP? I used it on my FreeBSD box by Ed+Avis · · Score: 2, Insightful

    Wouldn't most of the book apply to Apache on any platform? (In particular, Apache on Windows, provided mod_perl has been ported to Windows.) So perhaps it was not necessary to mention the operating system at all.

    Instructions about 'how to build the Apache source code' are OS-specific, but it probably makes more sense to write a book assuming that Apache is already installed, since the procedure for installing it varies so much (rpm/deb/binary tgz/build-from-source/GNU stow/Windows installer/etc).

    --
    -- Ed Avis ed@membled.com
  5. Books like these lead to bad code by esconsult1 · · Score: 3, Insightful
    Sure, you'll be able to learn how to use the underlying technologies to create web programs, but what about teaching people how to create proper web programs in the first place. Budding web developers need to learn about practices such as:

    • Scalability
    • Caching
    • Database Independent Libraries
    • User Authentication methodologies
    • Connection Pooling
    • Code/HTML Separation: Templates
    • Modular programming & Libraries
    • Web security techniques
    • Sessions and cookies

    All the above items are technology neutral, and applicable, whether you are a Micro$oft or Open Source programmer, or a Java junkie.

    IMHO, because of the lack of such books, we have truly terrible web coding practices out there right now. Instead of such books, we have the latest "LAMP Book Of The Week". The LAMP books are ok, but due to the web development practices presented in 97% of them, I cannot recommend to friends and colleagues.

    If there is such a book out there, then let me know, because I have not seen one.

    1. Re:Books like these lead to bad code by bware · · Score: 2, Insightful


      I don't disagree with you, but recognize that any book that isn't to be lifted with a forklift has to make choices. Your book would have had different subject matter than the one we chose to write.

      We discussed addressing at least some of these, but the book is already 460 pages, and we felt that these were out of the scope for the audience we chose.

      We talk about web security where ever possible, but again, it's a big subject and one that deserves its own study once the student is ready. We try to point out where one should worry about it (hint - most of the time).

      Budding web developers should also learn about good web design practices, and I had some good rants about that, which were lost on the cutting room floor.

  6. Postgres reality check by ze_lee · · Score: 4, Insightful

    I personally am not fond of mySQL - though it's very easy to set up and maintain. Come on, a database with no subselects? (Never mind the other missing pieces, like no stored procs).

    The reality is that mySQL has the larger installed base, so it it probably the best way to ease into dynamic development.

    Also, what hosts even support Postgres? I run it at home, I've run it at work - on the companies' dedicated servers - but I don't know if there is a host out there that supports it. Which is too bad.