我在Tomcat遇到问题:
在干净的安装,连接到[IP地址]:8080超时。
我看到很多类似的问题,基本上都尝试过,没有成功。 但是,这里是我所有有关类似问题的数据:
版本:Tomcat 7
Linux:Ubuntu
iptables -L输出:
Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination
netstat -nat | grep:8080输出
tcp6 0 0 :::8080 :::* LISTEN
telnet localhost 8080输出
Trying 127.0.0.1... Connected to localhost. Escape character is '^]'.
telnet [ip-address] 8080输出
Trying [ip-address]... (this seems to go on forever)
我觉得我必须错过一些非常明显的东西,因为除了安装java和tomcat之外,我没有添加任何WAR /对服务器进行任何修改。 下面是我的Server.xml(注释删除):
<?xml version='1.0' encoding='utf-8'?> <Server port="8005" shutdown="SHUTDOWN"> <Listener className="org.apache.catalina.core.JasperListener" /> <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> <GlobalNamingResources> <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" /> </GlobalNamingResources> <Service name="Catalina"> <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" URIEncoding="UTF-8" redirectPort="8443" address="0.0.0.0" /> <Engine name="Catalina" defaultHost="localhost"> <Realm className="org.apache.catalina.realm.LockOutRealm"> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> </Realm> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t "%r" %s %b" /> </Host> </Engine> </Service> </Server>
由于您在Amazon EC2上,并且它在本地工作而不是IP地址,请检查您的主机的networkingACL(即安全组)。 该向导指导您设置一个非常严格的策略,如果您尝试执行诸如向世界开放HTTP之类的操作,则只会打开入站端口80。