CFIDE
Whew. Spending quite a while trying to figure out why the ajax stuff in ColdFusion was working on localhost, but not on any of the VirtualHosts. There’s a mapping in the CF administrator that (I thought) was supposed to take care of it, but apparently it does not.
And now, come to think of it, there’s no way that it could.
But Google-fu to the rescue. Thanks to both Jim Pickering and Cutter’s Crossing for the answer. I reproduce it here.
The CF installations puts CFIDE under htdocs, but only the main site can find it there since the root of any virtual host is probably somewhere else. It’s specifically a web server problem, as the default mapping under CF will be used to locate CFCs and CFModules. But for Ajax and the CFForm forms validation, you have to map things for any VirtualHosts you might be using within the web server itself.
To do that:
In the VirtualHost section of Apache.conf
<VirtualHost *:80>
ServerName virtualhost.com
ServerAdmin userid@domain.com
DocumentRoot “d:/htdocs/virtualhost”
ServerName virtualhost.com
ServerAlias virtualhost.com *.virtualhost.com
Alias /CFIDE “d:/htdocs/CFIDE”
<Directory “d:/htdocs/CFIDE”>
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog logs/virtualhost.error.log
CustomLog logs/virtualhost.access.log
</VirtualHost>
I suppose you could specify something else with the scriptSrc parameter of <cfajaximport> (it may or may not work, I haven’t tried it), but it will certainly fail with the <cfform> validation as that’s unrelated to ajax.
Don’t know why I didn’t think of this. It’s blindingly obvious in hind sight.

