n42 Designs

Custom Web Development

ColdFusion 9 and Mod_jrun on Mac OS X Yosemite With Apache 2.4

| Comments

OS X Yosemite updates the included Apache HTTP server from 2.2 to 2.4. The ColdFusion 9 connector installs a version of mod_jrun which has been compiled for Apache 2.2. Using this article I was able to recompile the connector for Apache 2.4 and get ColdFusion 9 running with Apache 2.4. Here you will find a zipped version of the compiled connector so you can skip recompiling it yourself. Simply unzip and move the .so file to the desired location on your Mac and update your Apache configuration to point to it.

So:

LoadModule jrun_module /Applications/JRun4/lib/wsconfig/1/mod_jrun22.so

becomes

LoadModule jrun_module /Applications/JRun4/lib/wsconfig/1/mod_jrun24.so

You may find you need to update other Apache configuration settings. You can find additional information on upgrading from Apache 2.2 to 2.4 in the Apache HTTP Server Documentation.

Running ColdFusion 10 on OS X Mavericks

| Comments

Running ColdFusion 10 on OS X Mavericks is possible, but not straightforward. Unfortunately, it seems the web server connector does not work with Apache 2.2.24 which ships with Mavericks. A bug has been logged for this here: https://bugbase.adobe.com/index.cfm?event=bug&id=3653076. Please vote for it. There are a couple of issues I had with Mavericks and ColdFusion 10 (CF 9 works fine for me for what it is worth). First, ColdFusion wouldn’t start because Mavericks removed Java 6. I had to update 3 files to fix this:

/Applications/ColdFusion10/cfusion/bin/jvm.config /Applications/ColdFusion10/cfusion/bin/coldfusion /Applications/ColdFusion10/cfusion/runtime/bin/wsconfig_jvm.config

In each of these, there was a setting to set the Java home path. It was set to the old location for Java 6. I updated these to point to Java 7. For me this was:

/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home

This was after installing the latest Updater 45 JDK from Oracle’s website.

Once I made these changes ColdFusion started fine.

The next issue is with the Connector. Adobe created a customized version of mod_jk to go along with their customized version of Tomcat. Because of this, recompiling mod_jk is not going to work. We’ll have to wait for an updated version from Adobe. (EDIT: See Mike’s comment below for a solution!) Until then you can either use the built in web server or install MAMP PRO which ships with Apache 2.2.22 (same as Mountain Lion) and then configure using the web server connector.

I followed the recommendations in this blog post: http://www.brilang.com/2012/06/installing-coldfusion-10-under-mamp-pro-2-on-os-x-lion/1137 to configure MAMP PRO.

FarCry LESS Plugin

| Comments

Today I released a plugin for FarCry that will automatically compile your LESS files into CSS. No more need to compile on your development machine before you push to production, and no more need to punish your users by compiling on the client side with Less.js. While those solutions are perfectly acceptable, this plugin will let you simply code in LESS, then let FarCry do the work of serving compiled, minified CSS to your users.

The plugin uses a similar syntax to FarCry’s built in skin:loadCSS tag so it should be instantly familiar. Be sure to read the installation instructions to avoid a couple of potential “gotchas”.

Check it out on Github, and let me know if its useful for you, or if you would like to see any additional features.

Github Gist Renderer for BlogCFC

| Comments

I created a quick renderer for Github Gists for use within BlogCFC entries. You can see it in action right here. If interested just grab the code from the gist below and save it to /org/camden/blog/render/gist.cfc. You can then use

to include the gist in your entry. If you want to constrain the height you can use CSS like:

Here is an example of what the output looks like, using the Gist I created to hold the code for the renderer. Feel free to grab it for your own BlogCFC install.

FarCry YouTube Plugin

| Comments

One of our clients asked for better integration of their YouTube hosted videos on their FarCry website. They had been linking to the youtube.com URLs directly, leading traffic away from their website. Obviously, they would have preferred to keep those visitors on their site and engaged.

As some other clients have also expressed a desire to display YouTube videos on their sites, I decided to build the functionality as a FarCry plugin. This would allow me to move this feature set to any FarCry site.

At its foundation, the plugin works via two custom types and a scheduled task. The scheduled task runs and uses the YouTube API to grab the playlists and videos on the specified account (configurable via a FarCry config). If it finds those objects already in FarCry, it updates them with the latest data from YouTube, if its new, it adds it to the FarCry database. Any items found in FarCry that aren’t returned by the API are deleted. The plugin gives you the ability to reorder the videos on a playlist via the FarCry webtop. All data is managed on the YouTube side. I may consider adding the ability to completely manage the videos and playlists on the webtop, but that will greatly increase the complexity of the plugin, and I don’t see a great benefit to doing so. To me, it makes more sense to go straight to the source to upload new videos, manage your videos, etc rather than try to stuff all that functionality into a FarCry form. No need to reinvent the wheel, in my opinion.

The plugin also includes two rules. One lists videos based on selected playlists or videos, the other displays an embedded video.

To interact with the YouTube API, I made use of Raymond Camden’s awesome YouTube CFC.

I am happy to say that I have also posted this code on Github for the entire community to use. Give it a try! If you have any ideas for improvement please open a ticket, or better yet, fork the project and send me a pull request.

You can find the project on RIAForge and Github.

FarCry Poll Plugin

| Comments

I have released a plugin I have had for a while. I’m not sure why I never got around to releasing it. Its a very simple FarCry plugin that gives you the ability to create a one question poll and display it on the site. It uses a couple content types and a rule.

To install, copy the files to /farcry/plugins/spcPoll and add spcPoll to your this.plugins setting in your FarCry constructor. Deploy the content types in the COAPI manager and restart the application. You can now create a question, assign answers to it, and deploy that question using the “Poll: Display Poll” rule.

You can grab the code on Binpress or Github.

Let me know what you think!