1. Preparatory work
Download the appropriate version of the Linux version of JDKandTomcat installation files.
Example:jdk-6u21-linux-i586-rpm.bin ( installation version )
JDK-6U21-LINUX-I586.RPM ( installation version )
Jdk-7u79-linux-x64.tar.gz (uncompressed version )
Recommended collocation:JDK1.7 + Tomcat7.0 more stable
2. InstallationJDK
First, upload the installation package via FTP to the specified file directory, in the following example:/usr/local/java
New Folder command:
[email protected] usr] #mkdir/usr/local/java
To increase the Execute permissions command:
[email protected] usr] #chmod a+x jdk-6u21-linux-i586-rpm.bin
installation command:
[email protected] usr] #rpm-ivh jdk-6u21-linux-i586.rpm
Description
Install package execution with ". RPM":rpm-ivh jdk-6u21-linux-i586.rpm command
installation package ending with ". Bin" execution:./jdk-6u21-linux-i586.rpm Command
Theinstallation package that endswith ". tar.gz" executes:tar –xvf jdk-7u79-linux-x64.tar.gz command /c13>
3. Configure Environment variables
Add the java_home CLASSPATH PATH environment variable in /etc/profile .
command: [[email protected] jdk1.6.0_21]# Vi/etc/profile
Press 'o' to enter edit mode
In the end, add:
Java_home=/usr/local/jdk1.6.0_45 (here is the corresponding JDK installation path)
Classpath=.: $JAVA _home/lib/tools.jar
Path= $PATH: $JAVA _home/bin
Export Java_home CLASSPATH PATH
Press 'Esc' -- Enter ':wq' to save and exit
4. JDKTest
To detect if the JDK was successfully installed:
command: [[email protected] ~]# java –version
If you see the JVM version and related information, the installation is successful.
If error:
If ' Java ' isn't a typo you can run the following command to lookup the package that contains the Binary:command-not-foun D Java-bash:java:command not found
The environment variable is configured incorrectly!
5. InstallationTomcat
[[Email protected] ~]# tar –xvf Apache-tomcat-6.0.29.tar // unzip
[[email protected] tomcat]# mkdir/usr/local/tomcat// Create a new Tomcat directory under usr/local
[[email protected] ~]# CP –R apache-tomcat-6.0.29/usr/local/tomcat // Copy to Tomcat under
6. Set the Tomcat encoding (can be ignored)
Configure the Tomcat Server encoding to UTF-8:
Open the conf/server.xml file in the Tomcat installation directory (approximately at the 8080 ) to of the Port <connector></connector> the label is set to uriencoding= " UTF-8 ".
7. StartTomcat
[Email protected] ~]#/usr/local/tomcat/apache-tomcat-6.0.29/bin/startup.sh
Using a browser to access http://localhost:8080, a tomcat default page appears stating that the installation was successful
8. Project Deployment
Make the web project into a war package and upload it to the Linux operating system tomcat installation directory WebApps !
The installation and deployment process of Web projects in Linux environment