Frome Http://askubuntu.com/questions/339169/how-to-install-tomcat-7-0-42-on-ubuntu-12-04-3-lts
Note : Visit this question if your want to know why it's not in the repositories: why Don ' t the Ubuntu repositories has the latest versions of software?
Prerequisite : Need to has Java installed, and we need its path. Java is usually installed under /USR/LIB/JVM
. Once You has installed Java, you can run the command update-alternatives--config Java
to show you The exact path; Look at the first entry, the one with a , *
next to it. You can hit , Enter to exit this screen). We only need the directory after /jvm/
. On my machine, the directory was /usr/lib/jvm/java-7-openjdk-i386/
. This answer'll assume that's the Java directory, but you should change the commands accordingly.
wget http://mirror.atlanticmetro.net/apache/tomcat/tomcat-7/v7.0.42/bin/apache-tomcat-7.0.42.tar.gz
- This would download Tomcat 7.0.42 to your the current directory.
tar xzvf apache-tomcat-7.0.42.tar.gz
- This would extract the files.
sudo mv apache-tomcat-7.0.42 /usr/local
- This moves Tomcat to
/usr/local
. You can choose any path to want. The remaining commands would assume you had used this path.
nano ~/.bashrc
-This would open up a text editor. Go to the end of the file ( Alt + / ) and add the following lines:
Export Catalina_home=/usr/local/apache-tomcat-7.0.42export java_home=/usr/lib/jvm/java-7-openjdk-i386/
Remember: This is the path to my Java. Change it to your installed Java.
. ~/.bashrc
- This would apply the changes we made.
sudo $CATALINA_HOME/bin/startup.sh
-You should see something like this:
Using catalina_base: /usr/local/apache-tomcat-7.0.42using catalina_home: /usr/local/ Apache-tomcat-7.0.42using catalina_tmpdir:/usr/local/apache-tomcat-7.0.42/tempusing JRE_HOME: /usrUsing CLASSPATH: /usr/local/apache-tomcat-7.0.42/bin/bootstrap.jar:/usr/local/apache-tomcat-7.0.42/bin/ Tomcat-juli.jar
and no errors.
You're done. Point your browser to and you should see the http://localhost:8080
Tomcat page:
Install Tomcat 7.0.42 in Ubuntu