dans.blog


The miscellaneous ramblings and thoughts of Dan G. Switzer, II

Running CFMX 6.1 and CFMX 7 Simultaneously Under IIS 6

Ever wanted ColdFusion MX 6.1 and 7.0 running simultaneously under IIS 6? I've always wondered how difficult this would be to set up (without using JRun) but had never tried configuring a server this way before.

Last week though, I was building a new Windows 2003 Server as a development server at my house. I decided I really wanted to get both CFMX 6.1 and CFMX 7.0 running simultaneously so I could easily test code in both versions of the language, without having to toggle the services off and on. Turns out it's not so difficult—all you need to do is configure different "Web Sites" for each version of ColdFusion you want to run. In the below example I use a different ports to differentiate the version of ColdFusion.

  1. Create two new Web Sites in IIS—one for the ColdFusion MX 6.1 Administrator and one for your development. Label both of these sites to indicate that they're running CFMX 6.1.
  2. Install ColdFusion MX 6.1. Make sure to install use the standard non-J2EE/JRun install. If you want to install using JRun, that's fine, but these directions may not work. You should be able to configure multiple CFMX instances in JRun though.
  3. After installation has completed, restart the server if prompted to reboot.
  4. Create a new Web Sites in IIS for the ColdFusion MX 7.0 Administrator. This should be a different directory from your CFMX 6.1 Administrator Web Site. This is to make sure you can administrate both versions of ColdFusion. Don't run this on a port/IP address being used by any of your other web sites.
  5. Create another new Web Site. This one should point to root directory of the development web site you created in step 1. Make sure to use a description that indicates this site is running CFMX 7. If you want to create this web site on the same IP address as the CFMX 6.1 dev server, make sure to specify a port other than 80. If you don't want to use an alternative port, then set this set up on another IP address.
  6. Install ColdFusion MX 7.0. Once again, make sure to install CFMX in the standard non-J2EE/JRun install (this is the first option.) Install the site under IIS 6, but this time specify that the site should be installed on only the ColdFusion MX 7 Administrator site you create—do not install on all servers.
  7. Once installation is complete, restart the server if prompted to reboot.
  8. Test you Administration sites to make sure that you're getting the correct version of ColdFusion MX to load for each administration site. The version number of ColdFusion (pulled from the Server.ColdFusion scope) should be shown on the screen.
  9. Open up the "Internet Information Services (IIS) Manager".
  10. Open up your CFMX 7 development web site properties, by right-clicking on web site and choosing "Properties."
  11. Go to the "Home Directory" tab.
  12. Click on the "Configuration" tab.
  13. Under "Application extensions" click on the "Executable Path" column heading to sort by path. The CFMX ISAPI filter should be at or near the top of the list. By default, this site should be mapped to the CFMX 6.1 installation. To change this site to use CFMX 7, double-click on each entry for invoking the jrun_iis6.dll file and change the path to the CFMX 7 directory. If you installed both versions of ColdFusion to the default location (or to the same drive,) you can just go through and change the "CFusionMX\" to "CFusionMX7\". You should have entries for this DLL for the following extensions: cfc, cfm, cfml, jsp, and jws.
  14. Under the "Wildcard application maps (order of implementation)" section, double-click on this entry and point the "jrun_iis6_wildcard.dll" to it's CFMX 7 version. Like in the above example, by default you should be able to change the path from "..\CFusionMX\" to "..\CFusionMX7\".
  15. Click on "Start > Run" and type "iisreset /restart" and then press [ENTER]. This will ensure that IIS is restarted and all of your changes are registered.
  16. In your development web sites's root folder, create a file with the following command: <cfdump var="#server#" /> and save the file.
  17. Run the template you create above in both your CFMX 6.1 web site and the CFMX 7.0 web site. If everything went as planned, it should show different versions of ColdFusion being reported.
  18. Now you can just switch between IP address or ports (depending on how you configured your development web sites) to switch back and forth between versions of CFMX 6.1.


Programmatically Reading ColdFusion's Mail "Spool Interval" Setting

I was working on some code today and needed to determine what the value of the "Spool Interval" was in the CF Administrator. After playing around for a few minutes, this is what I came up with. This code uses non-documented functionality, but I've tested the code under CFMX 6.1 and CFMX 7 and it seems to work fine. Obviously, if Macromedia changes internal workings of ColdFusion, this code may break in the future.

<!---// create a reference to the CF ServiceFactory //--->
<cfobject
    action="create"
    type="java"
    class="coldfusion.server.ServiceFactory"
    name="oFactory"
    />

<!---// get the mail spool service //--->
<cfset oMailSpool = oFactory.getMailSpoolService()>
<!---// get the mail spool interval schedule in seconds //--->
<cfset iSpoolInterval = (oMailSpool.getSchedule() / 1000)>


Bug in CFDUMP tag - Doubling Your Output...

I discovered a small bug with CFMX today. It's certainly not a deal breaker and Macromedia is aware of the bug. (A birdy told me that they believe the bug has been fixed for Merrimack.)

When you have a UDF that writes to the output stream (using writeOutput() or <cfoutput>) and invoke the function directly from the <cfdump /> tag, the output is displayed twice. This had me pulling my hair out for about 30 minutes trying figure out why my output was being generated multiple times—I thought I had a bug in my code.

Anyway, to see the bug in action, run this code:

more…


BlackDog - Portable USB-Powered Linux Server...

Came across this pretty cool little product called BlackDog. It's basic a 400Mhz PowerPC Processor with Debian-based Linux in a plug-n-play USB box. Could be very useful portable development server. Check it out.

BlackDog offers open source developers an exciting new platform for mobilizing software applications. BlackDog represents a new breed of device that redefines what a 'computer' is. It can be programmed to carry your applications, data, web sites, desktop look and feel, with you, wherever you may go.

Develop applications and deploy them on BlackDog then launch and automatically project them onto a Windows PC. Design an interface, spin and run a web site, run a video game.

Program It — Port It — Plug It — Pull It, throw it in your pocket and do what you will with it — With BlackDog you 'can' take it with you!


Firefox Tip: Use Multi-line URLs When Pasting Into The Address Bar

Andrei Zmievski posted a cool little blog entry on how to get Firefox to parse a mutli-line URL. This tip is very handy when cutting and pasting URLs from an e-mail or from a message board where the URL spans multiple lines.

Here's another Mozilla/Firefox tip: if you copy a URL wrapped over multiple lines from somewhere and try to paste it into the address bar, you will end up only with the first line of it. To fix it, go to about:config and change editor.singleLine.pasteNewlines setting to 3 or add:

user_pref("editor.singleLine.pasteNewlines", 3);

to your user.js file. Now all the line breaks will be removed upon pasting.

This has always been a big pain in the arse. In the past I've always ended up having to open up a text editor, paste the URL and then strip out the new lines. This will be a real time saver!


Is This Really Mac OS X v10.4.1 Running On A PC?

Gizmodo posted a screen shot of someone supposedly running Mac OS X v10.4.1 via a VMWare session. While I'm hoping this news is true, I'm suspected this is probably a fake screenshot. I've looked through VMWare's web site and can't find anything about upcoming support for the Mac OS X. I suspect this is just a rumor based on the fact that Apple has announced their plans to move to Intel-based processors.

However, the fact that Apple is making this move, it would see feasible that you could write a virtual machine to emulate the Apple specific hardware. It sure would be nice to be able to open up an Mac OS VM to test sites on the Mac. ;)


Getting A Thread Dump From CFMX Using StackTrace...

Brandon Purcell spawned off a serious of interested blog posts today when he posted his Obtaining a Thread Dump with ColdFusion or JRun running as a Windows Service. He talks about called StackTrace which you can use to get a trace dump of any running Java process (including applets running in the browser.) I download the application, but have yet to install it.

Anyway, Brandon's post spawned off an interested post by Steven Erat in which he points to the Debugging Stack Traces in ColdFusion MX technote on Macromedia's web site.

Both of these posts are worth reading and will definitely be useful for debugging in those times were CF crashes unexpectedly.


Remote Control You User's PC via a URL...

Sean Tierney blogged about a pretty cool little open source project called UltraVNC Single-Click.

Basically if you're running Windows and you need tech support from me, I point you to an executable on my site and it gives me VNC control over your system. What this means is no more 30min tech support sessions with relatives walking them through the process of troubleshooting a faulty device driver or some other obscure problem over the phone ("what do you see now?"). No matter what computer they're working on you send them to a URL and take control of their system remotely and let them watch how you fix it. And if you want to take it a step further and preserve the solution as a movie so they can reference it later, use this cross-platform VNC2SWF screen recorder (like camtasia only for a VNC session).


Text Fades For Scrolling Content...

Simon Collison blogged a pretty cool CSS technique he called Image fades for overflow: auto. Essentially this technique allows you fade the text as it nears the edge of the box before it would hide from view. Here's the image Simon shows on his site:

This technique could probably use some improvement. It's probably something you could wrap up in a JS library to apply to elements automatically. Regardless, it's a cool looking effect. Kudos to Simon!


CFEclipse BER Now Available via CFEclipse.org

Spike Milligan posted on his blog today that CFEclipse has completely moved to CFEclipse.org. He's no longer going to be offering nightly builds/bleeding edge releases (BER) on his site. The good news is, you can now get the BERs directly from CFEclipse.org.

See the Downloads page for instructions on how to download stable and BER releases automatically using CFEclipse.


Install Multiple Version of Internet Explorer On You PC!

You learn new stuff every day. Thanks to Brendan Smith for pointing out to me that some creative web guys have come up with a solution for running multiple versions of IE on a PC without having to run anything in a virtual machine.

Ryan Parman over at skyzyx.com has been nice enough to encapsulate all the version in nice little zip files that you can just extract to a directory and run. It doesn't appear that people have 100% success using this hack, but it seems to work for most people. The only noticable issue is that the "Help > About" will always list the current version of IE installed, but apparently the user agent reports back the expected results.

Download Standalone Microsoft Internet Explorer v3 - v6

more…


Old News, News To Me: IE7 Being Released For WinXP SP2

Ok, this is I guess is old news, but it's news to me. Apparently Microsoft has changed their stance on releasing another version of Internet Explorer for their current OS line.

Originally, Microsoft had taken a stance that IE 7 would be a "Longhorn" (now officially named Windows Vista) product only and that v6 was going to be the last release for all current versions of the Microsoft OS. It's now looking like that stance has changed.

Building on those advancements, Gates announced Internet Explorer 7.0, designed to add new levels of security to Windows XP SP2 while maintaining the level of extensibility and compatibility that customers have come to expect. Internet Explorer 7.0 will also provide even stronger defenses against phishing, malicious software and spyware. The beta release is scheduled to be available this summer.

more…


Using XML Entities To Define "Variables" In Your Documents...

Wayne Graham has posted a nice blog entry on how to use XML entities to provide "dynamic" variables in your XML documents. The article is really geared towards users using the CFMX Model-Glue framework, but the technique of using XML entities will work with any XML document.


Fiddler - Great Free HTTP Proxy/Monitor for Windows...

I ran across this a reference to Fiddler a couple of days ago and I downloaded it, but hadn't had a chance to install it and evaluate it. I just figured I'd play around with it the next time I needed an HTTP proxy/monitor. Well, this morning I finally had a need for one.

This morning a friend of mine pinged me over IM having a problem using cfform to generate a Flash-based form that was talking w/a CFC. He had a simple example that was working, but when plugged into the live content it wasn't.

Anyway, a quick look w/the Firefox Live HTTP Headers extension told me that his Flash form wasn't seeing his CFC. Easy enough fix—or so I thought. After changing the path to the CFC it still wasn't working, although I could tell the Flash form was now seeing the CFC because I could see the 200/OK responses. However, I couldn't actually see what data was coming back from the server.

more…


qForms v2.0 - Skinning Example

From time to time I've seen people complain about how boring and unflexible HTML forms are in terms of looks. Some of the designers I've talked to really hate the default button elements, especially when it comes to the radio and checkbox elements.

I was doing some surfing last week and came across some example code on Eric Dolecki's blog which he labelled CSS Radio Buttons. Essentially he was using some JavaScript to hide the default input elements and replace them with images. The code was pretty neat, but a little cumbersome and involves having to add a lot of hooks. So, I spent a couple of hours over the weekend and through together a very rudimentary "Skins" plug-in for qForms.

I've only tested the code in Firefox and IE at the moment, but it seems to work pretty well. In order to see the full effect, your browser will have to support the insertBefore() method. Essentially what the code does is parses through the field elements in a form looking for the type of element you're skinning (currently only checkboxes and radio elements are support.) It'll then hide the element by setting the display property to "none". It'll then insert an image into the DOM right before the input element which has event's attached to the onclick event which will replicate the input element's functionality.

more…