I recently posted about changes that I needed to make to my Apache configuration files to get my custom virtual hosts settings working again, after upgrading to Mac OS X 10.8, aka Mountain Lion. In addition to those changes, I’ve also discovered that the update removed my JRun server settings from the httpd.conf file, making it impossible to start my local Adobe Coldfusion server.

These settings are added by the ColdFusion installer to setup JRun to correctly load the ColdFusion server instance. All you need to do is to put the settings back in the file and CF will start up again. However, I decided to put these settings into their own file so future Mac OS X updates will not remove them (although a future CF update would put new settings directly into the conf file again).

To get this done, follow these steps:

First, open your apache2 directory where the httpd.conf file lives. Since this is a hidden directory, the easiest way is to issue the following terminal command:

open /etc/apache2

Now, with that directory open and in focus, enter Apple’s TimeMachine app via the top menu bar icon. This will open previous saves of this file. Browse back to a date prior to your Mountain Lion update. Select the httpd.conf file in that directory and choose the “Restore…” option. You will be prompted to select a location to restore to. Select the Desktop so you can find the file easily. DO NOT restore this file to you current /etc/apache2/ directory.

Open your restored copy in your favorite text editor (I use TextMate), and find the JRun section. It will look something like this:

 # JRun Settings LoadModule jrun_module /Applications/JRun4/lib/wsconfig/1/mod_jrun22.so JRunConfig Verbose false JRunConfig Apialloc false JRunConfig Ignoresuffixmap false JRunConfig Serverstore /Applications/JRun4/lib/wsconfig/1/jrunserver.store JRunConfig Bootstrap AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf DirectoryIndex index.cfm index.html IfModule> 

Your current, Mountain Lion, httpd.conf file aready has a line it to include all the custom “.conf” files. Near the bottom of that file you will see that include like so:

Include /etc/apache2/other/*.conf

So taking advantage of that, create a condfusion.conf file in the /etc/apache2/other/ directory using these commands:

cd /etc/apache2/other/ sudo pico condfusion.conf

You’ll be prompted to enter your root password. Then, once the new document is open, paste in the JRun settings from your old httpd.conf file. Save the file (Ctrl-O, Return) and exit pico (Ctrl-X).

One last thing you will need to do is to put the .cfm file type back in the httpd.conf file as an acceptable type of index file. Look in that file around line 233. You should see something like this:

  DirectoryIndex index.html 

Update that by setting the value like so:

 DirectoryIndex index.html index.cfm index.php index.htm 

As you can see that also includes php and htm files as well. Without this, browsing to somedomain.com/ will not load the index.cfm file at the root of your local site.

Now restart Apache so everything takes affect like this:

sudo apachectl restart

Now you should be able to start your ColdFusion instance without any issues, and see your sites load.