How to Manage Apache Tomcat Update With Python


Enterprise Software architecture refers to high level structures and disciplines. For most organization managing software update may be the hardest part of building enterprise software architecture. Software updates are unavoidable in any information technology platform. For example, business needs, new features, security vulnerabilities etc. may be some reasons that force company to update existing software. Moreover, many company can no longer afford the high cost of update because of manual tasks.

Apache Tomcat software is an open-source web server tool which allows to implementation of the Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket technologies.This product was developed by the Apache Software Foundation with Java Community Process.

For administrator and web developers there are some points that should familiarize before start to design software directory structure.

At this post, we will focus on creating the directory structure and manage updates with python. Basically standard tomcat directory structure can visualize like that;

The main purpose to change default Tomcat directory structure is keeping existing configurations and web deployments while performing upgrade process. The Tomcat directory structure should strongly depend on application architecture.

I have added my default configuration. I always prefer to use a symbolic link for the configurations and deployment files. These files will be kept in a persistent storage area. In my case, AppDirectory will “/appdata/app”.

I added the directory structure for the file that I linked. Under binary directory, there are two files that I create symbolic links (setenv.sh and setvars.sh).

You should also need to create symbolic links for the configuration files that you specified.

The library directory contains default libraries when you install tomcat. You may need to add additional libraries to the application. So, you should create a directory to locate additional libraries (/appdata/app/lib/). Then you need to define additional libraries on setenv.sh file. The configuration will be;

ADDITIONALPATH=”/appdata/app/lib/test.jar:/appdata/app/lib/test2.jar”
CLASSPATH=$CLASSPATH:$ADDITIONALPATH

Last but not least important directories are “logs” and “webapps”. I strongly recommend creating symbolic links for these two directories.

I’m working on a python project that automates tomcat upgrade process with this structure. Basically you can check this GitHup project that I shared.

I aim to manage these tasks;

  • Check existing tomcat configuration
  • Create a backup
  • Allow user to choose tomcat version that will be updated
  • Download binaries
  • Perform update task on the remote server
  • Check tomcat status
  • Finish and summarize

Apache Tomcat® - Welcome!
The Apache Tomcat Project is proud to announce the release of version 8.5.37 of Apache Tomcat. Apache Tomcat 8.5.x…tomcat.apache.org

 

I'm a IT Infrastructure and Operations Architect with extensive experience and administration skills and works for Turk Telekom. I provide hardware and software support for the IT Infrastructure and Operations tasks.

205 Total Posts
Follow Me