How to start Apache with MAMP on Mac OS X Mavericks and Yosemite

I got back to web development yesterday, and quickly learned that Apache under MAMP on Mac OS X Mavericks and Yosemite no longer works through the GUI. In short, I created a shell script like this to start Apache:

# info on the problem:
# stackoverflow.com/questions/25139599/mamp-pro-3-05-on-mavericks-updated-to-yosemite-apache-does-not-start

# have to do this now in osx yosemite
sudo /Applications/MAMP/bin/apache2/bin/apachectl start

The URL I show in that script discusses the MAMP/Apache/OSX problem.