- Download the latest version of apache-tomcat from here.
- "cd /downloaded/directory" --> In terminal, go to the downloaded directory.
- "sudo cp apache* /usr/local" --> Copy the downloaded file to /usr/local (can be changed, I prefer local dir).
- "sudo chmod a+rwx apache*" --> change the access permissions.
- "sudo tar zxvf apache*" --> unzip the tar.gz file.
- "export JAVA_HOME=/usr/local/java/jdk1.6.0_17" --> set up JAVA_HOME env variable
- "export PATH=$JAVA_HOME/bin:$PATH" --> add java bin to path
- "export CATALINA_HOME=/usr/local/apache-tomcat-6.0.32" --> optional to set up these env variables.
- "cd $CATALINA_HOME/bin" --> go to bin folder to access scripts.
- "sudo sh startup.sh" --> to manually start Tomcat
- "localhost:8080" --> Go to browser and access the page to see configuration page of Tomcat.
- If step 11 returns error, "cd $CATALINA_HOME/logs" --> go to logs folder and view "catalina.
.log" file to see what went wrong. If everything went well, you should see "INFO: Starting Coyote HTTP/1.1 on http-8080". If you see "java.net.BindException: Address already in use", shutdown and restart Tomcat. - "sudo sh $CATALINA_HOME/bin/shutdown.sh" --> to shutdown Tomcat.
Src: http://www.puschitz.com/InstallingTomcat.html#InstallingTomcatSoftware
EXTRA:
Mac: Installing Tomcat
src: http://developer.apple.com/internet/java/tomcat1.html
1. Download tomcat tar.gz from archives.
2. do sudo and extract it to /usr/local
3. give ownership to your username by chown -R username foldername
4. set up startup and stop scripts.
5. Access via localhost:8080 to check installation.