Yesterday evening, I decided that I wanted to try and install both ColdFusion and XAMPP on my MacBook, to try to get them working in conjunction with each other. I hit a few stumbling blocks along the way which were frustrating so I thought I’d write a quick guide so others could also attempt to install them. Before you start, there’s one thing to keep in mind (and it may seem a bit obvious), but you must have administrator rights as you will need to enter the password during the installation process.
Right, first things first, you’ll need to download a copy of XAMPP OS X and ColdFusion 9 (I’m a student so I use the developer edition). I’m aware that OS X does come with it’s own version of Apache however, I always used XAMPP on Windows and I wanted to continue with it.
1. Install XAMPP in the usual way- it’s really just a case of hitting next. If in doubt, follow the instructions on the XAMPP website
2. Now onto ColdFusion. Download the developer edition, unzip it and click on the installer.
3. The installer should load. Again at this stage, it’s a case of clicking “ok” and “next” to accept terms and conditions.
4. When prompted for a serial number (which you won’t have), check the box which says you are using the developer edition.
5. Then on the next screen, select the server configuration option. After that, you will be asked whether you already have a version of ColdFusion running on your machine. For an easy(ish) install ensure you don’t have an old version lurking about.
6. You will then be asked where you would like to install ColdFusion. Choose whatever you like but I found it easier to leave the default path- “/Applications/ColdFusion9″.
7. After this, you will need to configure the connector. Enter the details below:
- Config. Dir: /Applications/xampp/etc
- Dir and file name of server binary: /Applications/xampp/xamppfiles/bin/httpd
- Dir and file name of server control script: /Applications/xampp/xamppfiles/bin/apachectl
8. Hit next. You will then be asked where you would like to place the CFIDE folder. I put mine in /Applications/xampp/xamppfiles/htdocs but had an issue where the file permissions didn’t allow me to write anything to the directory. Set the file permissions to read and write. You can do this by navigating to the appropriate folder in Finder, right clicking on it, choosing “Get Info” and editing the “Sharing and Permissions” option which is towards the bottom of the screen.
9. Once you’ve done this, you will be prompted to enter an administrator password for the CFIDE.
10. The next screen asks if you want to set a password for RDS. Off the top of my head, I’m not really sure what that is (can’t even remember if the installer explains it) but I just ignored it and didn’t set a password. After this, it should install.
Ideally, the ColdFusion administration login should then appear, prompting you for the password you previously created. On entering it, the install should complete and bam, everything should work. If it does, then great, go get a cup of tea. if it doesn’t, get a cup of tea anyway- you’re going to be sitting in front of your computer for a little longer.
In my case, whenever i tried to open a .cfm file, my browser tried to save it, meaning that it didn’t know how to render it into a webpage. “Easy fix” I thought. If something like this happens, you may need to tell Apache it’s ok and that these files can be opened. Navigate to /Applications/xampp/xamppfiles/etc/httpd.conf. Make a back-up of this file just in case anything goes horribly, horribly wrong. Find the line that says DirectoryIndex and has something like index.php index.html beside it. Add index.cfm. This may solve your problem (if you’re having a problem that is).
I then decided to check out the ColdFusion connector log which can be found at /Applications/ColdFusion9/ConnectorInstall0.txt. In here, I discovered the connector hadn’t been created!
To recreate it, go to /Applications/ColdFusion9/ColdFusion Launcher. Hit the Webserver Connector Utility and enter the same information as provided in step 7. You will need to hit Advanced to enter all the info. The only checkbox which you must tick is the one which says to configure the webserver for ColdFusion9 applications. Once you hit ok, your httpd.conf file for XAMPP will have been edited. At around line 500 or so, you will see code which says something like-
# JRun Settings
LoadModule jrun_module /Applications/ColdFusion9/runtime/lib/wsconfig/1/mod_jrun22.so
Don’t worry, this is good. Try and start Apache in the XAMPP control panel. Bet it still doesn’t work? Bet it comes up with an error saying that it cannot load mod_jrun22.so into the server (or something like that). Chances are, ColdFusion is still trying to use the wrong type of connector. I don’t know why it does it- it’s annoying. Anyway, the right version of the connector is sitting on your computer- you’re almost there….
Navigate to Applications/ColdFusion9/runtime/lib/ and copy and paste the wsconfig.jar to your desktop. Open it using the archiving utility and there should be a folder called “connectors”. Inside this, there is one called “apache”. Open it. Here’s all the correct connectors. If you are using a MacBook Pro, choose the intel-macosx folder. Within that, there’s a prebuilt folder and finally inside it, here are the appropriate files! Copy the mod_jrun22.so file. Put the file into the /Applications/ColdFusion9/runtime/lib/wsconfig/1/mod_jrun22.so directory, overwriting the old one. Try starting Apache now. It should work. At this stage, you should then be able to complete the installation by following the steps for the CFIDE login in your browser.
So, XAMPP and ColdFusion will be able to work in harmony with each other. Cool, huh? It’s ok, you can thank me later
A guide which was particularly helpful at the early stages can be found at the following link- How I installed ColdFusion 8 on Mac OS X by Renaun Erickson