• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

14.1. Elements of a DAMP System

Mac OS X ships 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.


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.


Through the Apache web server's module system (see 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.


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 (http://www.mysql.com). 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 X versions, 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 Section 14.2.1 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.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint