In my last post, I professed my
love like for using MAMP over the built-in/download/make/make test/make install/scratch eyes out method of setting up a web dev environment on OS X. I felt so good about it, I decided to get “work” to purchase MAMP PRO to take it to another level. Frankly, I’m not so sure it’s worth it, but running MAMP on port 80 without having to enter my password every time is nice.
In order to upgrade, I kept my vhosts file for my current MAMP install for safekeeping and then uninstalled MAMP since it was an older version. Then I installed the new version, set up my first vhost (a PHP Laravel project) and everything worked. MAMP PRO likes to set up virtualhosts using Server Names instead of Ports, though ports are an option. It even edits your hosts file for you so the names resolve properly. Nice.
Next it was time to hook up MAMP PRO to Coldfusion 10. This was a pain in the ass, but I’ll just go thru the final steps in case anyone is in the same boat. I ended up doing a fresh install of CF10 after having no luck with just running wsconfig on the existing install.
Here’s the deal:
MAMP PRO uses it’s own dynamically created httpd.conf file based on the settings you provide in the GUI. And it also provides “templates” that are used as the base for httpd.conf, as well as the PHP and MySQL config files. To connect CF10 to MAMP PRO using the web server connector utility during the CF10 install, first point the httpd.conf file that MAMP PRO is currently using (dynamically created from it’s template).
This httpd.conf file is located at /Users/[username]/Library/Application Support/appsolute/MAMP PRO/httpd.conf
After pointing to that file, click on Advanced and point to /Applications/MAMP/bin/apache2/bin/apachectl and /Applications/MAMP/bin/apache2/bin/httpd where required.
This is all pretty much standard stuff when connecting Apache and CF10 except for the location of httpd.conf
The trick is that once the CF10 web server connector (wsconfig) is done and has made changes to httpd.conf, you need to open the file, go to the bottom and copy the line that looks like this:
Include “/Users/[username]/Library/Application Support/appsolute/MAMP PRO/mod_jk.conf”
Now go into MAMP PRO and click on File | Edit Template | Apache | httpd.conf
Paste the line above to the bottom of that file. And then go find this line:
DirectoryIndex index.html index.php
and change it to
DirectoryIndex index.cfm index.html index.php
Now whenever MAMP PRO restarts and recreates the httpd.conf file, the CF10 stuff will be there since it’s now part of the base template.
The only problem I had left to deal with is that MAMP PRO started telling me that the built-in Apache was running and creating a port conflict. I kept killing the httpd process that showed up in the Activity Monitor, but it kept coming back. I finally noticed that MAMP PRO has a Tools menu with an for stopping the built-in Apache. Somehow, it was able to do what I couldn’t.