查看系统版本
[root@localhost src]# uname -aLinux localhost.localdomain 2.6.32-504.el6.x86_64
[root@localhost src]# ls -ltotal 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.shJAVA_HOME=/usr/local/javaCLASSPATH=/usr/local/java/lib/dt.jar:/usr/local/java/lib/tools.jarPATH=/usr/local/java/bin:$PATHexport PATH JAVA_HOME CLASSPATH
验证是否成功source /etc/profile.d/java.sh[root@localhost src]# java -versionjava 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.gzmv apache-tomcat-7.0.64 /usr/local/tomcat7
配置tomcat环境变量
vim /etc/profile.d/tomcat.shexport PATH=$PATH:/usr/local/tomcat7/bin
启动tomcat
startup.sh
查看端口
netstat -tnlp
浏览器查看