How to build Apache 2 with mod_perl2 and PHP 5 with GD on OS X 10.5 Server

Apple's Mac OS X 10.5.x Leopard Server is an easy way to get started with the open source *AMP stack (Apache, PHP, MySQL). Everything can be enabled with a click of the mouse using Apple's easy to use GUI, Server Admin. It's a great thing too, but like all of Apple's products, their is always the small detail that ruins it.

Apple forgot a couple of very important open source modules. In PHP it's GD and mcrypt, while Apache is missing the all important mod_perl2. The following HelpFile will guide you on how to compile and install your very own Apache and PHP without affecting Apple's built in setup. Unfortunately, this means that using Server Admin is out of the question, thankfully we have something called Webmin.

System Requirements

  • OS X 10.5 Server
  • XCode Tools - Available on the Apple OS X Server Install DVD
  • These instructions where tested on an Intel Macintosh, they should however work on PowerPC
  • Optional: GNU Wget - How to Install
  • Optional: Webmin - What is this?

Preparation

First of all, we need to download the MySQL client libraries and headers from Apple's website since they are not included with Mac OS X Server 10.5. The following instructions are taken directly off of Apple's knowledge base article located at http://support.apple.com/kb/TA25017?viewlocale=en_US.

To install:

  1. Download the file.
  2. If the download doesn't automatically produce a folder on your desktop, double-click it to unzip it to a folder named "MySQL-43.binaries" which has a file named "MySQL-43.root.tar.gz" in it (as well as the readme file). Note: Do not double-click/unzip the "MySQL-43.root.tar.gz" file that is within the folder.
  3. Open Terminal.
  4. Type cd (but do not press Return).
  5. Drag the "MySQL-43.binaries" folder from your desktop to the Terminal window to populate the cd path, then press Return.
  6. Execute this command:

    sudo tar -xzvf MySQL-43.root.tar.gz -C /
    1. Make sure you complete this step, you can not build PHP with MySQL support without these libraries and headers.

      Lets go to a terminal and switch to the root user and create ourselves a work folder to keep everything in. Execute the following commands in your terminal window:

      sudo -s
      cd ~
      mkdir work
      cd work

Comments

Excellent Guide

Thank you very much for this guide. It helped me tremendously to build and install newer versions of all these software on my test server. Any chance of writing a guide for MySQL for OS X Server 10.5 running on a PowerPC chip? I tried a few of the available guides online, but it didn't quite work out for me.

PacyWorld Button
Powered by Pacy