1 / 20

Information on Tomcat in cPanel & WHM

Apache Tomcat is used to serve Java-based applications. It is important to know the way in which Tomcat can be installed and uninstalled, configured, and how Tomcat support can be added for a user.

htshosting
Download Presentation

Information on Tomcat in cPanel & WHM

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Information on Tomcat in cPanel & WHM

  2. Table of Contents • Adding Tomcat Support for a User (Continued I) • Adding Tomcat Support for a User (Continued II) • Jailshell User Considerations • Jailshell User Considerations (Continued) • Running Tomcat • Custom Configurations • LiteSpeed Web Server • Tomcat in EasyApache 3 Vs. Tomcat in EasyApache 4 • Introduction • Important Recommendations • Tomcat Installation Requirements • Tomcat Installation • Tomcat Uninstallation • Configuration • Default Configuration • Adding Tomcat Support for a User

  3. Introduction • The information contained here applies to Tomcat in cPanel & WHM version 76 and the later versions. Apache Tomcat is an open-source project and is one of the most well-known web server and Servlet container for Java code. It lets you serve applications that are Java-based. The option to install Tomcat 8.5 is provided by EasyApache 4. • In the context of web servers, these are used by web hosting companies for hosting websites. Web hosting can be of many types, such as shared, reseller, dedicated, VPS, cloud and Windows. The most efficient web hosting services are popularly referred to as the “Best Website Hosting”, the “Best Cloud Hosting”, the “Best VPS Hosting”, etc.

  4. Important Recommendations • It is highly recommended that Tomcat be installed by only experienced Tomcat administrators. • Regarding Tomcat, there can be security issues on systems that have multiple users. • It is advised that the risks associated with this feature be understood prior to using it.

  5. Tomcat Installation Requirements • Root-level access is required by Tomcat for installation. It needs to be mentioned here that Tomcat is not supported by cPanel & WHM on servers which run CentOS 8 or AlmaLinux 8.

  6. Tomcat Installation • Tomcat installation can be in the interface or on the command line. Let us touch upon each of these individually. • Tomcat installation in the interface – Use the EasyApache 4 interface of WHM for this purpose. WHM >> Home >> Software >> EasyApache 4 • It is the Additional Packages section where Tomcat will appear. • Tomcat installation on the command line – The below-mentioned command needs to be run on the command line. This needs to be done as the root user. • yum install ea-tomcat85

  7. Tomcat Uninstallation • Tomcat uninstallation can be in the interface or on the command line. Let us touch upon each of these individually. • Tomcat uninstallation in the interface - Use the EasyApache 4 interface of WHM for this purpose. WHM >> Home >> Software >> EasyApache 4 • It is the Additional Packages section where Tomcat will appear. • Tomcat uninstallation on the command line – The below-mentioned command needs to be run on the command line. This needs to be done as the root user. • yum remove ea-tomcat85

  8. Configuration • Tomcat runs as a private instance, per-user, in EasyApache 4. This aids in enhancing security and enables the user in the management of their individual Tomcat services. Its flip side is that it increases memory load on the server. It is recommended that the configuration of the server be taken into account, prior to enabling Tomcat for many users. • The configuration files of Tomcat 8.5 are placed in the below-mentioned location. /home/user/ea-tomcat85/conf • In it the term, “user” represents the user’s name for whom Tomcat has been installed.

  9. Default Configuration Certain configuration changes are made to the default Tomcat 8.5 behaviour by EasyApache 4. It takes place in the file, ~/ea-tomcat85/conf/server.xml These configuration changes are as follows: • Disabling the shutdown port (by default) • Setting the xpoweredBy • Removing the attribute, redirectPort • Adding the class, ErrorReportValue , to all Hosts that have the showServerInfo value set to a false value • Setting the below-mentioned Host attributes to a false value. • autoDeploy • deployOnStartup • deployXML It needs to be mentioned here that you might need to make certain security changes, based on the requirements of the Tomcat of your system.

  10. 1-800-123 -8156 Whoa! That’s a big number, aren’t you proud?

  11. Adding Tomcat Support for a User Configuring Crontab Access – Crontab access needs to be granted to Tomcat users. If that is not done, then the user will not be able to use Tomcat. The user must be present in the file, /etc/cron.allow , if such a file exists. It needs to be ensured that the user is not present in the file, /etc/cron.deny , if such a file exists. For determining if a user has crontab access, the following steps need to be performed: • Navigate to the List Accounts interface in WHM. WHM >> Home >> Account >> Information >> List Accounts • Click the logo of cPanel in order to log in to the account as the user. • Navigate to the Terminal interface in cPanel. cPanel >> Home >> Advanced >> Terminal • Run the command, crontab -l If an error is received, then crontab access needs to be granted to Tomcat users. The user needs to be removed and re-added to Tomcat, post being granted crontab access.

  12. Adding Tomcat Support for a User (Continued I) In the interface – The Tomcat Manager interface in WHM needs to be used for adding Tomcat 8.5 support to a user. WHM >> Home >> Software >> Tomcat Manager On the command line – The following command needs to be run for adding Tomcat 8.5 support to a user. It needs to be carried out as the root user. /usr/local/cpanel/scripts/ea-tomcat85 [argument] [option] • Certain arguments are accepted by the script, /usr/local/cpanel/scripts/ea-tomcat85  • These are mentioned in the following slide. In it, the term, “user” represents the user that has to be changed and “command” represents an argument that is meant for the script.

  13. Adding Tomcat Support for a User (Continued II) The arguments accepted by the script, /usr/local/cpanel/scripts/ea-tomcat85 are as follows: • add user – Adds Tomcat 8.5 support to a user • rem user – Removes Tomcat 8.5 support from a user • list – Lets you view the users with a Tomcat 8.5 instance • hint [command] – Displays help information in abbreviated form. In it, the command is totally optional. If a command is specified, then the abbreviated help information of only that command will be displayed. • help [command] - Displays the help information of the script. In it, the command is totally optional. If a command is specified, then the help information of only that command will be displayed.

  14. Jailshell User Considerations • The status of their Tomcat service, that had been previously started, cannot be seen by the Jailshell users. Users are only allowed to view the processes of their current session by the default jailshell permissions.

  15. Jailshell User Considerations (Continued) The system launces a duplicate process when an attempt is made to restart a service that is already active with Ubic. This can be addressed with the aid of one of the below-mentioned actions. • Selecting Always mount a full /proc under the Jailed /proc mount method option. This option is in the System section of the Tweak Settings interface of WHM. WHM >> Home >> Server Configuration >> Tweak Settings When this functionality is enabled, all running processes can be seen by a jailshelled user. This lets the jailshell user break out of the shell. When this setting is not enabled, the Tomcat service will be stopped by Ubic, when the shell is exited. It needs to be mentioned that a normal shell can be assigned to the user. It is not recommended to do nothing as this might create confusion and the user might start duplicate processes.

  16. Running Tomcat • Usually on virtual machines, Tomcat might take a long time to start serving requests on initial start-up. There are certain suggestions regarding ways that start Tomcat server quickly but those are not part of the information contained here. When considering those solutions, system administrators need to opt for a solution that best serves their specific needs. • To digress, AJP can be used by Tomcat 8.5 for serving applications in EasyApache 4.

  17. Custom Configurations An environment is created that could be configured by the user for his unique requirements when either of the following happen: • A user is added with the Tomcat Manager interface in WHM. WHM >> Home >> Software >> Tomcat Manager • A user is added with the script, /usr/local/cpanel/scripts/ea-tomcat85 When Tomcat access is assigned to a cPanel user, 2 ports are assigned by the script to the user. These port assignments could be found in the file, /etc/cpanel/cpuser_port_authority.json and in the user’s file, ~/ea-tomcat85/conf/server.xml Any custom behaviour needs to be configured manually. If you want to change the way in which Tomcat interacts with Apache, you need to edit or create the appropriate file in the directory, /etc/apache2/conf.d/userdata/

  18. LiteSpeed Web Server • LiteSpeed’s versions earlier than build 6 (5.3.5) are incompatible with the ProxyPassMatch directive. Due to this, LiteSpeed does not proxy from the assigned port to port 80. You need to update your LiteSpeed server to a version that is new and compatible. Alternatively, you can use the assigned port of the Tomcat instance.

  19. Tomcat in EasyApache 3 Vs. Tomcat in EasyApache 4 • Tomcat is handled differently by EasyApache 3, when compared to EasyApache 4. Tomcat 8.5 is provided by EasyApache 4, instead of Tomcat 7. • Tomcat was present as a shared service in EasyApache 3. Moreover, all applications ran as the tomcat user. A container was created within a shared file by the server. This shared file was, server.xml  • Tomcat runs as a per-user private instance in EasyApache 4. It lets the user configure his instance himself. Here, Tomcat runs as the individual user, and not as the tomcat user. This aids in enhancing security. Additionally, the user controls the management of the Tomcat instance. This might affect the performance of the server because of the memory requirements. • Prior to concluding, it needs to be mentioned that the mod_proxy_ajp Apache module is provided by EasyApache 4 rather than the mod_jk connector.

  20. Thanks! ANY QUESTIONS? www.htshosting.org

More Related