Thank you so much, Mark! In our case, the server.xml contains some information which is generated run time (pre-config before Tomcat is started) like the paths to key store and trust store, cipher suites, etc.
Also, we have an active-passive cluster setup in which only the currently active node has the access to a shared disk which has all our product configuration data including the key store, trust store files needed in server.xml. We have a requirement to share the configuration across both the nodes of the cluster to avoid keeping duplicate copies of configuration (server.xml). And since some of the server.xml configuration is generated runtime, it isn’t trivial in our case to keep these copies in sync. This is the prime reason to have a shared Tomcat configuration. We may also want, in future, to spawn and additional instance of Tomcat with re-usable configuration (except adjusting the port numbers ). The not-so-elegant choice we might have is to move the entire Tomcat installation to this cluster aware shared storage but defeats the purpose of having a shared disk for configuration data and not the binaries. What alternates should we explore? Thanks, Amit On 10/3/18, 10:16 AM, "Mark Thomas" <ma...@apache.org> wrote: On 02/10/18 17:41, Amit Pande wrote: > Hello SMEs, > > I am looking at Tomcat documentation to see if there is a way to move the “<Tomcat_Base_Folder>/conf” to a custom location and use this path while running the startup/shutdown scripts. Why? What problem are you trying to solve? > I have looked at the https://github.com/apache/tomcat85/blob/TOMCAT_8_5_34/java/org/apache/catalina/startup/Catalina.java and confirmed we can pass a -config <path_to_server_dot_xml> to the Tomcat scripts (catalina.bat/sh, startup.bat/sh, etc). > > Wanted to confirm: > > > 1. Why is “-config” option not documented as part of help of the startup/shutdown scripts? Is this a supported configuration that we can use without worrying about future breaking changes in this? It appears that this dates back to Tomcat 4.0.x (I couldn't find it in 3.3.x). It isn't something that I have seen used very much. If I had to guess, I'd say the option was added either when server.xml was the only configuration file or the location of the other configuration files could be specified in server.xml. Over the years additional configuration files were added to the default location and, because the -config option was little used, the requirement to make that location configurable wasn't considered. > 2. Currently, as part of “-config” option we’re able to pass on the path to server.xml only. What is required to be done so that entire Tomcat configuration (conf directory) can be moved to a custom location? Looks like a fair amount of work as $CATALINA_BASE/conf/ is hard-coded in a *lot* of places. Making it configurable is going to be very invasive. There would need to be a very strong justification for a change along those lines. > 3. I am still debugging why, but on Linux setups, I have observed “configtest” script isn’t working with “-config <path_to_server_dot_xml>”. I am seeing “WARNING: Unable to load server configuration from [path_to_server_dot_xml] Configuration error detected!”. Is this know issue on Linux system? It seemed to work fine for Windows. I suspect it is a bug. > Appreciate your inputs. At this point my recommendation would be to look at alternative solutions rather than using -config. Once we know what the requirement is, we can provide some advice. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org