【安装JDK】
[[email protected] ~]# ls /software/
apache-tomcat-7.0.61-windows-x64.zip jdk-7u79-linux-x64.rpm
[[email protected] ~]#cd /software
[[email protected] software]# rpm -ivh jdk-7u79-linux-x64.rpm
[[email protected] software]# cd /usr/java/
[[email protected] java]# mv jdk1.7.0_79/ /usr/local/jdk
[[email protected] java]#tail -5 /etc/bashrc #加入下面这五行环境变量
export JRE_HOME=/usr/local/jdk
export JAVA_BIN=/usr/local/jdk/bin
export PATH=$JRE_HOME/bin:$PATH
export CLASSPATH=.:$JRE_HOME/lib/dt.jar:$JRE_HOME/lib/tools.jar
export JRE_HOME JAVA_BIN PATH CLASSPATH
[[email protected] java]# source /etc/bashrc
[[email protected] java]# echo $JRE_HOME
[[email protected] java]# java -version #查看版本
【安装Tomcat】
[[email protected] java]# cd /software
[[email protected] software]# unzip apache-tomcat-7.0.61-windows-x64.zip
[[email protected] software]# mv apache-tomcat-7.0.61 /usr/local/tomcat
[[email protected] software]# cd /usr/local/tomcat/
[[email protected] software]#chmod +x bin/*.sh;cd bin
[[email protected] bin]# ./startup.sh
[[email protected] bin]# netstat -tulnp | grep :8080
【本机测试访问】
[[email protected] bin]# elinks --dump http://localhost:8080