查看系统版本
[root@localhost src]# uname -a Linux localhost.localdomain 2.6.32-504.el6.x86_64
[root@localhost src]# ls -l total 179352 -rw-r--r-- 1 root root 8858187 Aug 31 23:40 apache-tomcat-7.0.64.tar.gz -rw-r--r-- 1 root root 153512879 Aug 5 14:40 jdk-7u79-linux-x64.tar.gz
安装jdk
tar zxvf jdk-7u79-linux-x64.tar.gz mv jdk1.7.0_79/ /usr/local/java
配置环境变量
vim /etc/profile.d/java.sh JAVA_HOME=/usr/local/java CLASSPATH=/usr/local/java/lib/dt.jar:/usr/local/java/lib/tools.jar PATH=/usr/local/java/bin:$PATH export PATH JAVA_HOME CLASSPATH
验证是否成功 source /etc/profile.d/java.sh [root@localhost src]# java -version java version "1.7.0_79" Java(TM) SE Runtime Environment (build 1.7.0_79-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
安装tomcat7
tar zxvf apache-tomcat-7.0.64.tar.gz mv apache-tomcat-7.0.64 /usr/local/tomcat7
配置tomcat环境变量
vim /etc/profile.d/tomcat.sh export PATH=$PATH:/usr/local/tomcat7/bin
启动tomcat
startup.sh
查看端口
netstat -tnlp
浏览器查看