The largest Interview Solution Library on the web


« Previous | 1 | 2 | 3 | Next »

Tomcat - Configuration files and their usage


Apache Tomcat 7 comes with a default setup, which can be directly used for a QA environment. We can customize Tomcat based on the environment specifi cation; components such as Services, Servers, Engine, Connectors, Realm, and Valve can be confi gured. The Tomcat confi guration fi les are available in the conf folder. Let's discuss the confi guration properties and their usage.

Tomcat 7, by default, comes with seven confi guration fi les (usually in XML format), and these fi les are very useful in order to customize Tomcat, based on the environment needs. We shall install in the production or development environment.

It's very important from an administrator's point of view, to know about the confi guration fi les and their usage in the Tomcat environment. Let's discuss the confi guration properties one-by-one, as follows:
  • catalina.policy: This fi le describes the security policy permissions for Tomcat 7. It enforces the security policy permissions by JVM on the web application.

    When catalina is executed with the -security option, the security policy mentioned in the catalina fi le is used and the web application security policy also gets executed.

  • catalina.properties: This fi le contains the shared defi nition of the server, shared loader, and JARs, which need to be scanned at the time of the server startup.
  • server.xml: This is one of the important confi guration fi les of Tomcat. It holds critical information, such as the IP address, port, virtual host, context path, and so on.
  • tomcat-users.xml: This fi le is used for authentication, authorization, and role-based defi nitions. It is used to implement a database of users/ passwords/roles for authentication and container-managed security. To add/remove users or assign/unassign roles to existing users, edit this fi le.
  • logging.properties: As the name suggests, it defi nes the logging properties of the Tomcat instances (such as startup logs).
  • web.xml: This defi nes the default values for all web applications loaded into this instance of Tomcat, at the time of startup of the Tomcat instance. If a web application has its own deployment descriptor, its content will always override the confi guration settings specifi ed in this default descriptor.
  • context.xml: The contents of this fi le will load with every application. Confi guration of parameters such as session persistence, Comet connection tracking, and so on, are done here.
Any changes made in the server.xml fi le will be in effect after restarting the Tomcat instance.

Application level resources are not defi ned in the web.xml of the confi guration folder. It would be better to defi ne these in the application web.xml.
« Previous | 1 | 2 | 3 | Next »


copyright © 2014 - all rights riserved by javatechnologycenter.com