Apache Tomcat is the right sized application server for web applications. It does not have the bloat and complexity of Java EE application server and continues to be light weight and efficient.
While Tomcat provides basic deployment capabilities, configuring Apache Tomcat instance for applications is a manual, error prone and repetitive process. When we launched Tcat Server, our goal was to make it extremely easy to use Tomcat in enterprises. I want to discuss one of the powerful features of Tcat Server that goes a step beyond making Tomcat easy to use – it helps you automate repetitive configuration tasks.
Server profiles in Tcat Server is the easiest way to group multiple Tomcat configuration files, dependent lib files and environment settings for the applications that you deploy.
For example, lets say web application you are deploying requires a third party library to be present in the lib directory under Tomcat. In addition, it also requires changes to context.xml file to insert a valve, and it requires that the initial heap size is atleast 512 MB.
The way you would do this in Tomcat is as below:
For each server that this app is being deployed to, repeat the following:
1. Manually copy the required lib file into Tomcat lib directory
2. Edit the context.xml file to make necessary modifications to include the valve
3. Depending on your operating system, set the environment variable
4. Restart the server
Lets say you are deploying your webapp onto 10 Tomcat instances – thats 40 steps.
Doing this on multiple servers is both time consuming, error prone and boring.
Wouldn’t you want a better way to do this? Presenting Server Profiles.
Here is how you do it using Server profiles:
Step 1: Create a work space to hold your lib file and modified context.xml file
Step 2: Create a profile, give it a name – in this case, lets call it ‘MySalesProfile’
Step 3: Enter desired value for JAVA_OPTS under environment variables ( remember your webapp requires atleast 512 MB of heap size )
Step 4: Select all the servers on which you want to make the configuration changes before deploying web application and apply Profile
Step 5: Restart all these servers, so JVM start parameters such as JAVA_OPTS take effect ( you can restart multiple servers from the console with a single click ).
Now you are done with necessary configuration changes needed prior to deploying a web application. Oh, and one more advantage is when you need to add additional servers to support increasing load, all you have to do is apply this profile to the newly added server.
Try it out for yourself by downloading Tcat Server for free.