Configuration Files and their Usage - Apache Tomcat (CTModelHouse)

Apache Tomcat 8 comes with a default setup, which can be directly used for a QA environment. We can customize Tomcat based on the environment specification. Components such as Services, Servers, Engine, Connectors, Realm, and Valve can be configured. The Tomcat configuration files are available in the conf folder. Let's discuss the configuration properties and their usage. Tomcat 8, by default comes with seven configuration files (usually in .xml format) whereas for CT deployment, we need to configure only the below mentioned files.

You can find the configuration properties in the path <Tomcat-Installed-Folder>/Conf. Let's discuss the configuration properties that are required for CT deployment as follows:
 
 server.xml: This is one of the important configuration files of Tomcat. It holds critical information, such as the IP address, port, virtual host, context path, and so on. Any changes made in the server.xml file will be in effect after restarting the Tomcat instance.
 
 web.xml: This defines the default values for all web applications loaded into this instance of Tomcat, at the time of start-up of the Tomcat instance. If a web application has its own deployment descriptor, its content will always override the configuration settings specified in this default descriptor. Application level resources are not defined in web.xml of the configuration folder. It would be better to define these in the application's web.xml. 

When the application is deployed, it will reference the application's web.xml for the resource, but not the server's web.xml. The server's web.xml should be used only for the server properties changes, such as the session parameter and so on, which references to the web/application server specific. You can find the application's web.xml file located at <Tomcat-Installed-Folder>/webapps/ctmodelhouse/WEB-INF/web.xml.

 context.xml: The contents of this file will load with every application. Configuration of parameters such as, session persistence, comet connection tracking, etc. are done here. This element is used to create a link to the global JNDI resource. Doing a JNDI lookup on the link name will then return the linked global resource.