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

ColdFusion 2018 changing docBase renders administrator page grayed out with a search bar.

Explorer ,
Sep 08, 2020 Sep 08, 2020

Copy link to clipboard

Copied

Good morning,

 

      I have a ColdFusion 2018 install on a Cent OS 7 server.  I have changed the document base via the server.xml file, and added the PreResources base for CFIDE and WEB-INF:

 

<Context path="" docBase="/var/www/vhosts" WorkDir="/opt/coldfusion2018/cfusion/runtime/conf/Catalina/localhost/tmp" >
<Resources>
<PreResources base="/opt/coldfusion2018/cfusion/wwwroot/CFIDE" className="org.apache.catalina.webresources.DirResourceSet" webAppMount="/CFIDE"/>
<PreResources base="/opt/coldfusion2018/cfusion/wwwroot/WEB-INF" className="org.apache.catalina.webresources.DirResourceSet" webAppMount="/WEB-INF"/>
</Resources>
</Context>

 

After saving the sever.xml file, restarting coldfusion server, I am able to see my local web sites just fine on the browser, but the admin page is grayed out with a search bar. 

Screen Shot 2020-09-08 at 9.18.03 AM.png

I have done some initial research, and have tried editing the neo-runtime.xml file for the CFFormScriptScrc, adding the absolute path to the /cf_scripts/scripts/ folder, and restart coldfusion server but still no luck on the admin page:. 

<var name='CFFormScriptSrc'><string>/opt/coldfusion2018/cfusion/wwwroot/cf_scripts/scripts/</string></var>

 

When I go back to my server.xml file and comment out the Context block, restart, I can get to the admin page just fine, but of course can't access my local sites due to them being in the /var/www/vhosts/ folder.  Any insight or advice on what to look for next would be much appreciated.

 

Thanks,

 

Daniel

 

 

Views

429

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

Community Expert , Sep 09, 2020 Sep 09, 2020

Daniel, there are a few things to consider.

  • First, as for that cfformscriptsrc value you set, it should NOT be an absolute path. It should be a webroot relative path (or an alias). If set as a webroot relative path, it would be pointing to a folder witin that cfusion/wwwroot, so just saying /cf_scripts/scripts would suffice, and that is in fact the default
  • Most people get in trouble when they change that (which as you may know, you can do in the CF Admin on the first "settings" page as "Default
...

Votes

Translate

Translate
Community Expert ,
Sep 09, 2020 Sep 09, 2020

Copy link to clipboard

Copied

Daniel, there are a few things to consider.

  • First, as for that cfformscriptsrc value you set, it should NOT be an absolute path. It should be a webroot relative path (or an alias). If set as a webroot relative path, it would be pointing to a folder witin that cfusion/wwwroot, so just saying /cf_scripts/scripts would suffice, and that is in fact the default
  • Most people get in trouble when they change that (which as you may know, you can do in the CF Admin on the first "settings" page as "Default ScriptSrc Directory", but I realize you could not do that because you could not get the Admin to work at all 🙂, and you were changing the underlying xml file anyway).
  • And indeed, if one DOES change that value to anything ELSE than that default, then even if they correct their web server (IIS or Apache) to have a new virtual directory or alias of that name (which should then point to the absolute path for that scripts folder), they often find that their CF Admin fails to work--whether in part (like the Updates page tabs not working) or perhaps in whole (as you experienced).
  • The problem is that they need to ALSO change the CF built-in web server configuration (which is used for the Admin by default since CF2016, and optionally before that). It's actually the Tomcat web server, and in fact that is what you were perhaps trying to do when modifying the preresources elements in the server.xml. Where did you get instructions to do what you were doing?
  • I will say that Pete Freitag did a post some years ago which covers both newer and older CF (Tomcat) versions. See https://www.petefreitag.com/item/867.cfm. It focuses on the change needed when one wants to define an "alias" in that web server, such as is needed if you do make changes to that CF Admin "default script src" path.
  • But we see here that you were having it define the location of the CFIDE folder...and note that is NOT where the scripts folder is, for CF2016 and above. Instead, it's now in the cf_scripts folder, as a sibling to that CFIDE. So instead, as Pete's post suggests, you want to create an alias (a preresource) that maps that default scriptsrc path as you may change it (in the admin, such as "cfscripts") as a webappmount that points to the real cf_scripts/scripts folder. You were close. 🙂 Again, see Pete's post for more.
  • Finally, I should note that in all such cases, you can really help yourself in troubleshooting such situations when you can SEE what is amiss, by viewing any browsers "dev tools" (right click on white space in the browser and choose something like "inspect"), where the tool's "network" tab would show (on a refresh of the Admin page) that there were many 404's, and you'd see how they are trying to call back to the server. That may help you see where your mistake is, at least from the client side. 

 

Let us know how you get on.


/Charlie (troubleshooter, carehart.org)

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 Expert ,
Dec 22, 2020 Dec 22, 2020

Copy link to clipboard

Copied

Daniel, how did things turn out here?


/Charlie (troubleshooter, carehart.org)

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
Explorer ,
Jan 05, 2021 Jan 05, 2021

Copy link to clipboard

Copied

Hi Charlie,

 

      Thank you for the information you provided, it greatly helped me fix the issue.  As you pointed out, I was missing a PreResource for the cf_scripts folder.  I added it to the Resources block in the server.xml file, so my Context block now looks like the following:

<Context path="" docBase="/var/www/vhosts" WorkDir="/opt/coldfusion2018/cfusion/runtime/conf/Catalina/localhost/tmp" >
<Resources>
<PreResources base="/opt/coldfusion2018/cfusion/wwwroot/CFIDE" className="org.apache.catalina.webresources.DirResourceSet" webAppMount="/CFIDE"/>
<PreResources base="/opt/coldfusion2018/cfusion/wwwroot/WEB-INF" className="org.apache.catalina.webresources.DirResourceSet" webAppMount="/WEB-INF"/>
<PreResources base="/opt/coldfusion2018/cfusion/wwwroot/cf_scripts" className="org.apache.catalina.webresources.DirResourceSet" webAppMount="/cf_scripts" />
</Resources>
</Context>

 

After adding the cf_scrips webAppMount, I restarted the coldfusion server and was able to navigate to the admin page just fine.  One more question regarding the Resources block in the server.xml file, would I be able to create a PreResource alias to a folder that contains my Highcharts, and ckeditor binaries that I can use in my web applications, or would I create that somewhere else?  For example, on our current web hosting companies web server, which is a windows server 2008 box, I have virtual directories that link up to a folder that holds these binaries on each one of our IIS web sites.

 

Thanks,

 

Daniel

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
Explorer ,
Jan 05, 2021 Jan 05, 2021

Copy link to clipboard

Copied

LATEST

Hi Charlie,

   Thank you for the input, it turns out I added a PreResources for the cf_scripts directory, with webAppMount="cf_scripts", and that did the trick.

 

-Daniel

 

-Daniel

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