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?
Asked
Active
Viewed 609 times
2 Answers
3
The simple way to do that is Port Forwarding by using below command:
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080
After logging into the AWS using putty by having private key & with username "bitnami". Type the above command & enter.
Then, you will automatically redirected to your application.
Note : I am assuming, you have already configure port 8080 to security group on AWS

Abhay
- 6,410
- 4
- 26
- 34
1
You'll have to open port 80 on the server's firewall, and either run your server on port 80 or forward port 80 to port 8080. You'll need to lookup the instructions for doing that based on what version of Linux you are running, but it is probably going to be an iptables
command.
You'll also need to open port 80 on the EC2 server's security group.

Mark B
- 183,023
- 24
- 297
- 295
-
Port 80 already had a rule in the EC2 server security group allowing all IPs. I've been trying to run my app on port 80, but when I do this, and go to the public dns of my EC2 instance I see the Bitnami MEAN page instead of my app, and when I look at my console, my app has crashed. I can run my app on port 80 fine locally, and the app will appear when I type localhost in the browser. I'm running windows but my EC2 instance is on ubuntu. What do you mean by open port 80 on the firewall? I'm trying to host the app completely on my EC2 instance from a git repo. – Forest Hughes Apr 04 '16 at 21:35
-
If you are getting a response when you hit your server on port 80 then something is already running on port 80 on that server. You would have to stop that process to run your NodeJS app on port 80. Also, a git repo is for hosting the source code, not serving the app, so I'm not sure why you are mentioning it. – Mark B Apr 04 '16 at 22:27