1

我有一个 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>
4

1 回答 1

0

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

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

于 2013-05-02T20:16:23.577 回答