Install Tomcat 7 on a cPanel Server

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:

cd /usr/local/jakarta

wget http://apache.claz.org/tomcat/tomcat-7/v7.0.41/bin/apache-tomcat-7.0.41.tar.gz

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:

cd ./tomcat/bin

tar -xvzf tomcat-native.tar.gz

cd commons-daemon-*

cd unix

./configure

make

cp jsvc ../../

Now kill off tomcat and restart it:

killall java

/scripts/restartsrv_tomcat

And add the latter command to /etc/rc.local:

sed ‘/starttomcat/d’ -i /etc/rc.local

echo ‘/scripts/restartsrv_tomcat’ >> /etc/rc.local

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s