Test environment: Install Oracle Enterprise Linux 5.8 64-bit Virtual Machine in VMware Workstation v9.0.2
Install software: jdk-7u40-linux-x64.rpm?apache-tomcat-7.0.53.tar.gz
Installation instructions: Download jdk-7u40-linux-x64.rpmand apache-atat-7.0.53.tar.gz from the official network to the/u02 directory of the Linux Virtual Machine
Installation Procedure: Open the vmwarevm, log on to the Linux VM as the root user, right-click the system, right-click the desktop, choose terminal, and execute the following command.
1. Install JDK
Rpm-ivh/u02/jdk-7u40-linux-x64.rpm
Java-version
Cd/
Ii. install Tomcat
Rm-rf/usr/tomcat7
Cd/usr
Ls
Cd/
Tar zxvf/u02/apache-tomcat-7.0.53.tar.gz
Cd/root/apache-tomcat-7.0.53
Ls
Cd/
Mv apache-tomcat-7.0.53/usr/tomcat7
Cd/usr/tomcat7
Ls
Chmod + x/usr/tomcat7
3. Set Environment Variables
Run the vim/etc/profile command and add the environment variable Code as follows:
# Jdk config
Export JAVA_HOME =/usr/java/jdk1.7.0 _ 40
Export CALSSPATH = $ JAVA_HOME/lib /*.*
# Tomcat config
Export TOMCAT_HOME =/usr/tomcat7
Export CATALINA_HOME =/usr/tomcat7
# Path config
Export PATH = $ PATH: $ JAVA_HOME/bin: $ TOMCAT_HOME/bin
Execute Command source/etc/profile to refresh environment variable
4. start Tomcat
Sh/usr/tomcat7/bin/startup. sh
Open the URL http: // localhost: 8080 in Firefox to test
Disable Tomcat command sh/usr/tomcat7/bin/shutdown. sh
5. Delete the installed Tomcat test directory
Rm-rf/usr/tomcat7
Cd/usr
Ls