Installing tomcat 6.0 on MediaTemple dedicated server
In the last post, I looked at how Java can be configured on MediaTemple CentOS server. This post will show you how you can install Tomcat on your server.
1. Download and extract tomcat 6.0 binary distribution. Get the URL of the tar.gz file from http://tomcat.apache.org/download-60.cgi. From the ssh console download using wget.
wget http://apache.deathculture.net/tomcat/tomcat-6/v6.0.14/bin/apache-tomcat-6.0.14.tar.gz
Now use the following commands to extract the files.
gunzip -d apache-tomcat-6.0.14.tar.gz
tar -xvf apache-tomcat-6.0.14.tar
2. set JAVA_HOME variable to point to your Java installation.For this you need to login as root. Create or edit a java.sh inside /etc/profile.d. Add the following line in java.sh.
export JAVA_HOME=/usr/java/jdk1.6.0_04
3. Start tomcat from bin folder. Login again to SSH using your non root user id. The startup script for tomcat is in [tomcatdir]/bin. Change to bin and then execute,
./startup.sh
Voila! You should see the tomcat server running at www.yourdomain.com:8080/
To shutdown you can use ./shutdown.sh, but for some reason I am not able to execute it. So currently the only way to stop is to kill the Java process from SSH. Update: I got shutdown.sh working by adding -Xmx4m as JVM parameter in catalina.sh for “stop” block of code.
Now my next task is to get Struts2 sample application running on this…



March 4th, 2008 17:16
Nice article. I have already installed the JDK, but I have a question.
In which directory should I install the Tomcat? Do I need to install it in every Virtual Server? or it’s ok with one installation for all the domains.
Thank you in advance.