Sunday, October 01, 2006

ColdFusion MX 7, VMWare, VM Shared Folders, Win2003 and Model Glue: Unity

I found myself using a VMWare workstation setup to run my CF7 server with IIS, JRun (Multiserver) configuration and SQL Server 2000 to handle development for a new project. I could have used my live production server, but wanted it to be completely separate as I am learning to use Model Glue as my framework.

Initially, I was simply doing an "upload" via Eclipse to the "server", but the Deployer plugin I use for Eclipse only allows a single file upload, no folders per round. I often modify four or more files at a time and quickly tired of picking each file, right clicking, choosing Upload, and hitting the spacebar to push the OK button on the "Overwrite...?" dialog. Times 4. Wore me out. ( I have never been able to get the builtin FTP of Eclipse to be my friend.)

So my next option was to see if I could use the Shared Folders feature to have the website setup in IIS point to that shared folder as the site. Then I could simply save the file after editing within Eclipse and click Refresh/Reload in the browser.

( I should note that the "shared folder" of which I speak is on the host machine. I wanted the VM "server" to see that folder on my real machine, as all my development code is on an external USB drive connected to my network. - WB)

Let me say this...the right combo can be a bit tricky. I think, honestly, more so because I didn't want the ColdSpring, Reactor and ModelGlue folders in the root, which means adding CF Mappings. (I wish there was another way to do this without adding mappings for the WHOLE server!!!)

Here was the solution that I came up with after much trial and error. (I had to reinstall the VM setup this morning and had to trial-and-error it until I got it right again because I didn't have my earlier successful attempt as a reference. (Blogging here means *I* can find it again if I need it...)

With the VM Workstation or higher, a "network share" looks like this:
\\.host\Shared Folders\MySite

Now you can map these to a drive letter, but don't even try it. Works fine for Windows in general, but not for IIS and CF mappings.

I buried the Reactor, ColdSpring and ModelGlue folders within [siteroot]\_system\, which meant adding those pesky mappings.

In the VM's IIS config, you set the Home Directory of the site to:
\\.host\Shared Folders\NewDevSite
...assuming your site is "NewDevSite", which I'm sure it isn't. You have to make sure that you have the radio button "A share located on another computer" checked first.

That allows IIS find the site itself. Then you have the ColdSpring globalConfig rootPath mapping in the ColdSpring.xml file:

\\.host\Shared Folders\NewDevSite\


And finally...the CF mappings:
\\.host\Shared Folders\NewDevSite\_system\ModelGlue

The problem was that I had [mis]remembered being able to use a mapped drive in IIS, but you cannot do this, at least I wasn't able to to that. I tried and tried, but to no avail.

Hope that helps someone out there!

- Will Belden
October 1, 2007

No comments: