• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Can you specify a missing template handler that lives under another site?

Engaged ,
Nov 08, 2010 Nov 08, 2010

Copy link to clipboard

Copied

I have configured a dedicated site, separate from my website, for my ColdFusion administrator (CFIDE).  So I have my website here: http://www.public-site.com/ and my ColdFusion admin here: http://www.cfadmin-site.com/ .  They both live on the same server but under different directories.  So now I am configuring my ColdFusion settings and wondering if there is some way to configure the missing template handler and site-wide error handler to use files that live under the public site directory so that I can give my users a consistent look?

I am guessing that this is not possible but thought I would ask.  I may be left with creating the modules under my ColdFusion admin directory and then using <cflocation> to redirect the user back to the public website environment.  Or embedding some javascript to redirect them.  Any other thoughts?

Views

3.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Valorous Hero , Nov 08, 2010 Nov 08, 2010

Miguel_ wrote:


ColdFusion web root

     D:\wwwroot\cfadmin-site\

If that is your ColdFusion webserver, then YES that is where you put the site wide handlers.

I'm not sure about your statement that you need to "redirect back to the public site".  As Far As I Know, ColdFusion should see any sitewide content from that directory from the context of the IIS website that is processing a request for.

It would take some testing (and if you have already then ok) but my first thought would we No you don't need

...

Votes

Translate

Translate
Valorous Hero ,
Nov 08, 2010 Nov 08, 2010

Copy link to clipboard

Copied

What flavor of ColdFusion are you using (standard, stand-alone, multi-instance, J2EE).

The sitewide missing template handler, is based on the ColdFusion web root, which can be different then the web server web root, which you listed in your original post.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 08, 2010 Nov 08, 2010

Copy link to clipboard

Copied

Sorry, should have posted that.  I'm using ColdFusion 9.0.1 Enterprise and Windows Server 2008 (IIS 7).

Yes, these settings are relative to the ColdFusion web root and mine is now different.  Like I said, I don't think this is possible but thought I would ask. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Nov 08, 2010 Nov 08, 2010

Copy link to clipboard

Copied

Miguel_ wrote:

Sorry, should have posted that.  I'm using ColdFusion 9.0.1 Enterprise and Windows Server 2008 (IIS 7).

Yes, these settings are relative to the ColdFusion web root and mine is now different.  Like I said, I don't think this is possible but thought I would ask. 

ColdFusion Enterprise only eliminates Standard.  Did you configure the Enterprise as Standard, Multiple Instance or J2EE.

You have NOT listed the ColdFusion web roots (most likely).  You have listed the Web Server (IIS) web roots.  Yes you have two of those, but do you have one or two ColdFusion web roots?  Depends on how you have configured your ColdFusion Application Server.

For Example, On one of my servers, I have a dozen web sites, including one Dedicated to ColdFusion Just like you have done.  I also have three ColdFusion instances configured using the Multiple Instance version of ColdFusion.  So I have 12 IIS web roots and three ColdFusion web roots.  The Site Wide Missing Template Handler and Site Wide Exception Handler go into the ColdFusion web Roots.

I.E.

IIS Web Roots

  • D:\IntranetSites\Registration\
  • D:\IntranetSites\Information-Technology\
  • D:\IntranetSites\ets-internal\
  • D:\IntranetSites\enforcement\
  • D:\IntranetSites\administration\
  • E:\WebServerAdmin\
  • ETC

ColdFusion Web Roots

  • E:\jrun4\servers\cfusion\cfusion-ear\cfusion-war
  • E:\jrun4\servers\general\cfusion.ear\cfusion.war
  • E:\jrun4\servers\general2\cfusion.ear\cfusion.war

It is the latter three where I put my Site Wide handler files.  And then the file in each JRun server would apply to all the web sites connected to that ColdFusion server instance with the web server connector.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 08, 2010 Nov 08, 2010

Copy link to clipboard

Copied

I have ColdFusion installed as J2EE and am using the builtin JRun application server.  I am only running one instance of ColdFusion.  I have also disabled the JRun webserver so nothing is browsable from the cfusion-war directory.  (Although I think the JRun/IIS connector still looks in that directory.)  So my ColdFusion webroot is the same as my IIS webroot for the cfadmin site.

Mine looks like this:

IIS web roots

     D:\wwwroot\public-site\

     D:\wwwroot\cfadmin-site\

ColdFusion web root

     D:\wwwroot\cfadmin-site\

Of course, the ColdFusion administrator is looking for the handler files in that cfadmin-site directory (as you have yours setup).  There is probably no way around this and that's okay I guess.  Do you see any issue with me setting up my handler to redirect back to the public site after it processes?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Nov 08, 2010 Nov 08, 2010

Copy link to clipboard

Copied

Miguel_ wrote:


ColdFusion web root

     D:\wwwroot\cfadmin-site\

If that is your ColdFusion webserver, then YES that is where you put the site wide handlers.

I'm not sure about your statement that you need to "redirect back to the public site".  As Far As I Know, ColdFusion should see any sitewide content from that directory from the context of the IIS website that is processing a request for.

It would take some testing (and if you have already then ok) but my first thought would we No you don't need to redirct because you are already there.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 08, 2010 Nov 08, 2010

Copy link to clipboard

Copied

Thanks for your help ilssac.  I think you have answered my question.  The only reason I am wanting to redirect back to the public site is to give the user the standard 404 page that lives under the public site and uses the standard CSS styles, etc. that are defined for that site.  I don't want to recreate and maintain the public site look and feel in my coldfusion handlers if I don't need to.  Thanks again for your help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 08, 2010 Nov 08, 2010

Copy link to clipboard

Copied

OK, now I think I see where you are coming from about not needing to redirect *lightbulb* and perhaps I can explain to you what I am seeing.  Again, here is my setup:

web root: D:\wwwroot\public-site\

cf web root: D:\wwwroot\cfadmin-site\

Now let's say I have a file in the web root like this: D:\wwwroot\public-site\error.cfm  If I try to enter that in my site-wide error handler in ColdFusion it tells me that the file does not exist.  Makes sense.

So I moved my file to the cf web root like this: D:\wwwroot\cfadmin-site\error.cfm and set my site-wide error handler accordingly.  Now when I force an exception I get an error that my site-wide error handler failed.  In the logs I see this error:

"Error","jrpp-26","11/08/10","14:02:30",,"'' The specific sequence of files included or processed is: D:\wwwroot\public-site\error.cfm'' "
java.security.PrivilegedActionException: coldfusion.runtime.TemplateNotFoundException: File not found: D:\wwwroot\public-site\error.cfm

So now that a template is executing ColdFusion is looking for the site-wide error handler in the web root of the public site.  But the ColdFusion administrator will not let me enter that path in the site-wide error handler setting of the administrator page.

Did you run across this too?  Surely we don't need to have the file in both locations.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Nov 08, 2010 Nov 08, 2010

Copy link to clipboard

Copied

I am not sure why you are getting that error, I could not recreate it, but we have different configuraitons.

I am just using the multi-instance JRun configuration.  And I have not customized mine as extensivily as yours.  I've don't nothing about the built in web server or changing the ColdFusion web root.

In a test environment, under my configuration I put site wide handlers into the ColdFusion root as follows:

E:\jrun4\servers\playground\cfusion.ear\cfusion.war\MissingTemplate.cfm

E:\jrun4\servers\playground\cfusion.ear\cfusion.war\SiteWideError.cfm

Then calling the following bad url from the playground web site which has a web root of D:\playground; http://playground/ian/badfile.cfm returned the above MissingTemplate.cfm as expected.  It was a very simple file though.

While I was doing this, I was reminded of something we have done on a couple of our servers.  We have used ColdFusion mappings to point to the webroot directory, which allows us to put the MissingTemplate file into the web server web root and access it from the ColdFusion settings page as such /IISWebRootMapping/errors/missingTemplate.cfm.

HTH

Ian

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 08, 2010 Nov 08, 2010

Copy link to clipboard

Copied

Well as I have been playing around with this I stumbled upon a syntax that works in the ColdFusion administrator.  If I enter my site-wide handlers like this "/../public-site/error.cfm" it seems to work.  I would have sworn I had already tried this but I think I left that initial "/" off.  So now it seems to be working how I wanted all along.  Just to document, this is what I have:

iis web roots:

     D:\wwwroot\public-site\

     D:\wwwroot\cfadmin-site\

coldfusion web root:

     D:\wwwroot\cfadmin-site\

site-wide handler files:

     D:\wwwroot\public-site\error.cfm

     D:\wwwroot\public-site\404-handler.cfm

ColdFusion administrator handler settings:

     Missing Template Handler - /../public-site/404-handler.cfm

     Site-wide Error Handler - /../public-site/error.cfm

Thanks again for your time and help with this.  I looks like your ColdFusion mapping is another way to do this.

Miguel

Message was edited by: Miguel_ - I had a typo in the missing template handler syntax

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 27, 2017 Sep 27, 2017

Copy link to clipboard

Copied

LATEST

I know this is a couple of years later, but thanks for this thread. I was having the same issue with CF2016.  I followed the lockdown guide and couldn't get the site wide error handler to work as the CFAdmin site is not under the same site.  Eventually I had to go the Coldfusion mapping route to get it working again.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation