如何使localhost外部的AWS EC2上的Tomcat可用 [英] How to make Tomcat on AWS EC2 available from outside localhost
问题描述
我正在尝试在AWS Linux服务器上运行Tomcat。我已经安装了Tomcat,并从命令行对其进行了测试以确保其正常工作,但是无法从另一台计算机上访问它。详细信息:
I'm trying to run Tomcat on an AWS Linux server. I've installed Tomcat, and tested it from the command line to make sure it's working, but I can't access it from another machine. The details:
- 实例在安全组中为HTTP打开打开了端口80。
- 我已经通过远程登录到该端口上的localhost并执行GET请求来验证它是否在端口80上运行。
- 我尝试在server.xml中将公用DNS添加为localhost的别名,然后重新启动
但是,如果我尝试通过浏览器(在实际服务器之外)使用公共DNS,我得到无法连接。
Yet if I try to access it via my browser (outside the actual server) using the public DNS I get "could not connect".
有什么想法吗?
谢谢...
推荐答案
好,结果是我还需要编辑并重新启动iptables,如下所述: http://cyberciti.biz/faq/howto-rhel-linux-open-port-using -iptables
OK, the problem turned out to be that I also needed to edit and restart iptables, as explained here: http://cyberciti.biz/faq/howto-rhel-linux-open-port-using-iptables
这篇关于如何使localhost外部的AWS EC2上的Tomcat可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!