Installing ColdBox with CommandBox when I already have a localhost ColdFusion server

This is the continuation of a discussion I had with Brad Wood on

I’m trying to do a pristine, simple install of ColdBox with CommandBox, using the instructions provided. Brad says that the instructions don’t say to make a subfolder, but I don’t know how else to interpret this:

Next, let’s create a new folder and install ColdBox into our first application.

mkdir myapp
cd myapp
install coldbox

Is myapp supposed to be the Web Root? I interpreted that to mean a folder off of the Web root. That’s where I put my “apps”.

I will gladly start over again and install coldbox in the Web root.

but then when I do the next step (using Simple instead of AdvancedScript):

We will be using the AdvancedScript template to start, so go into CommandBox and type:

coldbox create app name=MyApp skeleton=AdvancedScript

I think it will put a bunch of folders and files directly into my Web root. I really don’t want to do that. That isn’t compatible with how we do version control, etc.

I will gladly do different steps. I will gladly try a coldbox folder in my web root (simply moving it after these steps doesn’t work, either).

The error I’m getting with my “lpi3” subfolder under my web root “c:\labtestsec” is:

The guides don’t really assume a web root. You’re thinking in terms of a PC that has a single instance of CF installed on it. For simplicity, our guides usually use CommandBox since it allows you to start ad hoc servers anywhere on your harddrive that are completely independent. So, if we have you create a sandbox folder to play in and dump the framework files there, then you can just run “server start” and boom, that folder is now the web root of your new server.

I would recommend using the CommandBox server just to get a feel for how things work and then once you understand it, you can worry about figuring out how to get it all put into your existing application. Either way, it’s very simple. The path /coldbox must resolve (either via a mapping, or the web root) to the ColdBox framework. Do that and your code will work.

I think it will put a bunch of folders and files directly into my Web root.

Well, yes it will put the files in whatever directory you’re in. That’s why we have you create a folder when you’re testing stuff out so you don’t overwrite anything. But if you start up the server with CommandBox like most of our guides show, then that folder is the webroot of a new self-contained server for you to play with,

That isn’t compatible with how we do version control,

I’m not sure what you mean by that. But we don’t force you to do anything in regards to source control. It’s up to you to figure out how you want to use the framework. We can’t cover every possible installation method out there, so we stick to a basic and simple in-the-web-root example in our guides and you can move it around as you see fit, so long as the ColdBox framework remains accessible via a mapping, etc.

will gladly try a coldbox folder in my web root (simply moving it after these steps doesn’t work, either).

I’m still missing too much information to piece together what you’re doing. Firstly, if you’re using Adobe ColdFusoin, ensure that component cache is not turned on in the admin. They turn that on by default and it wreaks havoc on frameworks that are shared if you have more than one version floating around. Secondly, can you report:

  1. What is your web root folder?
  2. Where is ColdBox installed?
  3. If ColdBox is not in the webroot, then what kind of mapping (server, application) have you created to make it accessable
  4. Where are the files for your app located
  5. Have you restarted the server to clear out stuff in memory and turned off trusted cache?
  6. What URL are you hitting?
  7. What is the error that goes with that URL and folder structure.
    I’m honestly at a loss for why this is not just working for you. It’s really as simple as dropping the framework in, scaffolding out a site, and running it. These two commands shouldn’t literally get you a working ColdBox app in an empty directory in seconds:

coldbox create app
server start

And if you want to play with Adobe 2016, then just do “server start cfengine=adobe@2016”

Once that’s working, you can fit it back into your local server. Or, perhaps you’ll just keep using CommandBox since it’s way way easier to manage than a standard server install. It takes care of updates, syncing settings and everything for you.



ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

ColdBox Platform:

Thank you! I added these 2 lines to application.cfc and it’s working!

rootDir = getDirectoryFromPath(GetCurrentTemplatePath());
this.mappings[ “/coldbox” ] = “#rootDir#coldbox”;