汤姆猫开始但html没有加载

时间:2013-05-02 18:48:51

标签: tomcat amazon-ec2

我有一个EC2盒子,我已经启动了同样的tomcat服务器。我可以在日志中看到服务器已启动。我也可以telnet到localhost并可以获得如下所示的html。但是当我尝试在浏览器中通过“http:ec2- * :9000 /然后它没有响应。我使用默认设置创建我的实例。是因为某种防火墙?

ubuntu@ip-10-250-38-240:~/apprickwebapp$ telnet localhost 9000
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.


GET http://localhost/
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Apache Tomcat</title>
</head>

<body>
<h1>It works !</h1>

<p>If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Congratulations!</p>

<p>This is the default Tomcat home page. It can be found on the local filesystem at     <code>/var/lib/tomcat7/webapps/ROOT/index.html</code></p>

<p>Tomcat7 veterans might be pleased to learn that this system instance of Tomcat is installed with <code>CATALINA_HOME</code> in <code>/usr/share/tomcat7</code> and     <code>CATALINA_BASE</code> in <code>/var/lib/tomcat7</code>, following the rules from     <code>/usr/share/doc/tomcat7-common/RUNNING.txt.gz</code>.</p>

<p>You might consider installing the following packages, if you haven't already done so:</p>

<p><b>tomcat7-docs</b>: This package installs a web application that allows to browse the Tomcat 7 documentation locally. Once installed, you can access it by clicking <a href="docs/">here</a>.</p>

<p><b>tomcat7-examples</b>: This package installs a web application that allows to access the Tomcat 7 Servlet and JSP examples. Once installed, you can access it by clicking <a href="examples/">here</a>.</p>

<p><b>tomcat7-admin</b>: This package installs two web applications that can help managing this Tomcat instance. Once installed, you can access the <a href="manager/html">manager webapp</a> and the <a href="host-manager/html">host-manager webapp</a>.<p>

<p>NOTE: For security reasons, using the manager webapp is restricted to users with role "manager". The host-manager webapp is restricted to users with role "admin". Users are defined in <code>/etc/tomcat7/tomcat-users.xml</code>.</p>

</body>
</html>

1 个答案:

答案 0 :(得分:0)

您需要在分配给该实例的安全组中打开端口9000。在AWS EC2控制台上,转到左侧的安全组,选择应用于该实例的组,在底部选择“入站”选项卡,端口范围“9000”,源“0.0.0.0/0”。

然后“添加规则”和“应用规则更改”。这将允许您在短时间内入站9000端口。