Blog Post

Set Up a Mac Server with MAMP

For those of you who have dabbled with website design and development, you may be interested to know that OS X is bundled by default with the Apache web server. This allows you to easily develop websites on your own computer without the need to invest in a domain name or hosting package. However, the standard Apache system in Leopard is fairly limiting for those wanting to delve deeper into web based development languages such as PHP and database technology.

Fortunately, there is a remarkably simple way to set up a fully featured server on your Mac: MAMP. We previously mentioned MAMP when it was conceived way back in 2005, but this post will explain in a little more detail exactly how simple it is to install, configure and start using your MAMP installation.

The abbreviation MAMP stands for: Macintosh, Apache, MySQL and PHP. These are the four main constituents you need to design and develop a full featured website or application on your Mac.

Downloading MAMP

There are two versions of the server available to download, both of which come bundled in the same 130MB package. MAMP Pro is a configurational program for MAMP, allowing you to set up any number of servers to carry out tests without danger for your live system. It’s aimed primarily at those running a production server on their OS X machine, and at the outset you’ll likely be fine with the free version.

Once installed, it creates a ‘MAMP’ folder in your Applications directory. This contains the entire server along with the directory in which to place your website files (‘htdocs’).

Configuring and Using MAMP

There are three main components installed with MAMP.

  • Apache: This is the basic web server, and makes the display of HTML pages possible. You can view your local Apache web pages through the URL http://localhost:8888/.
  • MySQL: This is the database server, and comes bundled with a utility for easily adding, editing and removing database tables and records — phpMyAdmin. This is the easiest starting point for getting to grips with MySQL. The default username and password for the database install are both ‘root’.
  • PHP: Where HTML is great for displaying content, PHP allows you to process information and connect to the MySQL database to store and retrieve information. MAMP allows you to choose between using PHP4 or PHP5, and the configuration options for both can be found in /Applications/MAMP/conf/.

Starting and stopping all these services can be done through the MAMP application itself, or through the bundled Dashboard widget.

The full list of services bundled with MAMP consists of:

  • Apache 2.0.59
  • MySQL 5.0.41
  • PHP 4.4.8 & 5.2.6
  • APC 3.0.14
  • eAccelerator
  • XCache 1.2.0
  • phpMyAdmin
  • Zend Optimizer 3.3.3
  • SQLiteManager 1.2.0
  • Freetype 2.3.4
  • t1lib 5.1.1
  • curl 7.18.2
  • jpeg 6b
  • libpng-1.2.18
  • gd 2.0.34
  • libxml 2.6.32
  • libxslt 1.1.24
  • gettext 0.17
  • libidn 0.6.14
  • iconv 1.11
  • mcrypt 2.5.8
  • YAZ 3.0.6 & PHP/YAZ 1.0.12

Uninstalling MAMP

If you choose to remove MAMP at any time, uninstallation is as simple as dragging the folder from your Applications folder to the Trash. This makes a huge change from a standard server installation which would historically include a series of complicated uninstall steps. If you are interested in the app on a superficial level it is easy to install it, play around, and remove it with no long-lasting effects on your system.

Going Live

Once you’ve created a world-changing web application on your local machine, you’ll need to search for somewhere to host the site permanently. Unfortunately, even if your ISP offers a fixed IP address, hosting your website ‘at home’ is unadvisable. It’s likely to be considerably slower than a server hosted in a professional data center and can cause some tension between you and your ISP. There are literally thousands of hosting companies offering a professional service, with the one I would recommend personally being Media Temple.

Do you have any experience using MAMP, or are you employing a different tactic to locally test and design websites?

16 Responses to “Set Up a Mac Server with MAMP”

  1. This was a real let down. This does not tell you how to run mamp properly at all.

    I am struggling with a pc 2 mac transition, wamp was a doddle to setup without any problems at all but I cannot seem to get any of my files to run using mamp, just get page cannot be displayed’s or directory not found.

  2. Hi there, great place to find some information and I’m hoping that someone here can help me out with a seemingly easy question. All I’m trying to do is to activate MAMP Pro’s built in postfix utility to work with mail. Am I just way off on this one? It really seemed like it was easy but I can’t find anyone. On MAMP’s site there is very little documentation on it, and the forums had similar problems without answers. Any direction would be very appreciated.

    Thanks a heap for having a great place to land… cheers,

  3. Re: Timothy Post

    You can definitely download your current WordPress blog folder and run in locally on MAMP, but you’ll need to edit wp-config.php so that it accesses the MySql installation in MAMP, which will have different settings that your bluehost db.

    Thus, if you want to mirror the folders, make sure that you exclude wp-config so that when the changed files get uploaded to your server it doesn’t break the database connection.

  4. I have a blog hosted at bluehost with a couple years worth of posts. I’ve updated to WP 2.7. I installed MAMP Pro on my Mac and was able to get a new installation of WordPress running fine.

    My question, which I could not find an answer to anywhere online, is whether it is possible for me to download my current active WordPress blog folder through Transit FTP and install it on MAMP. Then have the files in MAMP (on my Mac) be “mirrored” with the files up on the remote server at bluehost?

    Any thoughts?

  5. As part of this package does MAMP comes with a mod_jk module. This is the part which I had problems with the pre-installed version of Apache, and despite manual installation of mod_jk I was not able to do much with it.

  6. MAMP works swell. I’ve been using it for the past couple of months for my php development – it beats the heck outta manually moving files up to a webserver every time you make a simple change. Great stuff.

  7. This is just info that I could’ve read at the MAMP site. Why don’t you give a step-by-step explanation about creating a new MySQL database under MAMP by using phpMyAdmin. Something that is often glossed over when apps ( blog, CMS etc. ) have to be tested that need this as a prerequisite. Surprisingly difficult to find a foolproof tutorial using Google.