0

We are using ColdBox 4.3 and are deploying multiple ColdBox applications.

Each application is developed separately with its own Coldbox.cfc config file and its own handlers, models, and views. While they do share some common features, they can not (currently) be run as a single big application run out of the root level of the website.

Our webroot directory looks something like this:

/
/coldbox
/app_1
|      Application.cfc
|      /coldbox
|      /config
|      |       /Coldbox.cfc
|      /handlers
|      /models
|      {etc}
|
/app_2
|      Application.cfc
|      /coldbox
|      /config
|      |       /Coldbox.cfc
|      /handlers
|      /models
|      {etc}
|
/app_3
|      Application.cfc
   {etc}

We have a copy of /coldbox at the root level and a duplicate copy of /coldbox inside each application folder.

If I delete either the root level /coldbox -or- the copy of coldbox inside each application, the application will crash.

How do other developers handle the case of multiple Coldbox applications running on the same webserver???

1 Answers1

3

You need to create a CF mapping that maps /coldbox for each app to wherever ColdBox lives. If all your apps use the same version of ColdBox, then I'd just point them all at the same place. And it doesn't even need to be in the web root. As long as /coldbox resolves to the framework, you'll be fine.

And no another note, if you're on Adobe ColdFusion and hosting more than one app on the same server, you'll want to turn off "Component Cache" in the CF administrator. It will really mess you up.

Brad Wood
  • 3,863
  • 16
  • 23
  • Ok... so how should I do a CF mapping??? If I update Application.cfc to add `this.mappings["/coldbox"] = "/coldbox";` I get errors interface errors for "LRU". I can't add a CF mapping in the ColdFusion Administrator without interfering with old ColdBox 3 applications running on a different port... – Stephen F Roberts Oct 18 '17 at 19:05
  • It sounds like you might have another server level mapping for /coldbox already. You'll need to troubleshoot and see what you have set up. And seriously, uncheck that "Component Cache" checkbox. It's on by default which is stupid stupid and it screws people up ALL the time. In fact, do not test or try ANYthing else util you've disabled it and restarted. – Brad Wood Oct 18 '17 at 19:23
  • I unchecked Component Cache, added a `this.mappings["\coldbox"]` to the physical directory of coldbox, restarted all services and running on a dev box that only I hit so there is no other mapping anywhere (that I know of). But I am still getting errors when I remove coldbox from my subdiretory I get errors finding `C:/_wwwroot/coldbox_4/template_cb4/coldbox/system/Interceptor.cfc`. (`c:\_wwwroot\coldbox_4` is my webroot) – Stephen F Roberts Oct 18 '17 at 19:53
  • Ok... so rebooted _again_... just in case... and it is not reporting that interceptor error... Fingers crossed that the component cache and mappings actually took this time... – Stephen F Roberts Oct 18 '17 at 19:57