Configuring Coldfusion 2018 with Apache on Mac OS X Mojave

Follow by Email
Facebook
Twitter
LinkedIn
Instagram

There have been some bugs in Mac OS X 10.14 (Mojave) that made it impossible to use Coldfusion outside of it’s root. With the latest release (10.14.4) these bugs were removed.

My goal was to install Coldfusion2018 and use it for sites that were stored in my /Sites folder. To do this, you need to use the “connector” that Coldfusion provides. Allow me to share how I did that.

Install Coldfusion 2018.

Step 1
Download the latest version of Coldfusion 2018 from Adobe.  Select the developer edition, fill out any information they require and download the install files.  Run the installer, choose “developer” as the mode and make your choices.  You can leave the default on just about everything.  Make sure that on the last screen, when they ask you the name of your computer, you change it from your computer name to:

127.0.0.1

Step 2
Run the connector. Helpful article on using the connector via command line.

Use this command instead, as the code given in the article above is not accurate for Mac OS X 10.14.4: 

sudo ./wsconfig -ws Apache -bin /usr/sbin/httpd -script /usr/sbin/apachectl -dir /etc/apache2/ -v

Set up Virtual Host

Step 3
In order for your computer to recognize that you have website files located on your computer, you’ll need to set up a virtual host.  The virtual host allows you to reach a URL from your browser, that is actually pointing to files on your computer.  For example, I could reach my /Sites/WebsiteTest folder at a URL like “localhost.websitetest.com”, making it really nice to develop. Here is a great guide on setting up your virtual host on Mac OS X. 

Make sure your website folder is writable.

sudo chmod -R 747 /Users/yourusername/Sites/Yoursite

Here is a Link to StackOverflow where I was seeking help.

Start Coldfusion and Apache

If you’re running DesktopServer, MAMP, MAMP PRO or another local server on your computer, you’re going to want to make sure that those servers are quit, or else the servers will conflict with the built-in Apache on Mac. I won’t include those instructions here, as your situation will likely be unique and there are dozens of articles explaining this on the web.

Step 4
To start Coldfusion and Apache, you can use Terminal to start them, but I prefer to save the commands as an AppleScript so that I can click a button each time I want to start Coldfusion (if it’s not already running on system startup) or Apache (again, probably running on system startup).

This is my AppleScript for starting Coldfusion:

tell application "Terminal"
	activate
	do script "/Applications/ColdFusion2018/cfusion/bin/coldfusion start"
end tell

Open the “Script Editor” application and save that to your “Users/yourusername/Library/Scripts” folder.

If you’d like to save a script to stop Coldfusion, use this:

tell application "Terminal"
	activate
	do script "/Applications/ColdFusion2018/cfusion/bin/coldfusion stop"
end tell

To start Apache, use this script:

tell application "Terminal"
	activate
	do script "sudo /usr/sbin/apachectl start"
end tell

And to stop Apache, use this script:

tell application "Terminal"
	activate
	do script "sudo /usr/sbin/apachectl stop"
end tell

I tried to combine them into a single script, but am new to AppleScript, so I’ll let someone else handle that (feel free to comment on this post and I’ll add it to the article).

Finished

At this point, Coldfusion 2018 is installed and running, Apache is running, the connector is set up and your virtual host is allowing something like “localhost.mywebsite.com” to point to your computer, instead of the web.

You should be able to access that URL in your browser and see your Coldfusion site running.

I hesitate because though I’ve spent dozens of hours troubleshooting and researching, and helped a teammate set this up, there are still so many potential issues that can arise.

Please feel free to comment and I’ll do my best to answer any questions — though my background is in web design, not IT or server configuration. Let me know if this helps you out!