Hello
I have installed Lucee+Tomcat including mod_cfml, using the installer lucee-5.3.4.080-pl0-linux-x64-installer.run
Installed on Centos 8, running in a vmware VM.
The installation went well, and both Lucee and mod_cfml are working. I very much like the automatic configuration provided by mod_cfml.
I have encountered one problem which I hope someone can help me overcome.
In attempting to investigate this problem I tried to turn on logging for mod_cfml.core so that I could see what the module was doing when it created the configuration files, but I get no debugging output in either catalina.out, or the system log.
I do get plenty of output in catalina.out, just notheing from mod_cfml. In server.xml I have changed loggingEnabled="false" to loggingEnabled="true" and restarted Tomcat - in fact the VM has been restarted a number of times - but no logging output from mod_cfml.core. If anyone can help with this problem as well it would be useful. Thanks.
The problem I have found is that after a Tomcat restart, the ROOT.xml file in the automatically created directory for the Apache host is overwritten on the first request.
To be clear, the automic configuration for this host completed in a previous session of Tomcat, the first request triggered the configuration and subsequent requests did not trigger mod_cfml.core - all as expected.
Then Tomcat is restarted. The first request for this host again triggers mod_cfml.core - I suspect this is deliberate but I am not sure. But, this new configuration overwrites the ROOT.xml created previously. When I look at the code for mod_cfml-valve (core.java) it seems to check for the existence of the file and if found it would not overwrite it - but it is in fact being overwritten. I may have misunderstood the code. (This is where debugging output would be really useful!).
In most cases this would of course not matter. But, I want to add a line to the ROOT.xml file to turn on the rewrite valve org.apache.catalina.valves.rewrite.RewriteValve
- the valve needs to be added to the context element in ROOT.xml so that it applies only to this webapp, rather than all requests for the host (it can be added to server.xml, but I don't want the same rewrite rules for all virtual hosts).
I sucessfully added the valve, and a watch for the rewrite.config file in WEB-INF, and the rewrite was working fine, with changes to the rules file being automatically configured as desired thanks to the watch.
Everything working well.. Until... Tomcat was restarted. Then I lost my changes to ROOT.xml because of automatic configuration running again on the first request.
So...
- Why does mod_cfml.core run again after a Tomcat restart? The configuration files are now created, so it isn't needed. (I noticed in some documentation on mod_cfml somewhere that to re-create the configurations for the dynamic hosts, you can restart Tomcat - so that is why I think this might be deliberate. But.. you could just remove the conf/Catalina/<host> directory to get the same effect). (Much less of a sledge-hammer approach too).
- Should mod_cfml.core be overwriting the ROOT.xml file if it already exists? Is there a bug? If it is intentional, could there be a configuration setting to prevent it?
Thanks for reading.