求助,linux下安装完jdk6和tomcat6后外网无法访问
小弟新手。。刚开始学linux。。
我的一个java项目是在window下写的,客户都测试完了,客户要放到linux服务器上。。。
服务器装的是没有图形界面的那种linux
先安装jdk-6u20-linux-i586-rpm.BIN 和 apache-tomcat-6.0.33.tar.gz,安装完外网怎么也访问不了。本地没有图形界面,我只能看看端口。。
我用root登录linux,打version.sh命令,出现以下信息
Using CATALINA_BASE: /usr/local/tomcat6
Using CATALINA_HOME: /usr/local/tomcat6
Using CATALINA_TMPDIR: /usr/local/tomcat6/temp
Using JRE_HOME: /usr/java/jdk1.6.0_20
Using CLASSPATH: /usr/local/tomcat6/bin/bootstrap.jar
Server version: Apache Tomcat/6.0.33
Server built: Aug 16 2011 02:16:34
Server number: 6.0.33.0
OS Name: Linux
OS Version: 2.6.18-194.el5
Architecture: i386
JVM Version: 1.6.0_20-b02
JVM Vendor: Sun Microsystems Inc.
linux是机房给装的,我也不知道是redhat 还是 ub什么的那个。。敲了个命令:uanme -a,出现以下结果:
Linux SK 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:35 EDT 2010 i686 i686 i386 GNU/Linux
我的环境变量是这样配的:
#set java environment
JAVA_HOME=/usr/java/jdk1.6.0_20
CATALINA_HOME=/usr/local/tomcat6
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$CATALINA_HOME/lib
PATH=$JAVA_HOME/bin:$CATALINA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH CATALINA_HOME
我打java -version命令,出现以下信息:
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Server VM (build 16.3-b01, mixed mode)
(看网上的攻略,这样应该就成功了)
启动tomcat命令:startup.sh,出现以下信息:
Using CATALINA_BASE: /usr/local/tomcat6
Using CATALINA_HOME: /usr/local/tomcat6
Using CATALINA_TMPDIR: /usr/local/tomcat6/temp
Using JRE_HOME: /usr/java/jdk1.6.0_20
Using CLASSPATH: /usr/local/tomcat6/bin/bootstrap.jar
(看网上的攻略,这样应该就成功了)
到此还是不能外网访问,于是我查看了防火墙,命令:service iptables status,出现以下信息:
表格:filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0
Chain FORWARD (policy ACCEPT)
num target prot opt source destination
1 RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
Chain RH-Firewall-1-INPUT (2 references)
num target prot opt source