[Coldbox 4.1] Initial installation new application

Howdy All,

I’ve been around CF for quite a while but the last framework I used was fusebox for lots of reasons.
I’m trying to install Coldbox on my local machine to see about converting an even older frankenstein site.

I am running CF10

I used commandbox to install the coldbox application to C:\inetpub\wwwroot\testapp\ per the installation instructions for a new site.

I have added the coldbox mapping to application.cfc and here’s the application properties


// Application properties
this.name = hash( getCurrentTemplatePath() );
this.sessionManagement = true;
this.sessionTimeout = createTimeSpan(0,0,30,0);
this.setClientCookies = true;
this.mappings["/coldbox"] = "C:\inetpub\wwwroot\testapp\";
// COLDBOX STATIC PROPERTY, DO NOT CHANGE UNLESS THIS IS NOT THE ROOT OF YOUR COLDBOX APP
COLDBOX_APP_ROOT_PATH = getDirectoryFromPath( getCurrentTemplatePath() );
// The web server mapping to this application. Used for remote purposes or static purposes
COLDBOX_APP_MAPPING = "";
// COLDBOX PROPERTIES
COLDBOX_CONFIG_FILE = "";
// COLDBOX APPLICATION KEY OVERRIDE
COLDBOX_APP_KEY = "";

http://127.0.0.1:58676/index.cfm/hello works using commandbox and

My issue is I don’t want to use a port specific, localhost address, I want to go to http://localhost/testapp/index.cfm/hello through the local coldfusion service and not commandbox.

When I use the above I get

# Could not find the ColdFusion component or interface coldbox.system.web.services.BaseService.
Ensure that the name is correct and that the component or interface exists.

The error occurred in C:/inetpub/wwwroot/testapp/coldbox/system/web/Controller.cfc: line 88
Called from C:/inetpub/wwwroot/testapp/coldbox/system/Bootstrap.cfc: line 69
Called from C:/inetpub/wwwroot/testapp/Application.cfc: line 28
|


<br>86 : <br>87 : // LogBox Default Configuration & Creation<br>**88 : services.loaderService = new coldbox.system.web.services.LoaderService( this );**<br>89 : variables.logBox = services.loaderService.createDefaultLogBox();<br>90 : variables.log = variables.logBox.getLogger( this );<br>

|

I know I’m probably missing something super easy, in some ways I may as well be learning CF over again as this will be a big change, but this is the first time in years that there is support from the top to work on rewriting the site. There is currently code running in the webroot so I think I have to install coldbox its own subdirectory because the rewrite won’t happen over night but will be module by module. So there will be a time when the new site will be running in parallel to the old site.

cheers,
Jim B

Hi Jim, and welcome to ColdBox!

For what it’s worth, you can run CommandBox on port 80 (assuming IIS or Apache aren’t already bound there). You can start your server like this:

start port=80

Or set the default port in your box.json

package set defaultPort=80 ← first time only
start

So, now on to your question which is running the site inside CF10/IIS. There should be no issue running ColdBox from a subfolder as long as /coldbox maps to wherever the coldbox framework lives. (The “system” folder should be right inside that folder)

> this.mappings["/coldbox"] = “C:\inetpub\wwwroot\testapp”;

This doesn’t look correct The mapping needs to point to the root folder of where coldbox is installed to. If you installed ColdBox via CommandBox using “install coldbox” or as part of the “coldbox create app” command using the “–installColdBox” flag, it should be located here:

C:\inetpub\wwwroot\testapp\coldbox

Also note, if you are using the inheritance method where your Application.cfc actually extends coldbox.system.Bootstrap, the mapping must exist at the server level, but the non-inheritance method (where ColdBox is created in the onApplicationStart() method) will work with an app-specific mapping.

And finally, if you haven’t already seen our ColdBox getting started guide, you can check it out here:

http://coldbox.ortusbooks.com/content/getting_started_guide/index.html

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Thanks Brad,

That nudge did the job.

Changing the mapping in application.cfc to

this.mappings["/coldbox"] = "C:\inetpub\wwwroot\testapp\coldbox\";

did the job… I knew it was something stupid that I’d overlooked.

Now I can start learning Coldbox :smiley: yea!
It should be an interesting trip and long overdue.

cheers,
Jim

Just ask if you have any more questions. Also, the getting started guide I linked to is part of our ColdBox online docs. You can download them to your E-reader and become a ColdBox expert!

https://www.gitbook.com/@ortus

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com