Installing ColdFusion on IIS 7 (Vista)

Posted By : todd sharp Posted At : May 11, 2007 9:14 PM Posted In: IIS, ColdFusion

21

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 (21)

Jason Holden's Gravatar 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.

todd sharp's Gravatar 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).

Jason Holden's Gravatar 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?

todd sharp's Gravatar 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.

Stephen Moretti's Gravatar 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.

Stephen Moretti's Gravatar I of course typo'd - I meant Apache 2.2.4

todd sharp's Gravatar 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...

Daniel Sorrentino's Gravatar 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!

todd sharp's Gravatar Do you have a virtual directory for /CFIDE for your site?

Daniel S's Gravatar 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?

Kam's Gravatar 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...

Dan's Gravatar 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? :)

Kam Figy's Gravatar 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.

Dan's Gravatar 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!

todd sharp's Gravatar 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?

Dan's Gravatar 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

Dan's Gravatar I almost forgot, the testing server uses IIS6 that's why there is no issue :)

Kam Figy's Gravatar 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.

Pete Tanswell's Gravatar 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.

Edward Beckett II's Gravatar 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?

todd sharp's Gravatar 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.