(1)download apache-tomcat-7.0.30.tar.gz
(2) unzip: tar-zxvf apache-tomcat-7.0.30.tar.gz
(3) copy to/usr/local and rename it as tomcat7: sudo CP-r APACHE-Tomcat-7.0.30/usr/local/tomcat
(4) Go to the bin directory under tomcat7: CD/usr/local/tomcat7/bin
(5) start Tomcat 7: sudo./startup. Sh
Display: Using catalina_base:/usr/local/tomcat7
Using catalina_home:/usr/local/tomcat7
Using catalina_tmpdir:/usr/local/tomcat7/temp
Using jre_home:/usr/Java/jdk1.7.0 _ 07
Using classpath:/usr/local/tomcat7/bin/Bootstrap. jar:/usr/local/tomcat7/bin/tomcat-juli.jar
(6) Disable Tomcat 7: sudo./shutdown. Sh
Display: Using catalina_base:/usr/local/tomcat7
Using catalina_home:/usr/local/tomcat7
Using catalina_tmpdir:/usr/local/tomcat7/temp
Using jre_home:/usr/Java/jdk1.7.0 _ 07
Using classpath:/usr/local/tomcat7/bin/Bootstrap. jar:/usr/local/tomcat7/bin/tomcat-juli.jar
(7) Add the Tomcat environment variable sudo VI/etc/profile, in red
# Set environment variable
Export java_home =/usr/Java/jdk1.7.0 _ 07
Export classpath =.: $ java_home/JRE/lib/RT. jar: $ java_home/lib/dt. jar: $ java_home/lib/tools. Jar
Export tomcat_home =/usr/local/tomcat7
Export catalina_home =/usr/local/tomcat7
Export Path = $ path: $ java_home/bin
(8) Make the configuration take effect: sudo source/etc/profile.
(9) by default, Tomcat does not provide an account with administrative permissions, so you need to add an account with such permissions. Role Manager-Gui has this permission, but the two roles and their corresponding users are not set in the System user control file tomcat-users.xml, so you need to add such roles and users, to open the tomcat-users.xml file, add the following:
<Role rolename = "Manager-Gui"/>
<User Username = "manager" Password = "manager" roles = "Manager-Gui"/>
Restart the Tomcat server, and the file modification takes effect.