Donate to Wikipedia

Transform a Mac into an Open-Source Server

The Tutorial Tutorial Overview

MacPorts provides an infrastructure for building, installing, and packaging open source software. It is designed to match the functionality of the FreeBSD Ports system and to be extensible for future enhancements.
- from the MacPorts Installer Read Me file

There are numerous good tutorials on how to enable a fresh Mac OS X installation as a DAMP (Darwin/Apache/MySQL/PHP) server (e.g. O‘Reilly runs, which has a wealth of excellent Mac information, including tutorials on DAMP). After all Mac OS X (10.4) comes with the open-source Apache (1.X), MySQL (version 4.1.14) and PHP (4.X) already installed. They just need to be configured and activated.

The problem with enabling the built-in open-source environment on Mac OS X is that it is not up-to-date, and inevitably one updates a module (say php 5 instead of the default php4 for example), or installs other custom open-source software, only to find on the next Mac OS X Important Security Update that the environment has been compromised - either downgraded, obliterated or otherwise fatally modified.

Fortunately there are solutions. The first of these to be offered was the Fink environment, which installs a complete DAMP environment in its own root directory (/sw/). Apple promises to leave this directory alone with all system software updates, and Fink promises to keep that directory up to date. The drawback with Fink is that it has very few packages available, and the user tends to find a need to either create a package of their own, or install from source code - not a welcome idea when there are so many excellent DAMP packages out there.

The solution preferred and promoted by this website is MacPorts. Apple very wisely based Mac OS X on FreeBSD, which has its own Ports package management system claiming some 17,576 packages available. MacPorts is the migration of FreeBSD Ports to Mac OS X. You will find (nearly) all the packages you need are available, and installation and maintenance of a comprehensive up-to-date DAMP environment is now feasible.

This is a tutorial that guides you through the installation of MacPorts, and its use to install and configure the open-source packages that change the Mac into an industrial-strength open-source server. It is organized so that you can follow through the tutorial with the menu items at left.