Open Source Web Development With LAMP 104
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.
- 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.
Donation to the EFF for this one too? (Score:5, Informative)
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 [opensourcewebbook.com].
Yes, EFF donations for OSWB as well. (Score:5, Informative)
Yes, the Amazon and B&N links that are on OSWB [opensourcewebbook.com] uses the same HTML as the Hacking Linux Exposed [hackinglinuxexposed.com] books page (and the Building Linux VPNs [buildinglinuxvpns.net] 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.
Re:MySQL Free? (Score:1)
Great Book (Score:5, Interesting)
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.
Re:Great Book (Score:2, Informative)
Re:Great Book (Score:2)
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 t
LAMP? I used it on my FreeBSD box (Score:5, Insightful)
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.
Re:LAMP? I used it on my FreeBSD box (Score:1)
This is redundant, I grant you.
Re:LAMP? I used it on my FreeBSD box (Score:1)
Re:LAMP? I used it on my FreeBSD box (Score:2, Funny)
Dom
Re:LAMP? I used it on my FreeBSD box (Score:1)
Yeah, but, Linux is the only OS that can do LAMP. Now, maybe the trinity of open-sourced BSDs (Open, Free, Net) could do BAMP instead. But, that would be a completely different book, Open Source Development Using BAMP.
My only complant is not enough BSD books out there.
Re:LAMP? I used it on my FreeBSD box (Score:2)
(removing tongue from cheek...)
-diggem
Re:LAMP? I used it on my FreeBSD box (Score:1)
Whose?
Re:LAMP? I used it on my FreeBSD box (Score:3, Informative)
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.
Re:LAMP? I used it on my FreeBSD box (Score:3, Insightful)
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).
Re:LAMP? I used it on my FreeBSD box (Score:1)
I believe this to be largely true, but haven't really kept up with what's available on other non-*nix platforms (cough - Windows), so didn't want to talk out of school.
Re:LAMP? I used it on my FreeBSD box (Score:3, Interesting)
Re:Linux + Apache + MySQL + Perl (Score:1, Flamebait)
Php can be cached aswell... (Score:1)
You need to check out the php caches and accelerators to see what php is capable of.
eg: The ionCube PHP Accelerator [php-accelerator.co.uk]
Re:Php can be cached aswell... (Score:1)
Plus a half serious LAMPist knows when to generate a truly dynamic page and when to generate a page in batch from a cron job. (hint: if it doesn't contain user-related information, it's usually a good cron job candidate.)
And of course, she will know as well when to artfully mix both in a seamlessly integrated user experience. or something.
Excellent Review (Score:4, Interesting)
More fun with acronyms (Score:4, Funny)
SOFA (Suite of Free Applications)
LEATHER (Linux Expressions Applications That Have Extensible Results)
CHAIR (Combined HURD Apache Interface Regexp)
Re:More fun with acronyms (Score:2, Funny)
Re:More fun with acronyms (Score:2)
FAPP (FreeBSD, Apache, PostgreSQL, Perl)
Re:More fun with acronyms (Score:1)
Required reading for any web designer (Score:5, Informative)
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.
I don't know... (Score:5, Insightful)
Re:I don't know... (Score:4, Interesting)
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.
Agreed... (Score:3, Informative)
Re:Agreed... (Score:1)
According to Gurunet, LAMP stands for:
Re:I don't know... (Score:1)
What’s to learn? (Score:1, Funny)
Clap on clap off. How long can that take to learn?
I do find that LAMP is a benefit when reading dead tree reference material, but backlighting issues sometimes cause the need to disable LAMP, relying only on the ambient from the monitor.
Re:different topic for a book (Score:1)
Not rpm-installable option? Wrong! (Score:1)
It is definitely available.
Postgres reality check (Score:4, Insightful)
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.
Re:Postgres reality check (Score:2, Informative)
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 a
Re:Postgres reality check (Score:1)
However, the work-arounds you mention (temp table etc) are just that. Work arounds. And the final release is still about eight months down the road.
And there are still no stored procs or foreign-key support. Those are show-stoppers for any highly transactional site.
But mySQL IS getting better. Which is good.
Great read for the powers that be (Score:2, Insightful)
Free Alternatives (Score:5, Interesting)
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 [php.net] and http://www.perlmonks.org [perlmonks.org].
Re:Free Alternatives (Score:1)
Other times, I use real resources to find things because I have a lot of context already going on in the computer and I don't want to futhur complicate what I see.
I'm highly interested in this book because I've been meaning to get into Linux based web development for a while but had no firm starting point. I get Linux installed, and then it just sits there. At work, I cur
Re:Free Alternatives (Score:1)
Yuck. Oracle's drivers (you need them to use Oracle-specific features, such as accessing large objects through OLE-DB) are piss-poor. If you're using the MS drivers or plain ODBC you should be fine, but if you require Oracle 8-specific features on NT using Oracle's client, I can only give you my best words. I've downed mor
Re:Free Alternatives (Score:1)
R-AM
A-busing
C-orrupt
L-ame
E-xecut
Is it a coincidence ? I think not
Even my supervisor at www.inet.com called
this Or-suckle when I worked there
Peace...
Ex-MislTech
Re:Free Alternatives (Score:1)
Oracle's ODBC driver is pretty good. It supports "LEFT JOIN" and "RIGHT JOIN" all you have to do is "FROM { oj tbl1 INNER JOIN tlb2 ON tbl1.fld1 = tlb2.fld1 } " and it is all good there.
Now, you use Microsoft ADO and use a loop with fld.GetChunk(128) and that is good. (Either keep a field to tell you how big it is or do special checks to see when you are done.)
Finally, make sure all your LOB fields are the LAST fields selected in
Re:Free Alternatives (Score:2, Interesting)
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
Re:Free Alternatives (Score:2, Interesting)
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 develo
Have to start somewhere (Score:1)
HOWEVER, there is merit to having a book, as opposed to online documentation. Yes, php.net rocks. It's open in another window on my screen right now - often is.
But this is a newbie/best practices book, and that is hard to get fro
who needs a LAMP? (Score:4, Funny)
Re:who needs a LAMP? (Score:1)
which brand was that ? (Score:3, Funny)
Phoenix, Award, or AMI ?
What I can't figure out ... (Score:1)
is what the 'B' stands for.
Re:What I can't figure out ... (Score:1)
This just in... (Score:2, Funny)
"No LAMPs have been looted from government offices [person seen running through streets in background with LAMP]. It is all lies! Evrything is okay!"
More at 11.
JOLA - For Coprorate (Score:2, Informative)
O'Reilly???? (Score:2, Informative)
It's not O'Reilly (Score:2)
No animal. No hand-tools. Must not be ORA.
SSIs Dead? (Score:1)
I am in charge of all the web development for a medium-sized parachurch organization, the Willow Creek Association [willowcreek.com]. I come from a hand-coded HTML background; I do most of my page edits/development in Visual InterDev. We run NT 4.0/IIS 4/ASP 3.0 on our web server.
I have relied heavily on SSIs to include header, footer, and sidebar on our web pages. I have been hearing for over a year now t
Re:SSIs Dead? No - use WML (Score:1)
That's where WML works - you can still keep all your window dressing in one place, you still include it automatically from your new docs, so no copy/paste problems or big hassles when you want to change the enti
Re:SSIs Dead? No - use WML (Score:1)
Re:SSIs Dead? No - use WML (Score:1)
Re:SSIs Dead? No - use WML (Score:1)
Re:SSIs Dead? (Score:1)
The tool I use for this is Dreamweaver, from Macromedia. It gives you a WYSIWIG view of your web pages and lets you define templates, "library items", and so on. When you change a library item or template, it updates every affected page:
Pros:
Re:How do I get a signed copy? (Score:2)
Luckily, James and Brent replaced my attempts at humour with stuff that was funny.
Books like these lead to bad code (Score:4, Insightful)
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.
Re:Books like these lead to bad code (Score:2)
For the person who doesn't even know how to make a DB connection, teaching connection pooling is going to be a failure. They need to be able to build their own "Hello World"s so that they can get a basic understanding of what the pieces are, and what they do, and how to manipulate them.
Once they know the basics of building a dynamic site, THEN they can move on to performance enhancements
this book title is confusing (Score:2)
As for LAMP, I support only first letter, L (Linux), while the rest three are for web
Actually, they do cover these issues. (Score:2)
The whole goal of this book was to explain how to do things the right way. Unlike most other LAMP books, they do
Re:Actually, they do cover these issues. Really? (Score:1)
By this you mean that mod_perl (OUCH!!!)/cgi (OUCH!!!)/persistent database connections (OUCH!!!) are "doing things the right way"?
Well, if you're implying that then I agree that the title of the book is way off - it should be "developing web pages for dummies" instead.
# Scalability
cgi - no way
perl - probaly not, prove me wrong
persistent database connections - hmm, a though one - depends entirely on impleme
Re:Books like these lead to bad code (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
LAMP and what it really means (Score:2)
And no, that's *not* Perl.
I wonder who got that idea at first.
What just one skinny chapter on PHP...???? (Score:2)