Installing ColdFusion on IIS 7 (Vista)

So since I got my new Dell at home I've been using my old Dell as a 'pseudo-server' and connecting to it over my home network for local development. This has been working out fine - but there has always been something that bugged me about using the built in web server that ships with ColdFusion as a development server. Every time you wanted to create a new 'site' you pretty much have to code around the fact that you're really under one wwwroot. For example lets say you have the following directory structure:

  • wwwroot
    • site1
      • components
        • myComponent.cfc
    • site2
      • components
        • myComponent.cfc

In the example above I might have the following code under site1:

<cfset obj = createObject("component", "site1.components.myComponent")>

Pretty standard stuff really - just creating an instance of the myComponent.cfc under site1. Well the pain of the matter happens when you decide to move site1 up to a production environment. In most cases you'll want the contents under site1 to be the actual root of your site. Otherwise your URL might look something like http://mysite.com/site1 - which may be what you intended - but usually isn't. So now you've also got the pain of coding around a poorly planned site that could potentially have many references to the single root development environment.

So the standard fix to creating a workable development environment is to run ColdFusion in the multi-server configuration (which is available as an option when installing CF).

I've chosen to focus a few posts on setting up ColdFusion on IIS for a few reasons. First of all I like GUI's. I'm not afraid to admit it. I've tried to mess with Apache and it seemed like a pain in the rear for a GUI geek like me. No, I know it's really not that hard - but hell - it's my Vista and I'll GUI if I want to (sorry Brian you couldn't talk me out of it ;) Actually to be fair I did attempt to install Apache but ran into issues getting the latest release to install on Vista (insert Vista sucks comments below). I also liked the fact that IIS 7 appears to be able to handle multiple sites in a development environment. To top it all off it's free - at least it is on Vista Premium which is what I'm running.

So I'm going to post at least a few more posts on how to get ColdFusion running on IIS7 (on Vista). There not going to be anything groundbreaking for some folks who know this stuff like the back of their hands but for beginners I think it should be an enlightening journey.

Step One is simple. So simple in fact I'm not even going to post the instructions since it's already been done for me. So if you're playing along at home your first step will be to hit that tutorial and get IIS running. The next step is to do a simple ColdFusion install and follow the prompts for a multi-server config. CF should recognize IIS running on your machine and you'll want to tell the install wizard to make CF available for all sites under IIS. Everything else is a pretty standard CF install.

Update: Please read this comment...

Related Blog Entries

Comments
I wrote a small batch script to switch my webroot. Only works with IIS. I haven't tested it on Vista:

http://www.jasonholden.com/downloads

It will set the webroot to the directory from which it is run.
# Posted By Jason Holden | 5/11/07 10:57 PM
So that script is to change the 'active' site in IIS? The cool thing about IIS7 is that you are not limited to a single active site at a time - set up as many as you want from what I understand. I have two tests set up right now and both work at the same time without swapping (more on that in my next post).
# Posted By todd sharp | 5/11/07 11:01 PM
I didn't know that IIS7 had removed that restriction. That is neat. How do you address each site? (i.e. http://localhost) By IP?
# Posted By Jason Holden | 5/11/07 11:17 PM
You can either assign a seperate port for each (81, 82, etc) or assign a unique host header for each (http://site1/). Very cool stuff.
# Posted By todd sharp | 5/11/07 11:29 PM
I'm running CFMX7 MulitServer with Apache 2.4 on Vista.

To install Apache on Vista what you have to do is turn off something called "User Account Control" in the User Account control panel and then do the install.

Once you're done installing switch it back on otherwise vista will bug the hell out of you until you do switch it back on.

Oh and you have to take the apachemonitor out of startup because it blows up on vista.

Of course when I did this I didn't actually know about right clicking on an exe and choosing "Run as Admin", so it may be that you can just do that with the Apache Installer.
# Posted By Stephen Moretti | 5/12/07 3:31 AM
I of course typo'd - I meant Apache 2.2.4
# Posted By Stephen Moretti | 5/12/07 4:01 AM
I forgot to mention that you'll need to take a few extra steps to get 7.0.2 running on Vista. They're outlined in the following article:

http://www.communitymx.com/content/article.cfm?cid...
# Posted By todd sharp | 5/21/07 10:22 AM
Thanks for the info, I got CF working on vista, but the only thing that I just can't seem to figure out is how to make cfform tags working now...
I created a Virtual Directory in my webroot, but that doesn't seem to do anything. It always says that movie couldn't be loaded.

I'd really appreciate some input on this...

Thanks guys!
# Posted By Daniel Sorrentino | 6/8/07 5:16 PM
Do you have a virtual directory for /CFIDE for your site?
# Posted By todd sharp | 6/8/07 5:25 PM
Yes I have it setup as a virtual directory. Is anybody else having problems with flash forms or charts, etc? Or is it working normally for you?
# Posted By Daniel S | 6/8/07 7:16 PM
To get flash forms to load, you need to map *.cfswf to the jrun dll just like *.cfm

Now getting them to load data is another question. Adding a JRunScripts virtual directory (and enabling CGI) keeps the data call from 404ing, but its still an empty response...
# Posted By Kam | 6/18/07 2:41 PM
Yes I've tried mapping the .cfswf files, but the result set is just empty and it says something like could not load movie.

I really wonder why this problem is so hard to find some info on if you google around...

I don't suspect anybody else has figured it out and could share? :)
# Posted By Dan | 6/18/07 2:46 PM
I got it working with data.

First, you need to create a virtual directory called JRunScripts and point it at CF_ROOT\runtime\lib\wsconfig\1

Next, go to the handler mappings at the IIS root, right click "ISAPI-dll", click handler permissions, and check "execute."

Finally, open Notepad *as an administrator*. Open c:\windows\system32\inetsrv\config\applicationhost.config. Search for "*.dll" and you should find the ISAPI handler mapping node under the <handlers> section. Add allowPathInfo="true" as an attribute on that node and save it (IIS will automatically reload it, you dont need to restart it). Voila, flash forms should load data.
# Posted By Kam Figy | 6/18/07 3:22 PM
Almost works for me now... wahhh.

I've followed your instructions and now the flash form loads, but is stuck in an endless loop it seems and I get the little loading icon, but nothing comes up.

If I pull up a flash form with lots of data in it, it just crashes the IE.

Any other ideas? Or perhaps a little more detailed descriptions? I may be stupid ;)

Thanks for al lyour help so far though!
# Posted By Dan | 6/18/07 4:28 PM
It almost sounds like you have an error in your code. Did you try adding ?debug="true" to you page to see if there are any ActionScript errors on the page?
# Posted By todd sharp | 6/18/07 7:10 PM
No there is no error. It's doing it on every flash form and if I use the test server it works, but I need to make it work on my localhost...

It has to be some kind of config error in IIS, but I can't figure out what's wrong.

Anybody have a quick rundown of what settings I have to have set, what handlers need to be there?

Any help is very much appreciated
# Posted By Dan | 6/19/07 9:17 AM
I almost forgot, the testing server uses IIS6 that's why there is no issue :)
# Posted By Dan | 6/19/07 9:19 AM
Try using Fiddler (www.fiddler2.com) to snoop the requests the flash form is using. If it's stuck in an endless loading loop that usually means its having issues with the /CFFormGateway service.

If its getting a 404 on that then your JRunScripts virtual directory isn't set up correctly; if its getting a blank response then the pathInfo setting I mentioned above isn't set correctly.

Also, are you using the jrun_IIS6_*.dll or the jrun.dll to connect? Mine is using the (older) jrun.dll connector.
# Posted By Kam Figy | 6/20/07 1:30 PM
Hi there

I have CF7.02 working on Vista - well its partly working on Vista with IIS 7.

The problem I found when I try to browse the server - I get an error IO server communication error. I cant browse to find an access database, and I cant browse to set up a mapping.

This is really bugging me as I havent been able to find away to get around this error.

If I then open Dreamweaver, in the application panel I cant view database via the RDS server.
# Posted By Pete Tanswell | 6/25/07 9:54 PM
Hi...I too like pete was not able to do the very same..I have an IO error when browsing and cannot resolve the url when setting up the RDS from within DreamWeaver...I have also gone through the Metabase workaround on communitymx
{Thanks Heidi Bautista} // the MS SQL 2005 MS SQL / ODBC Driver workaround { Thanks to Charlie Arehart } // and the now the Host header workaround {Thank You Todd} Any clues to get the aforementioned errors resolved?
# Posted By Edward Beckett II | 7/13/07 12:39 AM
Edward - Have you tried the beta version of ColdFusion 8? You may want to give that a shot - I'm running it locally and it installs flawlessly - no hacks or workarounds (for me).

I'd give that a shot.
# Posted By todd sharp | 7/13/07 5:55 PM

Calendar

Sun Mon Tue Wed Thu Fri Sat
     12
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31       

Subscribe

Enter your email address to subscribe to this blog.

Tags

actionscript ajax blogging cfsnippets coldfusion flash forms flex funny stuff misc model-glue off topic personal project learn slidesix sql

Recent Comments

ColdFusion/Sharepoint Integration - Part 1 - Authenticating
todd sharp said: Jenn: Check your email. Todd [More]

ColdFusion/Sharepoint Integration - Part 1 - Authenticating
Jenn said: When does the next issue of FAQU come out? For that matter is it at all possible to get a preview o... [More]

A Major Milestone In My Marriage
Brian Meloche said: I converted my wife last year. That said, I find Firefox 3 a bit crashy. [More]

SlideSix Gets PDF Support
todd sharp said: Do you mean add numbering to the PDF output? If so, yeah, that would be easy. Just to be clear tho... [More]

SlideSix Gets PDF Support
salvatore fusto said: nice work Todd, but can you add slide numbering: 1/N, 2 of N and so long? it would be useful. regard... [More]

RSS


coldfusionbloggers

FullAsAGoog MXNA

Consumed By Feed-Squirrel.com