Mac OS X in a Nutshell (In a Nutshell (O'Reilly))
|
| List Price: | £24.95 |
| Price: | £22.46 & eligible for FREE Super Saver Delivery on orders over £5. Details |
Availability: Temporarily out of stock. Order now and we'll deliver when available. We'll e-mail you with an estimated delivery date as soon as we have more information. Your credit card will not be charged until we ship the item.
Dispatched from and sold by Amazon.co.uk
Product Description
Mac OS X has the ability to run the 18,000 existing Mac programs and an unlimited supply of Unix and Open Source software. This text offers all audiences - both long time Mac users and converts - a complete guide to operating system from its BSD Unix foundation to Aqua, the new user interface. The book's "Unix Command Reference" is a complete and thorough coverage of Mac OS X Unix commands. Each command and option in this section has been painstakingly tested and checked against Jaguar - even the manpages that ship with the system can't compete in accuracy. The reference incorporates the new command-line tools that come with Apple's Developer tools. It familiarizes readers with the Finder and the Dock, file management, system configuration, network administration issues, and more. Later chapters include bonus material for the Unix user, including advanced use of the Terminal and how to configure a DAMP (Darwin, Apache, MySQL, Perl/PHP) Web publishing system. Other topics covered in the book include: filesystem overview; running Java applications; system and Network Administration; directory services and netinfo; scripting on Mac OS X; using CVS; Unix Command Reference; and installing and running X Windows and BSD Unix applications. The book follows the common-sense O'Reilly approach, aiming to cut through the hype and give readers practical details they can use every day. Serious users who want more from their system should find everything they need to know systematically documented in the book.
Product Details
- Amazon Sales Rank: #1133081 in Books
- Published on: 2003-02-07
- Original language: English
- Number of items: 1
- Binding: Paperback
- 768 pages
Editorial Reviews
Review
"This is a handy guide to turning the Mac into a web server platform. Computer Shopper, July (5 stars)
About the Author
Jason McIntosh is a freelance writer and programmer living in Cambridge, Massachusetts. He is the coauthor of Perl & XML. Chuck Toporek cut his teeth on a Mac II system when he got his first job in publishing in 1988, and has been using them ever since. Chuck is the editor in charge of the Mac OS X/Apple Developer Connection (ADC) series for O'Reilly & Associates, Inc. He is also the editor of the first edition of Mac OS X Pocket Reference and co-author of O'Reilly's Mac OS X in a Nutshell. Chris Stone is a Senior Systems Administrator (the Mac guy) at O'Reilly & Associates. He's written several Mac OS X related articles for the O'Reilly MacDevCenter (www.macdevcenter.com), and contributed to Mac OS X: The Missing Manual from Pogue Press. Chris lives in Petaluma, California with his wife, Miho, and two sons, Andrew and Jonathan.
Excerpted from Mac OS X in a Nutshell by Jason McIntosh, et al. Copyright © 2003. Reprinted by permission. All rights reserved.
Chapter 14 - Web Publishing with a DAMP System
DAMP is an acronym for Darwin, Apache, MySQL, and PHP/Perl/Python, the components necessary to create a powerful and scalable open source web-publishing platform on a Mac OS Xsystem. It’s actually a play on the older term LAMP,where the L stands for Linux.
The idea is quite simple. The site’s content is stored in an SQL database running alongside the web server. Except for a handful of static pages that don’t need to change (such as the site’s splash page or the company’s "About us "page), every web page on the site is built on the fly through programs that output HTML based on information pulled from the database. This can be done through a sophisticated template system, simple CGI scripts, or anything in between. This chapter details the elements involved in setting up a system like this on Mac OS X.
Elements of a DAMP System
Mac OS Xships with every technology that this section mentions,short of a database server. Fortunately, MySQL,the software that puts the "M "in DAMP, is easy to obtain and install; see the next section.
Darwin
We refer specifically to Darwin in this chapter, since running a DAMP platform means running a collection of network services (see Chapter 13) and software that runs solely on the Unix layer of Mac OS X. It doesn ’t use any of the application or user interface layers that make up the top half of the operating system ’s architecture as depicted in Figure P-1.
Apache
Through the Apache web server ’s module system (see "Apache Modules "in Chapter 13),you can enable extensions to the default web server. These embed Perl, PHP, or Python interpreters into the server,letting you use and write software in these languages that runs very fast and has access to Apache ’s internal information and variables.
MySQL
To be truly robust and scalable, a dynamic web site — be it an e-commerce site, an online journal,or a research results catalog —should keep all of its content in a database.
MySQL is a very popular open source database system from the Swedish company MySQL AB. It ’s fast, scales well,and has enjoyed years of support as the favorite of the open source programming community. MySQL is free to use for projects that run on your own servers, but you do have to purchase licenses for it if you bundle it as part of a packaged, commercial solution.
You don’t have to run MySQL per se to run a DAMP (or at least DAMP-like) system; any SQL database that your language of choice can work with will do. This can include other open source database systems like PostgreSQL, or commercial packages like Microsoft SQL Server or Oracle.
Due to its advantage of community support and the fact that it comes preinstalled with recent Mac OS Xversions,the rest of this chapter covers the MySQL configuration specifically.
PHP, Perl, Python
These are three interpreted, portable languages well known for their ability to serve up dynamic web pages.All are open source,with online support communities several years old,and all come standard with recent versions of Mac OS X.(Older versions included only Perl.) See "Choosing a Language "for a brief comparison between these languages.
Whichever language (or combination thereof)you go with,its function within a DAMP system is the same,acting as a glue between Apache and MySQL.Specifically,upon receiving a request,the web server will (instead of simply fetching an HTML file and returning it to the client)run a separate computer program that itself generates an HTML page, built by combining templates with information that it fetches from the database.
There are many, many ways you might go about this,from simple CGI scripts to intricate
templating and content management systems.
Setting Up DAMP
This section will help you decide on the language for your DAMP system (the port), how to install and configure MySQL, and how to further configure Apache to use Perl and PHP.
Choosing a Language
You should probably have some proficiency in at least one of the "P "languages, even if your site is going to run code written by others. The following is a very brief rundown on the individual strengths of these languages.
PHP
PHP is the only language of the three designed entirely with web programming in mind;it boasts web-page embedability among its core features. It is arguably the best of the three for building very simple database-backed web applications,and may be the fastest to pick up and learn,given its ability to immediately show results in a web browser.
However,it ’s very hard to extend,since adding new functionality means recompiling the PHP software itself;it isn ’t modular,as Perl and Python are.
Perl
Perl is a general-purpose programming language that excels at handling text — since any web page is really just a long string of text,Perl has been a natural choice for crafting dynamic web sites for as long as the Web has existed. Perl is the oldest of the three languages,with a history going all the way back into the 1980s. Without a doubt, it enjoys the most support. Anyone can extend Perl through writing modules (in either Perl or C),and the famous Comprehensive Perl Archive Network serves as a globally shared repository of these modules, most of which have an object-oriented interface.
