EC2: 如何在安全组中添加端口8080?

我想将端口 8080添加到 EC2安全组以访问 tomcat。但是每当我从下拉菜单中选择 HTTP 时,我都会得到默认的 80端口,而且也不能更改它。

那么,如何添加 8080以便能够公开访问 Tomcat 呢?

90163 次浏览

You have to choose "Custom TCP rule" in the dropdown.

Then you will be able to change the port to 8080.

enter image description here

You have to able the port in two different sections: (1) Windows firewall, as it was explained before. (2) Directly in Amazon Web Service console, exactly in security groups/inbound.

after adding the rule in security group, you should also turn on the Linux os port in order to access your webservice command for doing that

sudo ufw allow 8080/tcp

Some Extra Information: Actually this is not a good why to deploy the service. we should rather use a reverse proxy server to handle all kind of requests (like nginx), and those request should be routed to specific web service in this why whole traffic will be routed to 80 port(HTTP) or 443 (HTTPS) if you want to configure SSL. Thus a lot of things become easier by using it. Follow this to know how to use Nginx.