How to install tomcat 5 on cPanel server and upgarde to 7

Posted: 3p in cPanel
Tags: , , , ,

Tomcat Installation on cPanel server.

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
Step 5’s Apache Options area.

It will install Tomcat 5.5.35 on the server.
Steps to upgrade Tomcat to version 7.0.32 are given below.

1) The Tomcat 5 is installed in /usr/local/jakarta/ directory with the symbolic link tomcat. For
example:

[~]# ll /usr/local/jakarta
drwxr-xr-x 4 tomcat nobody 4096 Apr 5 17:15 ./
drwxr-xr-x 22 root root 4096 Mar 5 15:39 ../
drwxr-xr-x 12 tomcat nobody 4096 Apr 4 17:02 apache-tomcat-5.5.35/
lrwxrwxrwx 1 tomcat nobody 39 Apr 4 17:04 tomcat -> /usr/local/jakarta/apache-tomcat-5.5.35/

2) Then download and extract Tomcat 7 in /usr/local/jakarta directory
[~]# cd /usr/local/jakarta
[/usr/local/jakarta]# wget http://apache.techartifact.com/mirror/tomcat/tomcat-7/v7.0.32/bin/apache-tomcat-7.0.32.tar.gz
[/usr/local/jakarta]# tar -xzvf apache-tomcat-7.0.32.tar.gz
[/usr/local/jakarta]# chown -R tomcat.nobody apache-tomcat-7.0.32/

3) Then Change the tomcat symbolic link to point to your new version (i.e.
/usr/local/jakarta/apache-tomcat-7.0.32)
[/usr/local/jakarta]# rm -rf tomcat
[/usr/local/jakarta]# ln -s /usr/local/jakarta/apache-tomcat-7.0.32 tomcat
[/usr/local/jakarta]# chown -h tomcat.nobody tomcat

4) Then compile the new Tomcat version on cPanel server.
[~]# cd /usr/local/jakarta/apache-tomcat-7.0.32
[/usr/local/jakarta/apache-tomcat-7.0.32]# cd ./bin
[/usr/local/jakarta/apache-tomcat-7.0.32/bin]# tar xvfz commons-daemon-native.tar.gz
[/usr/local/jakarta/apache-tomcat-7.0.32/bin]# cd commons-daemon-1.0.10-native-src/unix
[/usr/local/jakarta/apache-tomcat-7.0.32/bin/commons-daemon-1.0.10-native-src/unix]
[~]# ./configure
[~]# make
[~]# cp jsvc ../..
[~]# cd ../../..

5) Copy over any Host blocks from /usr/local/jakarta/tomcat/conf/server.xml from the old Tomcat install to the new Tomcat install (you may or may not be able to set up new hosts through WHM).

6) Copy over /usr/local/jakarta/tomcat/conf/workers.properties from the old Tomcat install to the new Tomcat install.

7) To use the web administration gui you have to add the gui role in
/usr/local/jakarta/apache-tomcat-7.0.32/conf/tomcat-users.xml file.

You may copy and paste the above code into the tomcat-users.xml file and change the “name”
and “pwd” fields accordingly.

[/usr/local/jakarta/apache-tomcat-7.0.32/conf]#ls -l
-rw——- 1 tomcat nobody 6818 Oct 11 02:04 server.xml
-rw——- 1 tomcat nobody 1734 Oct 9 13:10 tomcat-users.xml
-rw——- 1 tomcat nobody 5563 Oct 9 12:25 workers.properties

8) Restart the server
[/]# reboot
Or
[/]# /usr/local/jakarta/tomcat/bin/shutdown.sh
[/]# /usr/local/jakarta/tomcat/bin/startup.sh
[/]# /etc/init.d/httpd restar
t

9) Check Tomcat Version
[/]# sh /usr/local/jakarta/tomcat/bin/version.sh

The cPanel EasyApache system makes it easy to recompile Apache with various add-ons and modules.

If you ever need your old Tomcat back just stop Tomcat, flip the tomcat symbolic link back to the old install, and restart Tomcat.
===========================================================>

Advertisements
Comments
  1. yatin says:

    Thanks ! its working ~

Leave a Reply

Fill in your details below or click an icon to log in:

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