I have a centOS 7 server, running ColdFusion 2018 Enterprise, using Apache and using Plesk Obsidian. I am having an issue navigating to my login page when my coldfusion files are in a certain diretory, httpdocs. In plesk, when I create a domain, and then a subdomain and place my files in the root of the subdomain, I have no issues getting to my login page, directory: var/www/vhosts/example.com/utexample.example.com. However, when I create a single domain, place my cfm files in the httpdocs folder within the domain created (var/www/vhosts/example.com/httpdocs), I get an error when attempting to navigate to the website:
coldfusion.runtime.TemplateNotFoundException: File not found: /loginform.cfm
Working web application: r1gup.egtyctest.com
Erroring out web application: utgup2.egtyctest.com
I have checked all folder permissions and everything seems fine on that end. I do have a custom server.xml file that I am using with below Context and Resources values:
<Context WorkDir="/opt/coldfusion2018/cfusion/runtime/conf/Catalina/localhost/tmp" docBase="/var/www/vhosts" path="">
<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/scripts" className="org.apache.catalina.webresources.DirResourceSet" webAppMount="/_cfform$
<PreResources base="/opt/coldfusion2018/cfusion/wwwroot/cf_scripts" className="org.apache.catalina.webresources.DirResourceSet" webAppMount="/cf_scripts"/>
Any insight will be greatly appreciated to help me resolve this issue.
Copy link to clipboard
I don't use Plesk, but I am assuming it somehow configures the Apache-to-CF web server configuration, and as such I'd argue that's where you should be looking, to understand and resolve the problem, rather than CF's server.xml file. So that would be files like httpd.conf, or files included from that.
In case perhaps you may say that you can't change or even maybe SEE those apache conf files, I will say that I notice you "have no issues getting to my login page, directory":
By that, do you mean that you can place a cfm file in there, and it runs? I am assuming so, but perhaps you don't mean to be saying that.
But then you say that when you place files instead in:
you get a "file not found" error.
So can you run any cfm page in any folder under that vhosts/example.com? If you cannot, then perhaps the problem is that Plesk (or the person responsible for running it) did not proceed to the next step that's needed for any apache (or IIS) file to be passed to CF: the CF "web server configuration" tool, or wsconfig. It's documented in the CF docs. Again, I don't use Plesk so don't know if this is something it runs for you, or can if told to, or if you or someone is left to do that as an additional step. Normally, any non-plesk install of CF would indeed call for those two steps: install CF, and run the wsconfig tool to connect any web server to CF.
As you compare the above, it sure seems like somehow the first folder is where CF and Apache think they should be running your code from--this "utexample.example.com" subfolder rather than its "httpdocs" sibling, both under your "vhosts/example.com" folder. Is it possible that you or someone configuring Plesk simply made a mistake? Did you mean to really have such a "example.com/utexample.example.com" folder? It seems redundant and mistaken.
Again, I am simply asking questions to help you think through the problem and perhaps discuss them with folks on your end. If you feel that this "example.com/utexample.example.com" folder is correct and what you wanted, then since it works, why now are you also wanting to have code in a sibling htdocs folder? Just for convention?
Or are these two folders somehow meant to serve different Apache vhosts? If so, why are they both under the same vhosts/example.com folder? These are questions I ask now to help you help us.
Perhaps someone with more Plesk experience will jump in with instead the exact answer you need. Just wanted to try to help in the meantime.
Thanks for the reponse Charlie. In response to your questions:
"In case perhaps you may say that you can't change or even maybe SEE those apache conf files, I will say that I notice you "have no issues getting to my login page, directory":
By that, do you mean that you can place a cfm file in there, and it runs?"
Yes, the working web application, r1gup.egtyctest.com, has the file directory: var/www/vhosts/egtyctest.com/r1gup.egtyctest.com/
where all the cfm files are located. When I navigate to this web application, I get to the proper login page, "loginform.cfm", can login and access the web application. In Plesk, I create the egtyctest.com domain, and create the r1gup.egtyctest.com sub-domain.
"But then you say that when you place files instead in:
you get a "file not found" error."
Yes correct, in Plesk I create a single domain, utgup2.egtyctest.com, and place the cfm files in the following directory:
var/www/vhosts/utgup2.egtyctest.com/httpdocs/, and this is were I get the file not found /loginform.cfm when navigating to this page, utgup2.egtyctest.com. Plesk automatically wants the files to be placed in the httpdocs folder by default when setting up a single domain.
Both of these web applications have different vhosts files.
Httpdocs is not a subdomain. So, shouldn't the URL of the login file point to /httpdocs/loginform.cfm rather than to /loginform.cfm?
Thanks BKBK, I ended up fixing the issue this morning. Turns out, I had set the correct mapping in the Application.cfc file, but did not restart my coldfusion server. After the restart, all web pages were rendering just fine.
Thanks for all the help Charlie and BKBK!
Glad you've sorted things out, but this is your first mention of any involvememt in this of application.cfc or a mapping there. To be clear, mappings in there aren't related at all to how apache is configured. And a request for a file as a url would not be affected by such cf mappings, but of course they would affect a cfinclude or cfc invocation, etc.
Again, you didn't say that was your issue, and since you mentioned this as a seeming apache issue, we followed you down that path, trying to understand the problem.
As often happens, sometimes it's what's NOT being mentioned that has an impact or may be as significant. Good lesson for everyone to learn or be reminded of. 🙂