First, environmental description:
Operating system: Ubuntu 12.04.2 LTS
tomcat:apache-tomcat-7.0.52
Second, download
: http://tomcat.apache.org/
The download here is apache-tomcat-7.0.52.tar.gz.
Three, installation configuration
I downloaded this download folder in the current user after it is completed. Go to download folder:
~$ cd ~/Download
Unzip the downloaded compressed package:
~$ TAR-ZXVF apache-tomcat-7.0.52.tar.gz
To rename an extract file:
~$ MV apache-tomcat-7.0.52 TOMCAT7
To move the Tomcat7 folder to/usr/local/:
~$ sudo mv tomcat7/usr/local/
Set Environment variables:
~$ sudo gedit/etc/profile
At the bottom, add:
#set Tomcat Environment
Catalina_home=/usr/local/tomcat7
Export Catalina_home
Save exit.
Go to the Tomcat7 folder:
~$ CD/USR/LOCAL/TOMCAT7
Edit catalina.sh File:
~$ sudo gedit bin/catalina.sh
Add at the end of the document:
Catalina_home=/usr/local/tomcat7
Java_home=/usr/local/java/jdk1.7.0_25
which Java_home is the installed JDK path, and Catalina_home is the installation path for Tomcat.
To start Tomcat:
~$ sudo./bin/startup.sh
If the following is displayed without any exceptions, the startup succeeds:
Using catalina_base:/USR/LOCAL/TOMCAT7
Using Catalina_home:/USR/LOCAL/TOMCAT7
Using Catalina_tmpdir:/usr/local/tomcat7/temp
Using Jre_home:/usr/local/java/jdk1.7.0_25
Using CLASSPATH:/usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jar
Tomcat started.
Stop Tomcat:
~$ sudo./bin/shutdown.sh
Iv. Installation of Tomcat services
To install the Tomcat service:
~$ sudo cp bin/catalina.sh/etc/init.d/tomcat
View Services:
~$ sudo service tomcat status
Lists a bunch of operation options, which means that the service is installed properly.
To start Tomcat through a service:
~$ sudo service tomcat start
Browser Access http://localhost:8080/tests whether the installation configuration was successful.
TOMCAT7 installation configuration for Ubuntu