ubuntu如何开启8080端口监听远程电脑的HTTP请求?

How to open 8080 port to listen HTTP request from remote computer in ubuntu?

我有 运行 以下命令:-

  nmap localhost

并得到以下结果:-

Starting Nmap 6.40 ( http://nmap.org ) at 2015-08-28 09:52 UTC Nmap scan report for localhost (127.0.0.1) Host is up (0.00031s latency). Not shown: 994 closed ports PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 3306/tcp open mysql 8000/tcp open http-alt 8009/tcp open ajp13 8080/tcp open http-proxy

并且当我 运行 使用此(远程)计算机的 IP 的相同命令时,即:-

nmap 54.149.233.194

我得到了以下结果:-

Starting Nmap 6.40 ( http://nmap.org ) at 2015-08-28 09:52 UTC Nmap scan report for ec2-54-149-233-194.us-west-2.compute.amazonaws.com (54.149.233.194) Host is up (0.00072s latency). Not shown: 996 filtered ports PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 8000/tcp open http-alt 9000/tcp closed cslistener

所以请告诉我如何使用 http://IP_ADDRESS:8080/ 打开 8080 端口以侦听来自远程计算机的 http 请求
tomcat 实例正在这台计算机的 8080 端口上 运行ning,但我无法远程访问它。

在你的tomcatserver.xml

<Connector port="8080" protocol="HTTP/1.1" 
       connectionTimeout="20000" 
       URIEncoding="UTF-8"
       address="0.0.0.0"
       redirectPort="8443" />

这将使 tomcat 绑定到主机中的所有接口。

如果您的 Apache 在 port 8080 上已经 运行,那么很可能您的 aws 控制台没有打开该端口。 我访问了 54.149.233.194 并且可以找到 apache 默认页面。

下面是link如何打开click me

无耻的复制答案到这里

In EC2 console, look for the column "Security Group" of your instance. Then go to option "Security Groups" above "NETWORK & SECURITY" in navigation menu on left. It will show up the security group you saw before. Click on it, it will show a split screen where the one is above has 2 tabs: Details and Inbound. Go to Inbound, in port range input 8181 and source the ip you want to allow incoming access to instance. Don't forget to apply changes.

希望对您有所帮助。