Monday, January 12, 2009

MAMP on Leopard part I

In this three part tutorial I'll detail how to take Mac OS X 10.5 Leopard (client version) from no MAMP to MAMP.

MAMP being a twist on the more common LAMP.
  • Mac OS X
  • Apache
  • MySQL
  • PHP (or Python or Perl)
MAMP is key for using modern web services and software, e.g. phpMyAdmin, MediaWiki, the list is almost endless. Each part of this tutorial will address one element. I assume you have Mac OS X Leopard installed, if not go buy yourself a Mac!

Apache2 comes with Leopard (and is periodically updated too). All you need to do is switch it on. Jump to System Preferences > Sharing, tick "Web sharing" from the list and apache is now running!

Find your configuration file at /etc/apache2/httpd.conf. Files for the default location can be found in /Library/WebServer/Documents and CGI scripts in /Library/WebServer/CGI-Executables. User websites (http://localhost/~username) can be found in the Sites folder of the specified user. Note the location of any of these can be altered using your httpd.conf. I recommend reading up on the manual before editing your .conf files first.

You can also stop/start apache via the command-line using:

sudo apachectl {start|stop|restart}

MySQL will be covered in part II.