Order: Before installing the Tomcat server, there is a lot of preparation work, such as JDK installation.
One, JDK 7 download and installation
1. Download the JDK file
X86 represents the i386,i486 series, which is a package used for 32-bit operating systems.
X64 is a package that is used by 64-bit operating systems. What package to install depends on the system.
(1) Before downloading the JDK, the first thing to know is whether your Linux system is 64-bit or 32-bit.
Do not download a version that does not correspond.
If your system is 64-bit, download the corresponding JDK package for Linux x64.
If your system is 32-bit, download the corresponding JDK package for Linux x86.
How to see if your system is 64-bit or 32-bit?
Uname--m #如果得到的结果是x86_64则说明你的系统是64位的.
#如果得到的结果是i686, it means that your system is 32-bit.
Some other useful commands:
sudo uname--s display kernel name Ssudo uname--r Show kernel version sudo uname--n Show network hostname sudo uname--p display CPU
Low-level mistakes:
From the Internet to find a lot of tutorials say let go to http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html this link to download. I use wget http://download.oracle.com/otn-pub/java/jdk/8u65-b17/. Jdk-8u65-linux-i586.tar.gz This command to execute, but the size of the download is obviously not correct, the site is seen 174.84 MB, but I downloaded to the local really only 5307kb. See. I do not know why we can not download the package with the wget command. There's only one way to change it.
Because I use the SSH,SSH with the FTP tool, I did not know before. This is easy. I downloaded the file locally and then uploaded it to Ubuntu using the tool to put the file on the server.
How to use SSH tools: Window->new file Transfer, then a classic FTP upload interface, you can download the local 8u65-b17/jdk-8u65-linux-x64.tar.gz files uploaded to the server.
2. Create a folder
Mkdir/usr/java #用来安装jdk的目录
3. Extract the files to the installation directory
Tar zxvf/root/jdk-8u65-linux-x64.tar.gz-c/usr/java
I put my files in the/root directory.
4. Renaming
Enter Cd/usr/java
MV Jdk1.8.0_65 jdk1.8
5. write config file
Vim ~/.BASHRC
Add a few lines at the bottom, note that the red part should be modified according to what you downloaded.
Export java_home=/usr/java/jdk1.8
Export JRE_HOME=${JAVA_HOME}/JRE Export Classpath=.:${java_home}/lib:${jre_home}/lib
Export Path=${java_home}/bin: $PATH
Save Exit, enter:
SOURCE ~/.BASHRC # makes it effective immediately
6. Command Line Input
Update-alternatives--install/usr/bin/java Java/usr/java/jdk1.8/bin/java 300
Update-alternatives--install/usr/bin/javac Javac/usr/java/jdk1.8/bin/javac 300
Update-alternatives--install/usr/bin/jar Jar/usr/java/jdk1.8/bin/jar 300
Update-alternatives--config Java
Select the JDK you just installed as your default JDK
The JDK 1.8 installation was successful.
Ii. Tomcat Download and install 1, download tomcat
Download apache-tomcat-8.0.28.tar.gz on htt://www.tomcat.apache.org official website
2. Unzip Tomcat
Into the/root directory, my compressed package is placed in this directory.
TAR-ZXVF apache-tomcat-8.0.28.tar.gz #执行解压
3. Create a Directory
mkdir/usr/local/tomcat8.0 #tomcat目录
Cp-r/root/apache-tomcat-8.0.28//usr/local/tomcat8.0/#将文件移动到tomcat8.0 directory.
4. Start Tomcat
/usr/local/tomcat8.0/bin/startup.sh
If shown:
Using catalina_base:/usr/local/tomcat8.0
Using Catalina_home:/usr/local/tomcat8.0
Using Catalina_tmpdir:/usr/local/tomcat8.0/temp
Using Jre_home:/usr/java/jdk1.8/jre
Using CLASSPATH:/usr/local/tomcat8.0/bin/bootstrap.jar:/usr/local/tomcat8.0/bin/tomcat-juli.jar
Tomcat started.
The installation is successful and you can see Tom Cat when the browser accesses http://IP:8080.
Ubuntu 14.04.2 x64 Install Tomcat server fool Tutorial