Tomcat allows you to disable the configuration from the main server.xmlone by creating an xml file under $CATALINA_BASE/conf/[enginename]/[hostname], called [YourWebappName].xml.
For instance: $CATALINA_BASE/conf/Catalina/localhost/PetClinic.xml
This file contains a basic element <Context>that defines the configuration of the webapp context. Here you can define your own webapp area with the necessary authentication parameters for your application.
This mechanism is designed so that you can change the configuration of the web application without touching the top-level shared files in the Tomcat folder conf.
source
share