Command line tip: In the examples provided below, $username represents the username associated with the individual cPanel account. For example, if the cPanel account's username is example123, then the following example:/home/$username/.bashrc
Should look like this in actual use:/home/example123/.bashrc
II. Installing Tomcat
1. Install the Tomcat RPM
First, we need to install the ea-tomcat85 and rng-tools packages. The command below will accomplish this quickly:
yum install ea-tomcat85 rng-tools -y
2. Add Tomcat Support to an account
Next, we need to add support for Tomcat to the account(s) that will need it. Use the command below, replicating for each user that requires Tomcat:
/scripts/ea-tomcat85 add $username
Once the above is complete, you can verify that Tomcat is enabled for the accounts with
/scripts/ea-tomcat85 list
III. Installing Ubic
1. Installation
Installation of Ubic for any given cPanel user is quite straight forward. It requires the cPanel user to have shell access to the server and write permissions to the users /home/$username/.bashrc file. The below command can be pasted into the shell/terminal while logged with root access after replacing $username with the correct username.
su - $username
echo "export PATH=$(dirname $(readlink /usr/local/cpanel/3rdparty/bin/perl)):$PATH" >> /home/$username/.bashrc
Note: You can skip the "su" command if you access SSH directly as the cPanel user.
a. CloudLinux Considerations
If you are using CloudLinux, then you will also need to run the following commands (from the root level) to add Java to the CageFS mounts:
cagefsctl --addrpm tzdata-java
cagefsctl --force-update
2. Verification/Testing
Once installed you can test that Ubic is functioning, and that Tomcat is installed/enabled for the user with this command (from the root level):
su - $username -s /bin/bash -c 'ubic status ea-tomcat85'
IV. Tomcat Environment Configuration
Configuration of the Tomcat environment is the most involved portion of this process. The steps outlined below can be used to configure the environment properly. Please be aware that the ports noted below are examples, and your specific ports may vary.
1. Configure the application directory
To enable the ROOT webapp directory for testing, add the following entry to the section in the /home/$username/ea-tomcat85/conf/server.xml file. This section begins with the deploy options, so this can be placed below the line containing the autoDeploy, deployOnStartup, and deployXML settings. Here's an example of how this should look, with the entry you must add displayed in bold text:
Info
