How do I create independent coldbox apps in subdirectory of IIS 10 ColdFusion 2023 webroot?

I am having some issues, and I am sure I am doing something wrong, and I’m sure it is simple, but I cannot find any solutions online after several searches.

I want to modernize multiple applications, and they need to live in subfolders on our Coldfusion/IIS server’s webroot. I was hoping that I could assign each app to a developer or team, and they could refactor each app one at a time, and then place the finished product in a subfolder in the webroot.

What setting to I need to modify so that my coldbox app will run in the subfolder?

Right now, all of our existing apps live on a windows server machine. IIS is configured so that d:\wwwroot is the webroot.

ColdFusion 2023 is installed, and IIS 10 is correctly serving the pages from ColdFusion for all existing apps.

I have tried making the MyPlayground app by following the Ortus getting started documentation. The app behaves as expected when run via command box (server start -cfengine=Adobe).

When I place that app as a whole on our CF Server (example: d:\wwwroot\myapp) the application starts up, but if I attempt to follow the link for ‘Main’, it does not work.

From IIS, the detailed error is:

Module	   IIS Web Core
Notification	   MapRequestHandler
Handler	   cfmHandler
Error Code	   0x80070002
Requested URL	   http://localhost:80/index.cfm/myapp2/Main
Physical Path	   C:\wwwroot\index.cfm\myapp2\Main
Logon Method	   Negotiate
Logon User	   *************

It is not practical to spin up a server for every application (we’re talking 10+ apps) for many reasons.

Is it possible to drop coldbox applications into a web server set up in this way? And if so, what settings do I need to set for this to work?

Any insight would be greatly appreciated.
Thanks,
Allen

I’m not sure what issues you’re running into, but minimally if you plan to use full SES rewrites on each app, you’ll need to modify the default IIS rewrites to account for each subfolder so

app1/main/index

rewrites to

app1/index.cfm/main/index

and

app2/foo/bar

rewrites to

app2/index.cfm/foo/bar

And secondly you may need to adjust the app mapping in the Application.cfc bootstrap and ensure each Application.cfc’s this.mappings has their own /coldbox, etc mappings. I also recommend creating a /root mapping for each site that points to their respective web root so you can change your model mappings to root.models so everything is relative to the right folder.

And finally, don’t develop these in separate CommandBox servers in the web root because you’d inevitably have issues when you move to prod. Set up your web root the same way for local and stage so you know your mappings work correctly. I would give each app their own box.json and all their own dependencies so they can be truly dependant.

Thank you so much for the advice Brad, I really appreciate it.

I managed to figure out that the Web.config containing the rewrite rules needs to live in the app’s actual folder, and not at the webroot of the server itself. Once I moved the web.config, the rules behaved correctly and all of the links now work.

I am going to move forward with a proof of concept now, and I will keep in mind your suggestion about the configurations and config files for each app.