Downlink:
Download the new tomcat version from the official Tomcat website.
Http://tomcat.apache.org/download-70.cgi
Note:, Be sure to download the non-source code file (the question does not contain SRC); otherwise, an error will occur when running Tomcat:
could not find the main class:org.apache.catalina.startup.Bootstrap
Configure environment variables and others:
(1) sudo gedit /etc/environment
Add: tomcat_home =/home/username/tomcat/tomcat6
(2) sudo gedit /etc/profile
Change the export path to: Export Path = $ java_home/bin: $ tomcat_home/bin: $ path
(3) gedit /home/username/tomcat/tomcat6/conf/tomcat-users.xml
Add a line before </tomcat-users>: <User Username = "admin" Password = "password" roles = "Admin, Manager"/>
(4) gedit /home/username/tomcat/tomcat6/conf/server.xml
To solve the garbled problem, change connector:
<Connector Port = "8080" protocol = "HTTP/1.1"
Connectiontimeout = "20000"
Redirectport = "8443"
Uriencoding = "UTF-8" Usebodyencodingforuri = "true"/>Start Tomcat:
(1) perform chmod authorization on all sh files under tomcat6/bin, such as sudo chmod + x digest. Sh.
Otherwise, the following error occurs: The basedir environment variable is not defined correctly this environment variable is needed to run this program.
(2) create a logs folder in the tomcat6 Folder: mkdir/home/username/tomcat/tomcat6/logs
Otherwise, the following error occurs: Touch: cannot touch "/tomcat/tomcat6/logs/Catalina. Out": the file or directory does not exist.
PS: if a problem occurs during running, open logs to view the problem information.
(3) Run./startup. Sh in Bin.
(4) Enter http: // localhost: 8080 in the browser to view the Tomcat page. Success ~!
The main directory of the Tomcat webpage is/tomcat/Webapps/, You only need to add the corresponding web page in the webapps directory to access it in the browser. The default Tomcat directory is the root directory under webapps.
If the page cannot be loaded and an error occurs in logs/Catalina. out:
Information: The APR based Apache Tomcat native library which allows optimal performance in production environments was
Not found on the java. library. path:/usr/lib/JVM/Java-6-sun-1.6.0.24/JRE/lib/i386/client: /usr/lib/JVM/Java-6-sun-1.6.0.24/JRE/lib/i386
:/Usr/lib/JVM/Java-6-sun-1.6.0.24/JRE /.. /lib/i386:/usr/Java/packages/lib/i386:/lib:/usr/lib
The library file cannot be found. Modify classpath: classpath =.: $ java_home/lib/dt. jar: $ java_home/lib/tools. jar: $ java_home/lib.
In addition, if you want to install Tomcat using the source method, see the http://wiki.ubuntu.org.cn/Tomcat