Copy link to clipboard
Copied
Hi,
I'm running CF 2018 on a Mac and trying to change the location the default wwwroot to a folder elsewhere in the system. Previously this was done by editing the server.xml file, but its not having the intended effect.
The server.xml file reads as follows:
<Context path="/" docBase="/Applications/ColdFusion2018/cfusion/wwwroot" WorkDir="/Users/bigMac/Dropbox/Apps/wwwroot" >
<Resources>
<PreResources base="/Applications/ColdFusion2018/cfusion/wwwroot/CFIDE" className="org.apache.catalina.webresources.DirResourceSet" webAppMount="/CFIDE"/>
<PreResources base="/Applications/ColdFusion2018/cfusion/wwwroot/WEB-INF" className="org.apache.catalina.webresources.DirResourceSet" webAppMount="/WEB-INF"/>
</Resources>
</Context>
Any insights appreciated.
Copy link to clipboard
Copied
This may not be the answer you really want, but my recommendation would be to just create a symlink from the CF wwwroot to your "real" wwwroot. If you do this, you might want to back up the wwwroot before doing any major tinkering with CF, like upgrading or deleting it, but you probably don't really need to do that.
Dave Watts, Eidolon LLC
Copy link to clipboard
Copied
I'm having a similar (but subtly different) problem with the Tomcat <Context>
. It's able to find my folder, but gives me a coldfusion.runtime.TemplateNotFoundException: File not found
whenever I try to run a CFM in that location.
We've been using this configuration for years in production (redirecting the docBase, and using a Tomcat mapping) to manage ColdFusion servers in conjunction with Ansible. CF11 and CF2016 work just fine (with small differences to the server.xml file). As we're preparing to upgrade to CF2018, we're running into the problem of the Tomcat server returning this error whenever we try to access a file in this mapped folder.
We can't use a CF mapping because it won't allow us to visit http://server/mapped-folder/file.cfm, so it has to be a Tomcat mapping.
I actually re-enabled the Tomcat directory listing, and it can find the directory just fine. It gives me a list of the files and CFMs in the folder, no problem. If I click on any of the CFMs, I get the error. However, it can read HTML files and other static files without any problems.
Has anything else changed that we need to update?
<Context path="/" docBase="/our/web/root" WorkDir="/opt/coldfusion2018/cfusion/runtime/conf/Catalina/localhost/tmp">
<Resources>
<PreResources className="org.apache.catalina.webresources.DirResourceSet" base="/opt/coldfusion2018/cfusion/wwwroot/CFIDE" webAppMount="/CFIDE" />
<PreResources className="org.apache.catalina.webresources.DirResourceSet" base="/opt/coldfusion2018/cfusion/wwwroot/WEB-INF" webAppMount="/WEB-INF" />
<PreResources className="org.apache.catalina.webresources.DirResourceSet" base="/opt/coldfusion2018/cfusion/wwwroot/cf_scripts" webAppMount="/cf_scripts" />
<PreResources className="org.apache.catalina.webresources.DirResourceSet" base="/opt/coldfusion2018/cfusion/wwwroot/mapped-folder" webAppMount="/mapped-folder" />
</Resources>
</Context>
Edit: We do this so Ansible can put a file on this particular host in our cluster (e.g. to set CF settings), then curl http://server/mapped-folder/file.cfm
and delete the file afterwards. Works like a charm on a litany of VMs, vagrants, and a Mac at the office too.