Here are some notes for using the built-in Apache Tomcat package in Red Hat Enterprise Linux (RHEL) 7. For an overview of installing and turning on Tomcat, see my previous post RHEL 7 Administration Notes. In brief, use
yum to install the tomcat package and
systemctl to control the tomcat service. The previous post also gives a short example for using the mod_proxy_ajp for optimized reverse proxy behind the Apache HTTPD Web Server (provides front-end performance, load balancing support, and easier SSL configuration). Optionally use
firewall-cmd if you want end-users to connect directly to Tomcat.
One of the most important Distribution-Specific things to know for a package like Tomcat is the default location of user configurable folders and files. Here are some key file and folder locations for the Tomcat package distributed with RHEL 7.
/var/lib/tomcat/webapps# deploy your web apps here
/etc/tomcat/*# Tomcat server configuration files here (server.xml, etc)
/var/log/tomcat/*# Tomcat log files are stored here and auto-rotated by RHEL 7
/etc/tomcat/tomcat.conf# JAVA_OPTS like -D* and -X* are set here for RHEL 7
- For Tomcat RAM adjustment
- see default -Xmx with command:
java -XshowSettings# listed as Max. Heap Size
If you want to use the Tomcat Manager (Admin Web App), you can install that as a separate package.
yum install tomcat-admin-webapps
- Un-comment admin/manager roles and add a new user with both roles.
systemctl restart tomcat# Restart service to activate manager web app
- Connect to your Tomcat with a server-relative URL of
/manager/to use the Admin Web App. Examples:
Good luck with your RHEL 7 Tomcat projects! Hopefully using the provided packages will help make your web app deployment easier and add some extra security by providing Tomcat patches direct from Red Hat.