安装jdk7
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
[root@unique local]
[root@unique usr]
[root@unique usr]
[root@unique usr]
[root@unique usr]
向文件里面追加以下内容:
JAVA_HOME=/usr/java/jdk1.7.0_60
JRE_HOME=/usr/java/jdk1.7.0_60/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export JAVA_HOME JRE_HOME PATH CLASSPATH
#刷新配置文件
[root@unique usr]# source /etc/profile
#打印环境变量查看
[root@unique usr]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/java/jdk1.7.0_60/bin:/usr/java/jdk1.7.0_60/jre/bin
#查看java版本
[root@unique usr]# java -version
java version "1.7.0_60"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)
安装tomcat
[root@unique local]
[root@unique local]
[root@unique local]
[root@unique local]
JAVA_HOME=/usr/java/jdk1.7.0_60
JRE_HOME=/usr/java/jdk1.7.0_60/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
CATALINA_HOME=/usr/local/tomcat7
export JAVA_HOME JRE_HOME PATH CLASSPATH CATALINA_HOME
[root@unique local]
[root@unique local]
[root@unique local]
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
[root@admin local]
[root@admin local]
[root@unique local]
[root@unique bin]
测试tomcat
增加tomcat服务脚本
[root@unique nginx]
#!/bin/sh
export JAVA_HOME=/usr/local/java/jdk1.7.0_60
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JDK_PATH/lib/dt.jar:$JDK_PATH/lib/tools.jar
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
export TOMCAT_HOME="/usr/local/tomcat7"
export CATALINA_HOME="/usr/local/tomcat7"
export JAVA_OPTS="-server -Xms512m -Xmx512m"
exec $CATALINA_HOME/bin/catalina.sh $*
[root@unique nginx]
[root@unique nginx]
[root@unique nginx]
[root@unique nginx]