Tomcat Configuration - Guide to Configuring Tomcat

Configuring Tomcat involves modifying several configuration files and also setting appropriate environment variables. In this page we will discuss some of the common one.

Environment variables:
 
JAVA_OPTS: Modify this environment variable to increase the heap size of the JVM - this is critical when you deploy new applications and they might require more/less heap size to function properly. Several out of memory errors that happen when new apps are deployed can often be eliminated/reduced by setting appropriate heap memory settings.

CATALINA_HOME: This environment variable specifies the location of your Tomcat installation. It is a good idea to set this environment variable and not rely on the default guess that Tomcat startup scripts make.

CATALINA_OPTS: Use this environment variable to set Tomcat specific options.

Below are some of the key Apache Tomcat configuration files:

server.xml - The main Tomcat configuration file.

web.xml - A servlet specification standard format configuration file for servlets and other settings that are global to all web applications.

tomcat-users.xml - The default list of roles, users, and passwords used by Tomcat’s UserDatabaseRealm for authentication.

catalina.policy - The Java security policy file for Tomcat.

context.xml - The default context settings that are applied to all deployed contexts of all hosts in this installation of Tomcat.

 
Most often, you will find editing server.xml, for any major changes - for ex: the port number on which your applications would run, which connectors to turn on and off are specified in server.xml file.
 

Comments on this post:
 #
interesting article
 

Post new comment

The content of this field is kept private and will not be shown publicly.

Download Tcat Server - Tomcat Simplified

Develop, diagnose, manage, configure, and deploy your Apache Tomcat applications with ease, and break free from bloated legacy JEE app servers. Built on 100% Tomcat, with no changes to the core code, Tcat Server is free for developers, and there is no commitment required. Try it now, risk-free! 
 

click thumbnail to enlarge

Link to this page