gpt4 book ai didi

tomcat - tom cat 启动但 html 不加载

转载 作者:行者123 更新时间:2023-11-28 22:31:26 25 4
gpt4 key购买 nike

我有一个 EC2 盒子,我已经在上面启动了 tomcat 服务器。我可以在服务器已启动的日志中看到。我还可以远程登录到本地主机,并可以获取如下所示的 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>

最佳答案

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

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

关于tomcat - tom cat 启动但 html 不加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16345527/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com