Copy link to clipboard
I have ran into a rather peculiar issue. I have a CentOS 7 server with ColdFusion 2018 installed and configured. Apache virtual directories are configures with correct directory structure to each web application document root via Plesk. I'm going to use two web applications in this example, although I am experiencing the same issue with others.
The web root of each application on the server is below:
Working application: /var/www/vhosts/r1gup.egtyctest.com/httpdocs
Application using aboves Applicaiton.cfc file: /var/www/vhosts/utgup2.egtyctest.com/httpdocs
The other strange occurence i'm having with this is if i restart the coldfusion or apache server, the issue can reverse. I will be able to navigate to the utgup2.egtyctest.com application and it will load the correct Application.cfc file and then r1gup.egtyctest.com will load utgup2.egtyctest.com Application.cfc file.
After all my testing, I do not think this is Apache related. The virtual hosts files for all the web applications have all the correct settings for the document roots, and if I default the first web page to be loaded with a simple index.html file, the correct page in the correct directory gets loaded. This seems to be ColdFusion looking for the first available Application.cfc file, and loading that file, not respecting the web applications document root folder.
Are there any other mappings I am missing to get the correct Application.cfc files loaded for each of my web applications? Any insight will be greatly appreciated.
Copy link to clipboard
It is unclear to me whether:
1) the Application.cfc files have distinct paths. That is, respectively,
2) you gave each application a distinct name.
You can do that using the following setting in the respective Application.cfc files:
<cfset this.name="myR1gupApp"> <!--- in the r1gup Application.cfc file --->
<cfset this.name="myUtgup2App"><!--- in the utgup2 Application.cfc file --->
1) the Application.cfc file do have distinct paths just as you laid out:
2) All the applications do have their distinct name on the Application.cfc files
There is an idea that might or might not be related. But it's worth trying, to see if it helps.
Is ColdFusion perhaps confused by the dots? I ask because the following happened.
I created a directory and named it dir1.dir2. I placed a CFC called Test.cfc in it. When I ran the following code, I got the error "Could not find the ColdFusion component or interface dir1.dir2.Test".
My advice is that you should rename the application-paths and application-names from
Thank you for the suggestion BKBK, I did remove the dots in the Application.cfc files, and still not luck. I currently have a support ticket open with the company we purchased the license from. We are using hours that they provided to help with any issues. Once resolved I will post the fix here on this post.
1st screenshot: I am being taken inside the r1rise.egtyctest.com folder and not the r1gup.egtyctest.com.
2nd screenshot: I am being taken inside the chgup.egtyctest.com folder and not the utgup2.egtyctest.com.
Hi @DanielTheProgrammer ,
The screenshots actually contradict what you originally said. The folder names r1rise.egtyctest.com and chgup.egtyctest.com were not in your original description.
1st screenshot: I am being taken inside the r1rise.egtyctest.com folder...
2nd screenshot: I am being taken inside the chgup.egtyctest.com folder ...
alert("In r1rise.egtyctest.com file, hostname: " + window.location.hostname);
alert("Inside chgup.egtyctest.com, Inside hostname:" + window.location.hostname);
Because the strings are added manually, they could be anything. They say nothing about the folder.
The only value that is real is window.location.hostname. And it is, respectively, r1gup.egtyctest.com and utgup2.egtyctest.com, as expected.
alert("In r1gup.egtyctest.com file, hostname: " + window.location.hostname);
alert("In utgup2.egtyctest.com file, hostname: " + window.location.hostname);
Thank you BKBK for all the assistance with this issue, it has been resolved. After spending time with Brian Bockholder and really reviewing the configuration of the server, we found the issue. There is a checkbox in the Coldfusion Administrator page, under Server Settings -> Caching, "Cashe web server paths". This checkbox was checked and was preventing my web applicaitons from loading their own web server paths. After un-checking this box, and restarting the Coldfusion server, all my web applications would navigate to the correct paths.