Amazon EC2 instance of Bitnami MEAN - how to host app on port 80?

时间:2016-04-04 18:37:51

标签: amazon-web-services amazon-ec2 hosting mean-stack bitnami

I'm running Bitnami MEAN on an EC2 instance. I can host my app just fine on port 3000 or 8080. Currently if I don't specify a port I'm taken to the Bitnami MEAN homepage. I'd like to be able to access my app by directly from my EC2 public dns without specifying a port in the url. How can I accomplish this?

2 个答案:

答案 0 :(得分:2)

使用以下命令执行此操作的简单方法是Port Forwarding:

   sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080

使用putty登录AWS后,拥有私钥&用户名" bitnami"。输入上面的命令&输入

然后,您将自动重定向到您的应用程序。

注意:我假设您已将端口8080配置为AWS上的安全组

答案 1 :(得分:1)

您必须在服务器的防火墙上打开端口80,并在端口80上运行服务器或将端口80转发到端口8080.您需要根据Linux的版本查找执行此操作的说明正在运行,但它可能是iptables命令。

您还需要在EC2服务器的安全组上打开端口80。