The pre-built images for Tomcat on App Service Linux include the default Catalina Base located in /usr/local/tomcat. By design, any changes made outside of /home will not be persistent after restarts. So, if making changes to the Tomcat server, this would need to be done with a startup script or moving our entire Catalina base within /home, which is covered in this article.
📝 When changing the Catalina Base, this installation is no longer maintained nor in sync with the App Service Platform if changes occur around the default configuration, path mappings or environment variables. If minimal changes are required we recommend using a startup script
See below to learn more about Persistent Storage or Leveraging startup scripts to modify Tomcat:
Custom Tomcat Configuration
The Java Tomcat image includes built-in logic during startup to update the Catalina base if
/home/tomcat/conf/server.xml is detected on the filesystem. Once moved this will allows for complete control over the Tomcat installation & which will also be persistent between restarts.
Navigate to SSH via Kudu i.e
- Run the command to copy the existing tomcat contents from /usr/local/ to /home/
cp -R /usr/local/tomcat/ /home/tomcat
- Restart the container & validate the $CATALINA_BASE from SSH or check the default parking page.
- Walk through the default configuration & make any necessary changes to your installation.