打开在Amazon EC2上一个HTTP端口端口、Amazon、HTTP

2023-09-11 08:18:05 作者:是作业还是作孽

我在端口8080上运行的Tomcat 7的实例,并希望在不同的端口上运行詹金斯。另一种方法是改变詹金斯网址

I have a Tomcat 7 instance running on port 8080, and would like to run Jenkins on a different port. Another alternative would be to change the Jenkins URL.

如何添加一个条目,以允许端口的列表?

我已经试过运行:须藤/ sbin目录/ iptables的-A INPUT -p tcp的--dport 8181 -j ACCEPT ​​,但在AWS控制台只显示这些端口

I have tried running: sudo /sbin/iptables -A INPUT -p tcp --dport 8181 -j ACCEPT, but in the AWS console it shows only these ports:

0 - 65535       0.0.0.0/0
22 (SSH)        0.0.0.0/0
80 (HTTP)       0.0.0.0/0
443 (HTTPS)     0.0.0.0/0
3306 (MYSQL)    0.0.0.0/0
8080 (HTTP*)    0.0.0.0/0

是否可以通过AWS控制台添加一个HTTP端口(8181)?

Is it possible to add a HTTP port (8181) via the AWS console?

更新:

我已经尝试添加自定义的TCP端口,但它没有得到HTTP协议,当我选择HTTP,我不能指定端口!

I already tried adding a custom TCP port, but then it doesn't get the HTTP protocol, and when I select HTTP, I can't specify the port!

推荐答案

在EC2控制台中,查找您的实例的栏目安全组。然后去选择安全组上面网络与安全性,在导航菜单中离开了。它会显示你之前看到的安全组。点击它,它会显示一个画面分割,其中一个是上面有2个选项卡:详细信息及入境。转到入站,在端口范围输入8181和源要允许传入访问实例中的IP。 不要忘记申请变更。

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.