Make a MAMP Server Available Externally
TechnicalAlthough I've been running something of an alternative development environment for a while, I recently decided - for reasons of convenience that I won't go into here - that I wanted start running a truly local development environment if I could find a way to do so in a reasonably elegant manner. In this case, "elegant" is really just a not-so-sophisticated codeword for "self-contained", "encapsulated" or "bundled". In short, I didn't - and don't - want my Mac to be a web server, I just want it to run a web server.
Most of what I'm doing these days involves PHP, so a bundled AMP (Apache, MySQL, PHP) stack seemed appropriate for my needs. There are a number of bundled stacks for Linux and, quite predictably (and fortuitously), there are at least a few for Mac. I settled on the free version of MAMP.
Everything went smoothly until I tried to test my first locally developed web application on IE using my Windows XP virtual machine - I was unable to connect to the server running on my Mac. I wasn't expecting that. After a little head scratching, I realized what was going on. What follows is a description of the steps I took to make my MAMP web server available to other machines within my network.
For the impatient figure-it-out-for-yourself-ers among us: look at your services and firewall settings in System Preferences.
For those interested in a more verbose explanation, I should start by stating that MAMP's web server does not run on port 80 by default. I assume this was done in order to prevent a conflict with OS X's built-in Apache server in case both were running; the built-in web server also listens on port 80 by default. Because I have no plans to use both servers simultaneously and I'm too lazy to add a port specification to every URI I type, I configured the MAMP-installed Apache server to listen on port 80.
To make a MAMP-installed Apache server available to machines other than the one it's installed on, first ensure that Personal Web Sharing is disabled. Enabling this service will start OS X's built-in Apache server and create a conflict since both servers are trying to listen on the same port. I honestly don't recall whether I had that enabled before trying externally, but I've since confirmed that it must be turned off. To turn off Personal Web Sharing, launch System Preferences and click the Sharing icon in the Internet & Network group. On the Services tab, ensure that the Personal Web Sharing service is unchecked.
Now move to the Firewall tab. You can, of course, turn off the firewall all together, but that's the easy way out and potentially more dangerous. If you want to be more selective about what is exposed, leave the firewall turned on. Since Personal Web Sharing was disabled on the Services tab, it's automatically disabled on the Firewall tab which appears to close off port 80. It seems the two settings can't be enabled independent of each other, but no worries, there are more ways to skin that cat. In this case, all I really wanted to expose was traffic on port 80. To do so:
- Click the New button next to the services list
- Select Other in the Port Name drop down list
- Enter 80 in the TCP Port Number(s) textbox
- Leave the UDP Port Number(s) textbox empty
- Enter HTTP (or any other descriptive text) in the Description textbox
- Click OK
The MAMP-installed Apache server should now be available to handle web requests initiated by any external machine that has access to the host machine.





Loading....