MAMP/Apache on port 80 on Mountain Lion

I'm running MAMP Pro 1.9.6.1 with Apache on port 80 and since the OSX 10.8 (Mountain Lion) upgrade, Apache would start no more on port 80.Maybe this is due to a new security model or the fact I'm using an "old" version of MAMP, either way I found a quick-fix solution:
  1. Bind Apache to port 8080
  2. Forward all port 80 traffic to port 8080
  3. Edit the MAMP Apache template
The first step is straightforward and is done via the MAMP interface.

The second step involves running this command line* at each boot:
sudo ipfw add 100 fwd 127.0.0.1,8080 tcp from any to any 80 in

If you want to make this automatic, you can edit /etc/ipfw.conf with your favorite text editor (eg: sudo vim /etc/ipfw.conf) so that it looks like this:
flush
add 100 fwd 127.0.0.1,8080 tcp from any to any 80 in


If using vim and you're unfamiliar with it, you'll have to first press the "i" key to get into insert mode, then paste the two lines above, then press the "esc" key to exit insert mode ;) then type ":x" followed by the return key to save&exit.

The third step is to replace some "MAMP port" tokens in the Apache template (MAMP Pro > File > Edit Template > Apache httpd.conf).
  • NameVirtualHost *:MAMP_Port_MAMP becomes NameVirtualHost *
  • <VirtualHost _default_:MAMP_Port_MAMP> becomes <VirtualHost _default_:*>
  • <VirtualHost *:MAMP_VirtualHost_Port_MAMP> becomes <VirtualHost *:*>
Hope this helps other people!!!
Enjoy!

(*) found command line on a stackexchange.com post