1,First download from the official websiteJdk1.6AndTomcat6
JDK:Http://download.java.net/jdk6/
Tomcat6:Http://tomcat.apache.org/download-60.cgi
As the server is far away from the data center, I am in the company. If you download it to your local computer and upload it to the server, this is a big project, especiallyJDKJust70MultipleM. So I chose to useWgetDownload it directly from the server. So I searched the internet,WgetThe functionality of this stuff is really powerful in the legend. But I only need to download two files, so the download method is very simple.
# WgetHttp://xxx.xxx.xxx/xxx.zip
Enter this command on the terminal. TheURLIs the object to be downloadedURL. The downloaded file is currently executed.WgetCommand directory.
Download two installation files.
2,InstallJdk1.6
In the downloaded file directory, that isJdk-6u14-ea-bin-b03-linux-i586-10_mar_2009-rpm.binDirectory Input
ShJdk-6u14-ea-bin-b03-linux-i586-10_mar_2009-rpm.bin
After execution, you can seeInstallProgramOn the page asking if you want to abide by the license agreement, you can press ENTER or space to complete the agreement.
A line of words appears:Do you agree
To the above license terms? [Yes or No]
The installer asks if you are willing to comply with the license agreement you just saw. Of course you have to agree. Enter"Y"Or"Yes"Press enter.
Wait until the installation is complete.
After installation, you must configure environment variables.
Enter:VI
/Etc/profile
InProfileAdd the following content to this file:
Export java_home =/usr/Java/Jdk1.6.0 _ 14
Export java_bin =/usr/Java/Jdk1.6.0 _ 14/Bin
Export Path = $ path: $ java_home/bin
Export classpath =.: $ java_home/lib/dt. jar: $ java_home/lib/tools. Jar
Export java_home java_bin path classpath
Finally, for convenience at ordinary times/Usr/bin/Create two shortcuts
CD/usr/bin
Ln-S-F/usr/Java/JDK1.6.0 _ 14/JRE/bin/Java
Ln-S-F/usr/Java/JDK1.6.0 _ 14/bin/javac
After everything is done, enterJava-versionTest
Screen output:
Java version "1.6.0 _ 14-ea"
Java (TM) se
Runtime Environment (build 1.6.0 _ 14-ea-b03)
Java hotspot (TM)
Client VM (build 14.0-b12, mixed mode, sharing)
3,InstallTomcat6
ActuallyTomcatYou only need to run the following command to decompress the package.
# Tar xvzf apache-tomcat-6.0.18.tar.gz
After this part is executedApache-tomcat-6.0.18.tar.gzA folder is generated under the directory of this file. You can move it to another directory.
RunRegionDirectory/Bin/startup. ShStartTomcatService.
4,Test the installation result in a browser
After installationJDKAndTomcatEnterIPAnd port number (default port8080) Test, you can seeTomcatThe installation page is complete.
Note: If you want to modify the Tomcat port (for example, change port 8080 to port 80), use VI to open/CONF/server. XML in the Tomcat directory.
Modify
<Connector Port ="8080"Protocol =" HTTP/1.1 "connectiontimeout =" 20000 "redirectport =" 8443 "/>
Is
<Connector Port ="80"Protocol =" HTTP/1.1 "connectiontimeout =" 20000 "redirectport =" 8443 "/>
After modifying this configuration file, restart the server.
5,Finished