UbuntuServer12.04 because of source version problems, the automatic installation package on the source is not used. Old Rules: Tomcat7.0.40Core: uninstall :~ 1. Still
Install Tomcat 7.0.40 on Ubuntu Server 12.04
Because of source version issues, so no use of Source Automatic Installation Package, old rules, Tomcat 7.0.40 Core: http://mirror.bit.edu.cn/apache/tomcat/tomcat-7/v7.0.40/bin/apache-tomcat-7.0.40.tar.gz
Enter the root directory of the currently logged-on user :~
1. decompress the package
Tar-xzf apache-tomcat-7.0.40.tar.gz
Obtain the apache-tomcat-7.0.40 folder.
2. Change the name. Otherwise, it hurts:
Mv apache-tomcat-7.0.40 tomcat
3. Add/usr/local/
Sudo mv tomcat/usr/local/
4. Enter/usr/local/tomcat
Cd/usr/local/tomcat
5. Change users (Security First)
Sudo chown-R root.
Sudo chgrp-R root.
6. Add Environment Variables
Sudo su-
Vi/etc/profile
Add at the bottom:
CATALINA_HOME =/usr/local/tomcat
Export CATALINA_HOME
Save and exit
Refresh variable
Source/etc/profile
7. Enter $ CATALINA_HOME/bin
Cd $ CATALINA_HOME/bin
8. Modify catalina. sh.
Vi catalina. sh, find
# OS specific support. $ var _ must _ be set to either true or false.
Define CATALINA_HOME and JAVA_HOME again in this line:
CATALINA_HOME =/usr/local/tomcat
JAVA_HOME =/usr/local/java/jdk1.7.0 _ 21
Save and exit
9. log out of the root account and try to start tomcat.
Logout
Sudo./bin/startup. sh
If the following is displayed without any exception, the startup is successful:
Using CATALINA_BASE:/usr/local/tomcat
Using CATALINA_HOME:/usr/local/tomcat
Using CATALINA_TMPDIR:/usr/local/tomcat/temp
Using JRE_HOME:/usr/local/java/jdk1.7.0 _ 21
Using CLASSPATH:/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/tomcat-juli.jar
10. Stop tomcat: sudo./bin/shutdown. sh
11. 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, indicating that the service is properly installed.
12. start tomcat
Sudo update-rc.d-f tomcat ults
13. Start a service.
Sudo service tomcat start
14. If there is no problem, restart and try again ..
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2