My Apache MySQL PHP (MAMP) is a one-click-solution for setting up a fully-featured web application development environment on your computer. The MAMP suite is available for Macintosh and Windows platforms and enables you to work on your web projects locally, which is great for learning and testing purposes. It also eliminates the need to upload your content to a production web server to view your changes, which speeds up development time.
Conveniently, there’s a single download for both MAMP & MAMP PRO software. (version 18.104.22.168 at time of writing):
In an age of ever-increasing threats to online security, it is imperative to verify the authenticity of packages downloaded from the Internets. You can use
openssl to do this:
$ openssl sha1 MAMP_MAMP_PRO_22.214.171.124.pkg SHA1(MAMP_MAMP_PRO_126.96.36.199.pkg)= 83be4e601d4d456aeeaef9a3b98af50c8bae22ef
The above hash matches the hash published on the MAMP website, which confirms that the downloaded file is identical to the file stored online. We are now go for launch.
MAMP_MAMP_PRO_188.8.131.52.pkg file to install the software.
Backup hosts file
The hosts file is important. I make a point of backing up key configuration files before modifying them, to create a ‘known good’ state to restore to (should I need it).
I simply create a copy of target file with
.orig extension appended to the filename:
$ sudo cp /etc/hosts /etc/hosts.orig
Add custom domain to hosts file
/etc/hosts file in your text editor of choice and append
127.0.0.1 example.local to the file and save it.
Backup Apache config file
Open Terminal and backup the Apache config file:
$ cp /Applications/MAMP/conf/apache/httpd.conf /Applications/MAMP/conf/apache/httpd.conf.orig
Add name-based virtual host to Apache config
Append your custom virtual host configuration to the
httpd.conf file. An example
# My configuration: NameVirtualHost * <VirtualHost *> DocumentRoot "/Applications/MAMP/htdocs" ServerName localhost </VirtualHost> <VirtualHost *> DocumentRoot "/Users/Example/path/to/website" ServerName example.local </VirtualHost>
VirtualHost block is needed to access the MAMP web apps (such as phpMyAdmin), so don’t change this.
You will need to edit the
ServerName directives in second
VirtualHost block as required.
Change MySQL root password
$ /Applications/MAMP/Library/bin/mysqladmin -u root -p password Enter password: New password: Confirm new password:
You will also need to update the password in the following files:
/Applications/MAMP/bin/phpMyAdmin/config.inc.php # Line 87 /Applications/MAMP/bin/checkMysql.sh /Applications/MAMP/bin/quickCheckMysqlUpgrade.sh /Applications/MAMP/bin/repairMysql.sh /Applications/MAMP/bin/stopMysql.sh /Applications/MAMP/bin/upgradeMysql.sh
Thanks to Chris Pauciello for posting this list on the Treehouse Forum.
That concludes this short guide to set up MAMP on OS X Yosemite. If you found this post useful, please do leave a comment below. Thanks for reading.