AWS Linux (Ubuntu) hosted application is not accessible from public ip

流过昼夜 提交于 2019-12-25 01:38:10

问题


I hosted a nodejs(express hello world app) application on AWS Linux(Ubuntu 16.04) on free-tier. When i do wget http://localhost:8080 it runs successfully and saved the output in index.html file. But when i do the same thing with the public ip (wget http://35.154.40.189:8080) of my instance, it says

Connecting to 35.154.40.189:8080... failed: No route to host.

I also used the steps given in http://www.lauradhamilton.com/how-to-set-up-a-nodejs-web-server-on-amazon-ec2 to forward all ipv4 traffic to my application but it doesn't work.

I also enabled port 8080 from aws console.

netstat -atn says 

netstate -ntlp says

I tried everything which i get on internet but unable to resolve the issue. Now i'm too much frustrated. Any help would be highly appreciable.


回答1:


  • MAke Your Instance in AWS first
  • Enable inbound rule as u mention in picutre

  • Enable user group after ssh connection with AWS ubuntu instance

  • once instance start running then Install node properly
  • sudu apt-get update
  • sudo apt-get install libssl-dev g++ make
  • download source code of node from web node.tar.gz wih command wget link https://nodejs.org/dist/v6.9.1/node-v6.9.1.tar.gz
  • tar -xvf node -v0.10.32.tar.gz
  • now goto node after unzip .gz
  • ./configure && make && sudo make && sudo make install

boom your node server is ready on new AWS instances

or watch this https://www.youtube.com/watch?v=WxhFq64FQzA&t=1693s



来源:https://stackoverflow.com/questions/40926433/aws-linux-ubuntu-hosted-application-is-not-accessible-from-public-ip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!