After installing a pile of applications onto my new Mac the next order of business was installing server software, including Coldfusion 8. Intially I thought this would be a very easy process but that was not the case. Apparently Leopard and Coldfusion 8 do not play together nicely and a bit of massaging is neccessary to get everything in order. A some Googling I came across this post which works perfect. I found the text version of this same process in some other places, but having a video to watch seems a bit easier, you can see exactly what you need to do.
One thing that is a little misleading in the video is that he states you can only run Coldfusion pages from within the htdocs folder. This is not the case. In the httpd.conf file (/applications/MAMP/conf/apache) you can define virtual hosts that map to any directory on your machine, any Coldfusion pages within those directories will run just fine.
# NameVirtualHost *
NameVirtualHost *:80
NameVirtualHost 127.0.0.1
<VirtualHost *:80>
ServerName local.mr.mrn.com
DocumentRoot "/Users/derrick/Documents/workspaces/mrn/MRN"
</VirtualHost>
One other note. Be sure to use MAMP and not MAMP Pro. I tried numerous times and Coldfusion 8 refused to run on MAMP Pro. I suspect it has something to do with how MAMP Pro manages the httpd.conf file. Regardless, it won’t work, so don’t waste your time.
Wow, thanks for this. Just what I was looking for. I was able to continue through with the installation from the video and then make the changes afterward as you noted above.
In my case I’m developing many sites locally. Should I create a different virtualhost for each? Or just point this one virtual host (the one I created with your instruction above) to the root of where all of my local sites are?
so for instance: /Users/mymachinename/Sites/LOCAL/ (which would be the root of where my local sites are.
or:
/Users/MyMachineName/Sites/LOCAL/SpecificSiteName/
/Users/MyMachineName/Sites/LOCAL/SpecificSiteName2/
Any advice would be great. Otherwise the solution I have now works great. Thanks again for the help!
I would create a separate virtual host entry for each site. Makes it super easy to develop your site in it’s own ‘sandbox’ and makes it easier for relative pathing etc.
Make sure you also update your ‘hosts’ file. In windows you can find it at ‘c:/windows/system32/drivers/etc/hosts’ on a mac ‘/etc/hosts’. Look here for some information on the host file.
Good advice yet again, thank you. I would have totally overlooked the hosts file. I’m a 100% newb when it comes to creating a development environment locally. And even then, most of my remote development takes place on servers that are already configured.
One thing to note is it’s a good idea to restart Apache after changing the host file and httpd.conf file. This is probably common sense to most but I spinned my wheels for about 15 min until I got a clue.
The other thing to note for those who are new like me (and Mac users), you’ll need to either edit the hosts file via Terminal or use Terminal to show hidden files in Finder in order to browse to the file and edit it. I found this online to show hidden files (you have to restart finder after typing this into Terminal):
defaults write com.apple.finder AppleShowAllFiles TRUE
Just for reference here is what I have, I’ll replace angle brackets with square brackets.
—httpd.conf file —-
[VirtualHost *:80]
ServerName dev.jyoseph.local
DocumentRoot “/Users/josephholst/Sites/LOCAL/jyoseph”
[/VirtualHost]
[VirtualHost *:80>
ServerName dev.test.local
DocumentRoot "/Users/josephholst/Sites/LOCAL/test"
[/VirtualHost]
—hosts file—
127.0.0.1 dev.jyoseph.local
127.0.0.1 dev.test.local
Thanks again for your help, I hope someone else stumbles on this post and finds it as useful as I did!
I try to install Coldfusion and had a very difficult time with it and it still has not work properly. After the installation I cannot find the cfm file. I can only find it available to me to download. After rebooting it, I still have the same problem. It doesn’t work properly even though I’m Using MAMP Pro.
Calling a friend right now to see if he can help.
I found that I had to restart the whole machine after editing the hosts file. Thanks for the quick tutorial, it save me tons of time.
Greg
I tried to follow exactly the instructions on the video installing the latest Coldfusion (64 bit) on my Mac Leopard 10.5.2 but there is no way to run it neither under MAMP or MAMP pro.
The coldfusion server starts but it fail to connect to Apache. I fact in the web server configuration there is no configured web servers and if I try to add it with the MAMP setting the apache server does not start at all.
Has anybody ever been able to get MAMP Pro and CF8 running on OS X?
I would really like to use the vhost GUI in Pro but it seems no matter what I try and can’t get CF and Apache to place nice.
Cold fusion 8 do not play together nicely and a bit of massaging is necessary to get everything in order. A some Goggling I came across this post which works perfect. I found the text version of this same process in some other places This is not the case. In the httpd.conf file (/applications/MAMP/conf/apache) you can define virtual hosts that map to any directory on your machine, any Cold fusion pages within those directories will run just fine.
Hi Derrick, nice article
Just to let you know I have got it to work with MAMP Pro and I put together a screencast in case anyone else wants to know how to do it – you can find it here:
http://blog.flashgen.com/2009/06/16/configuring-coldfusion-mamp-pro/
Keep up the good work
m