Like the previous software, Tomcat is also developed by Java. Therefore, JDK must be installed before installation.
You can go to the http://tomcat.apache.org/download-70.cgi to download the latest tomcat.
I downloaded a apache-tomcat-7.0.5.tar.gz.
Installation:
1. First, move apache-tomcat-7.0.5.tar.gz to the/OPT directory and decompress it:
1 2 3
|
Sudo CD apache-tomcat-7.0.5.tar.gz/OPT
Sudo tar zxvf apache-tomcat-7.0.5.tar.gz |
2. Then, CD to the/OPT directory, We can rename the folder (for convenience in the future ):
1
|
Sudo mv apache-Tomcat-7.0.5 tomcat7 |
3. CD to/opt/tomcat7/bin, edit the Catalina. Sh file, and insert the following code into the file (insert to '#' comment end, where the body starts ):
1 2 3
|
Java_home =/opt/jdk1.6.0 _ 22 // <-- depends on the JDK installation directory.
Java_opts = "-server-xms512m-xmx1024m-XX: permsize = 600 m-XX: maxpermsize = 600 m-DCOM. Sun. Management. jmxremote" |
4. Save and close. In this way, Tomcat 7 is basically installed. Port 8080 by default. You can change 8080 to another port in server. xml under the conf directory.
CD to/opt/tomcat7/bin and run:
If:
1 2 3 4 5 6 7 8 9 |
using catalina_base: /opt/tomcat7 using catalina_home: /opt/tomcat7 using catalina_tmpdir: /opt/tomcat7/temp using jre_home: /opt/jdk1.6.0 _ 22 using classpath: /opt/tomcat7/bin/Bootstrap. jar:/opt/tomcat7/bin/tomcat-juli.jar |
It should have been enabled successfully. You can access the local webpage for testing:
Http: // 127.0.0.1: 8080/
In this way, Tomcat 7 will be installed under your Ubuntu! Pai_^