Open Source Web Development With LAMP
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.
- Chapter 6: 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.
- Chapter 7: CGI
- 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.
- Chapter 9: Server Side Includes
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.
Is this the case for Open Source Web Development with LAMP? Since James Lee is an author on both, I'd think that'd be the case, but I don't see anything meantioned on the OSWB Book Purchasing Page.
So, with those disclaimers out of the way, here is my review of OSWB.
Open Source Development with LAMP is the perfect book to learn a wide variety of server technologies that will have you writing useful, clean, fast, and productive websites before you finish reading it.
I was one of the technical editors of this book, and was able to watch it evolve as they wrote. The authors have made a huge effort to make the book appropriate for multiple Linux distributions, and they have achieved the highest degree of technical accuracy.
OSWB covers many different technologies, some complementary, some discreet. By showing you many of the possible tools, this book lets you decide which is best for the job at hand.
The theory behind OSWB is that knowledge of 20% of a tool's capabilities will let you accomplish 80% of the tasks you face. OSWB does a superb job of giving the user a sizable introduction to webserver technologies that will be sufficient for most rojects, and tells you where you can get information for advanced needs. They have written their entire website with the exact same tools they teach you in the book, and they offer the entire source of their website for download for your investigation and reference, as well as all the samples and projects in the book itself.
The gold in this book is not just the descriptions of how the languages work, but how you can use them singly or together to create interactive websites. Their are many sample projects which let you see how everything fits together, and much of the ode can be adapted immediately to your needs. The book is extremely well integrated and organized.
I have used some of the languages described in this book, while others were completely new to me. I am definitely not a web design person, preferring to write back-end server software. However while reading OSWB, I was charged with creating a MySQL database with a customizable web interface for my alumni organization. Using only this book and a few perldoc commands, I was able to create an interactive mod_perl website in a few days.
This book offers something to everyone, even advanced web designers. If you are starting out in Web technologies, or are curious about other ways you can get the job done, this is the book for you.
Yes, the Amazon and B&N links that are on OSWB uses the same HTML as the Hacking Linux Exposed books page (and the Building Linux VPNs books page too, since you're asking.)
So by all means, go out and buy bunches of copies of Open Source Web Development with LAMP and help the Electronic Frontier Foundation at the same time. Or, if you don't like to buy online, go to your favorite book store and buy it there, and send any money you saved on shipping to the EFF yourself.
Like I'm going to trust a review about a LAMP book from someone that doesn't even know what LAMP means. Linux, Apache, MySQL, PHP or Perl or Python.
"Karma can only be portioned out by the cosmos." -Homer Simpson
LAMP is good, but JOLA seems to be the best mix of technologies for the corporate environment. Java is a mature programming environment already being blessed by many F500 companies. Oracle is more trusted than mySQL and Postgres. Like Java, Oracle has a proven track record and probably already has an install base at most F500 companies. Linux...this is a GREAT way to get an Open Source platform in the door. Apache, the same way. With RedHat and Oracle being G. certified...this seems to be a no brainer. The fact that Oracle has Java and Apache support, built-in, is only a HUGE plus!
If F500 companies are going to use open source, it will have to be done slowly and carefully. You and I both know that LAMP will probably do the job. My job, as an IT consultant is NOT to convince others like me that this will work. No, my job is convince some monkey-assed MBA who is more worried about SAP and the bottom line than Linux, Open Source, GNU, or any other HOT technologies.
Lessen the risk by introducing Open Source slowly. Once the Linux platform is in place, then the door becomes open.
Think JOLA over LAMP for the corporate environment!
This is not an O'Reilly book!
Thanks for buying the book!
We didn't mean to imply that only Linux could do this stuff, but you have to admit that LAMP is a better acronym than UAMP (Unix), BAMP (BSD), BLAMP (BSD/Linux), G/LAMP (GNU/Linux), MAMP (Mac OS X) or some combinatorial subset thereof. We say in the intro that most of the book is suitable not only for Linux, but most *nix-based machines.
But hey, LAMP is good marketing, and I didn't want to spend a year working on a book called BLAMP.
For the 3.x which don't support any subselects whatsoever, they do have example that shows how you can often avoid a subselect by careful use of LEFT JOIN, but often the answer is "use a temporary table" or "post-process it in your application to generate the subsequent queries." I agree, lack of subselects are a show stopper for many complex apps. But for many uses, subselects aren't terribly necessary. Your simple e-commerce app will just be reading the items' price, pictures, description, and sticking customer orders into a different table - nothing terribly taxing.
As to the disbelief that I did well on the interview, I'm still happily and gainfully employed with a very large e-commerce firm developing for their main page, not some backwater thing. My years as a sysadmin were very helpful in getting the position, actualy.
I've got a copy of this LAMP book, as well as three other books they suggested, here on my desk. When I have a problem, I usually turn to the LAMP book first, and sometimes to the more detailed language specific ones when there's a piece that isn't covered in the LAMP book because it's too detailed.