Apache Tomcat (also known as Tomcat) is an open-source implementation of Java Servlets and JavaServer pages. Tomcat uses a self-contained HTTP server to provide support for Java web applications.
How to install Tomcat on cpanel
Use this Tomcat installation and configuration on cpanel. Click the checkbox for Tomcat at the Short Options List stage of EasyApache within WHM.
To install Tomcat, select the Tomcat option in WHM’s EasyApache (Apache Update) or using “/scripts/easyapache” (without the quotes) in command line. The Tomcat selection is found in Short Options List area.
Once installation completed. You can enable for account via WHM-> Account Functions->Install Servlets. Select the account in the Account Selection table and click the Install button.
or
/scripts/addservlets –domain=domain.com
To disable
/scripts/remservelets –domain=domain.com
Subdomain servlet support
You would need to use command line for adding subdomain support for servlets as they do not automatically include that support and WHM does not have any option to add servlets to subdomains.
Addon domain servlet support
Addon domains will not work when added using command line if added by the addon domain name. The /usr/local/apache/conf/httpd.conf ServerName sub.domain.com line is what is used and it must match the Host name=”sub.domain.com” line in /usr/local/jakarta/conf/server.xml file exactly, so addon domain support is added by installing servlets onto the subdomain associated with the addon domain: