Installing ColdBox to Apache Alias folder

137 views
Skip to first unread message

Jeff Willener

unread,
Sep 10, 2016, 2:48:26 PM9/10/16
to ColdBox Platform
I have installed ColdFusion 10 on Apache 2.2.  If I create a ColdBox site at the DocumentRoot I have no issues.  Alternatively, if I install ColdBox too  the Directory C:/localhost-www/CFSite and reference it from a Virtual Host on a new port it works (e.g. http://localhost:8080/).  But if I create an Alias (e.g. http://localhost/CFSite) for the same directory I get an error stating:

************* ERROR MSG *******************

Error building: coldbox.system.EventHandler -> Could not find the included template includes/helpers/ApplicationHelper.cfm. Note: If you wish to use an absolute template path (for example, template="/mypath/index.cfm") with include, you must create a mapping for the path using the ColdFusion Administrator. Or, you can use per-application settings to specify mappings specific to this application by specifying a mappings struct to THIS.mappings in Application.cfc.


Using relative paths (for example, template="index.cfm" or template="../index.cfm") does not require the creation of any special mappings. It is therefore recommended that you use relative paths with include whenever possible. with constructor arguments: {controller={[(Component=coldbox.system.web.Controller)]}}


**************************************************


Side note, I know any changes I make to ColdBox will break the port URL and move me closer to the Subfolder URL.


Here is a sample of my httpd.conf settings:


<Directory "/localhost-www/CFSite">
     Options None
     AllowOverride All
     Order allow,deny
     Allow from all
</Directory>


<VirtualHost localhost:8080>
     DocumentRoot "/localhost-www/CFSite"
     ErrorLog "logs/error.log"
     CustomLog "logs/access.log" common
</VirtualHost>


<IfModule alias_module>
     Alias /CFSite /localhost-www/CFSite
</IfModule>


For starters I found I could set a relative path to the ApplicationHelper.cfm in the Config/ColdBox.cfc from "include/helpers/ApplicationHelper.cfm" to "../include/helpers/ApplicationHelper.cfm".  That solved that issue but create another stating:


**********************  ERROR MSG *********************

Error creating eviction policy: LRU


CacheBoxProvider.EvictionPolicyCreationException The error occurred in C:/localhost-www/CFSite/coldbox/system/cache/providers/CacheBoxProvider.cfc: line 111
Called from C:/localhost-www/CFSite/coldbox/system/cache/CacheFactory.cfc: line 646
Called from C:/localhost-www/CFSite/coldbox/system/cache/CacheFactory.cfc: line 602
Called from C:/localhost-www/CFSite/coldbox/system/cache/CacheFactory.cfc: line 163
Called from C:/localhost-www/CFSite/coldbox/system/cache/CacheFactory.cfc: line 100
Called from C:/localhost-www/CFSite/coldbox/system/web/services/LoaderService.cfc: line 157
Called from C:/localhost-www/CFSite/coldbox/system/web/services/LoaderService.cfc: line 48
Called from C:/localhost-www/CFSite/coldbox/system/Bootstrap.cfc: line 71
Called from C:/localhost-www/CFSite/coldbox/system/Bootstrap.cfc: line 107
Called from C:/localhost-www/CFSite/coldbox/system/Bootstrap.cfc: line 350
Called from C:/localhost-www/CFSite/Application.cfc: line 39


109 : 			catch(Any e){
110 : 				instance.logger.error("Error creating eviction policy: #evictionPolicy#", e);
111 : 				throw('Error creating eviction policy: #evictionPolicy#','#e.message# #e.detail# #e.stackTrace#','CacheBoxProvider.EvictionPolicyCreationException');
112 : 			}
113 : 

**************************************************************


I read that this means it could not find the LRU Policy file which makes me thing another path issue.


My whole goal on our production server is to create multiple sites as subfolders of the root (e.g. http://www.mysite.com/subsite1, http://www.mysite.com/subsite2, etc.).


Any thoughts would be HUGE!!  Thanks in advance.  Side note, I'm a total newbee to ColdFusion coming from the .NET world trying to help out client.


Jeff

Ancient Programmer

unread,
Sep 10, 2016, 11:31:18 PM9/10/16
to ColdBox Platform
I have not used Apache for quite some time, but I think the issue is on the Apache configuration.

http://localhost/CFSite is not working because you missed the port number 8080. It should be http://localhost:8080/CFSite. If you want to run the site like http://localhost/CFSite, then you should configure it to port 80. Is your server running IIS on port 80? If so, you need to disable it; and let the Apache use the port 80.

Jeff Willener

unread,
Sep 11, 2016, 9:42:14 PM9/11/16
to ColdBox Platform
Thanks for the response.  I have confirmed http://localhost/CFSite works with a "Hello World" index.cfm page but as soon as I drop ColdBox into the site I get ColdBox exceptions.  The port of 8080 was to create a base URL on something other than the default port 80 to test with.

It seems as soon as I install ColdBox to a subfolder things start to fall apart.


Any other thoughts?

Thanks,
Jeff

Ancient Programmer

unread,
Sep 12, 2016, 9:45:20 AM9/12/16
to ColdBox Platform
Just a shot in the dark. Try to add/update /coldbox mapping to C:/localhost-www/CFSite/coldbox

Jeff Willener

unread,
Sep 12, 2016, 11:50:03 AM9/12/16
to ColdBox Platform
Sorry, pretty green with all this.  I'm not sure what you mean by add/update the mapping.  Can you elaborate?

br...@bradwood.com

unread,
Sep 12, 2016, 12:51:00 PM9/12/16
to col...@googlegroups.com
You're going to need to provide a lot better details than that.  Saying it "didn't work" or "failed" doesn't really give us much to go on.  If you received an error, what was it?  Is there a stack trace?  Also, how are the files organized in your web site?  When you say you put "coldbox" in a sub folder, do you mean the app or the framework folder as well?  If you put the actual framework folder in the sub folder, you'll need to create a CF mapping for /coldbox.  This is just how ColdFusion works.  Basically, the ColdBox app needs to be able to resolve the CFC path coldbox.system.Bootstrap
 
Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: br...@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com 
 
 
--------- Original Message ---------
--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coldbox/c07166c9-ca6e-4aa2-8836-3fff2d9fe6d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jeff Willener

unread,
Sep 13, 2016, 12:11:42 AM9/13/16
to ColdBox Platform
Hi Brad,

Thanks for your thoughts.  By failed or didn't work I mean I received the error listed in the original question.  It was a little vague but essentially, the first exception is the config.cfc, I think it's that file, has a reference to the ApplicationHelper file of 'includes/helpers/ApplicationHelper.cfm' and complains because it cannot find it.  As soon as I correct that, directly, it then complains it cannot find the LRU policy file.  See the pattern of not finding file references?

The httpd.conf entries I mentioned has all this information about folder structure.  Essentially I created the Coldbox files using CommandBox in the folder C:\localhost-www\CFSite\.  It's this folder where I reference the solution both as a virtual directory (http://localhost:8080) and as a folder alias (http://localhost/CFSite).  The Virtual Directory works since the site is at the root URL and the folder alias does not which produces the mentioned error since it's in a subfolder.  It appears to be a path issue.

You mentioned a mapping to /coldBox and I'm assuming you're referring to the application.cfc at the root of the folder CFSite created by Coldbox.  I found this article but couldn't find the correct values that seemed to work.  Do you have a suggestion?

The goal is this.  The client has an existing site at, for example, http://mysite.mybiz.com with no design patterns like Coldbox or Semantic URL's.  They want a second CF site at http://mysite.mybiz.com/portal and a third RESTful api site at http://mysite.mybiz.com/api/v1/ where I'm trying to create these outside the existing folder structure for a number of maintenance reasons.  I'm assuming this is all within the means of CF right?

Thanks a bunch,
Jeff

br...@bradwood.com

unread,
Sep 13, 2016, 12:30:49 AM9/13/16
to col...@googlegroups.com
The LRU errors always happen when you have the actual coldbox.system folder in a directory but haven't created a ColdFusion mapping for /coldbox that points to it.  You'll need to create a mapping in the CF administrator or in Application.cfc's this.mappings that points to the coldbox folder.
 
As far as the application helper error, it's because you have an incorrect path for your helper file.  Your path probably starts with a leading slash, which means CF expands it to start in the web root.  Since you've got your app in a subfolder, you need to use the appropriate path.  I would recommend creating a CF mapping called something like /root in your Application.cfc that points to the root of the ColdBox app.  Then you can make settings like the application helper something along the lines of "/root/includes/helpers/ApplicationHelper.cfc" which will resolve properly plus will remain portable regardless of the folder name that the app lives in
 
In regards to not being able to get your application specific mappings to work, I'd need to know what your folder structure is and what code you tried.  I really think your 95% of the way there and just need to straighten out some of your settings that aren't taking the sub folder into account.
--------- Original Message ---------

Jeff Willener

unread,
Sep 14, 2016, 7:30:46 PM9/14/16
to ColdBox Platform

I now get a new error.  I added this.mappings = { "/root" = "/localhost-www/CFSite" }, updated the COLDBOX_APP_MAPPING and COLDBOX_APP_ROOT_PATH in the Application.cfc file.  I'm still missing something probably obvious, any thoughts?


My folder structure is as follows:


Apache Installation Path

C:\Apache22\


ColdFusion Installation Path

C:\ColdFusion\


ColdBox Application path

C:\localhost-www\CFSite\



Apache httpd.conf Alias (see attached httpd-cf-development.conf included by httpd.conf)

C:\localhost-www\CFSite\ => http://locahost/CFSite/


Coldbox.cfc (see attached)

applicationHelper    = "/root/includes/helpers/ApplicationHelper.cfm",


Application.cfc (see attached)

this.mappings = {
  "/root" = "/localhost-www/CFSite"
 };



 // COLDBOX STATIC PROPERTY, DO NOT CHANGE UNLESS THIS IS NOT THE ROOT OF YOUR COLDBOX APP
 //COLDBOX_APP_ROOT_PATH = getDirectoryFromPath( getCurrentTemplatePath() );
 COLDBOX_APP_ROOT_PATH = "/localhost/CFSite";
 // The web server mapping to this application. Used for remote purposes or static purposes
 COLDBOX_APP_MAPPING   = "/CFSite";
 // COLDBOX PROPERTIES
 COLDBOX_CONFIG_FILE   = "";
 // COLDBOX APPLICATION KEY OVERRIDE
 COLDBOX_APP_KEY    = "";



Exceptions w/ StackTrace

Could not find the included template /coldbox/system/includes/BugReport.cfm.

Note: If you wish to use an absolute template path (for example, template="/mypath/index.cfm") with include, you must create a mapping for the path using the ColdFusion Administrator. Or, you can use per-application settings to specify mappings specific to this application by specifying a mappings struct to THIS.mappings in Application.cfc.
Using relative paths (for example, template="index.cfm" or template="../index.cfm") does not require the creation of any special mappings. It is therefore recommended that you use relative paths with include whenever possible.

The error occurred in C:/localhost-www/CFSite/coldbox/system/Bootstrap.cfc: line 514
Called from C:/localhost-www/CFSite/coldbox/system/Bootstrap.cfc: line 289
Called from C:/localhost-www/CFSite/coldbox/system/Bootstrap.cfc: line 353
Called from C:/localhost-www/CFSite/Application.cfc: line 41

512 : 			// Show Bug Report
513 : 			savecontent variable="local.exceptionReport"{
514 : 				include "#bugReportTemplatePath#";
515 : 			}
516 : 		} else {


Resources:

Check the ColdFusion documentation to verify that you are using the correct syntax.

Search the Knowledge Base to find a solution to your problem.

Browser

Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko

Remote Address

::1

Referrer

 

Date/Time

14-Sep-16 05:18 PM

Stack Trace

at cfBootstrap2ecfc1202367431$funcPROCESSEXCEPTION.runFunction(C:/localhost-www/CFSite/coldbox/system/Bootstrap.cfc:514) at cfBootstrap2ecfc1202367431$funcPROCESSCOLDBOXREQUEST.runFunction(C:/localhost-www/CFSite/coldbox/system/Bootstrap.cfc:289) at cfBootstrap2ecfc1202367431$funcONREQUESTSTART.runFunction(C:/localhost-www/CFSite/coldbox/system/Bootstrap.cfc:353) at cfApplication2ecfc120834661$funcONREQUESTSTART.runFunction(C:/localhost-www/CFSite/Application.cfc:41)

coldfusion.tagext.lang.IncludeTag$NoSuchIncludeTemplateException: Could not find the included template /coldbox/system/includes/BugReport.cfm.
	at coldfusion.tagext.lang.IncludeTag.setTemplate(IncludeTag.java:366)
	at cfBootstrap2ecfc1202367431$funcPROCESSEXCEPTION.runFunction(C:\localhost-www\CFSite\coldbox\system\Bootstrap.cfc:514)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
	at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2659)
	at cfBootstrap2ecfc1202367431$funcPROCESSCOLDBOXREQUEST.runFunction(C:\localhost-www\CFSite\coldbox\system\Bootstrap.cfc:289)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
	at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2659)
	at cfBootstrap2ecfc1202367431$funcONREQUESTSTART.runFunction(C:\localhost-www\CFSite\coldbox\system\Bootstrap.cfc:353)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414)
	at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2432)
	at cfApplication2ecfc120834661$funcONREQUESTSTART.runFunction(C:\localhost-www\CFSite\Application.cfc:41)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414)
	at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:108)
	at coldfusion.runtime.AppEventInvoker.onRequestStart(AppEventInvoker.java:278)
	at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:411)
	at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
	at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
	at coldfusion.filter.PathFilter.invoke(PathFilter.java:112)
	at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:30)
	at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
	at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
	at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
	at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
	at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
	at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
	at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
	at coldfusion.CfmServlet.service(CfmServlet.java:204)
	at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
	at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:414)
	at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:203)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:722)

Thanks,

Jeff
httpd-cf-development.conf
httpd.conf
Coldbox.cfc
Application.cfc
Reply all
Reply to author
Forward
0 new messages