Update: cPanel is no longer supported by cPanel for CentOS 7 or newer. It is recommended that you use cpanel4j. The below instructions are no longer relevant for CentOS 6 or older servers, since cPanel now includes Tomat 7 in EasyApache 3.
CPanel has soon promised that Tomcat 7 will be supported in a future EasyApache release. Until then, you can get easily get the support of Tomcat 7 with just a little bit of manual intervention. I will mention that right now, Tomcat 7 is not supported by cPanel so there’s no guarantee that their integrated features for Tomcat will work as expected.
First, go ahead and run EasyApache and select the option to install Tomcat. This will indeed install Tomcat 5.5, but that’s OK. Let EasyApache do the grunt work for you.
After it’s installed, you’ll need to put the Tomcat 7 files in place:
tar -xvzf apache-tomcat-7.0.41.tar.gz
ln -sf ln -sf /usr/local/jakarta/apache-tomcat-7.0.41 /usr/local/jakarta/tomcat
Note: The above example is based off of the latest version of Tomcat available at this time. You can get the latest version at http://tomcat.apache.org/download-70.cgi .
While still in the jakarta folder, compile the daemon:
tar -xvzf tomcat-native.tar.gz
cp jsvc ../../
Now kill off tomcat and restart it:
And add the latter command to /etc/rc.local:
sed ‘/starttomcat/d’ -i /etc/rc.local
echo ‘/scripts/restartsrv_tomcat’ >> /etc/rc.local