How to access nodejs application installed on AWS EC2 - node.js

I have AWS EC2 with Ubuntu instance. I successfully setup ssh access and I am able to login via ssh console. I installed NodeJS and one simple NodeJS application. Successfully start it by node server.js and when executing curl http://localhost:8080 I can confirm application is up and running. My only issue is that I am not able to access it using provided public IP by AWS.
I can see my public IP from AWS console, and I thought it should be enough to type:
http://aws-public-ip:8080 and it should load the application. It seams I am wrong since I don't obtain access to my app.
Any hints would be appreciated.

Actually I found the answer by myself - I had to edit security group rule and just add rule for corresponding port. By default security group created when you create your instance has only one incoming rule for port 22.

Related

How to display web app running on an AWS Lightsail GitLab CE Linux instance in local browser

I have a Flask web app in my AWS Lightsail GitLab CE Linux instance that I want to display on my local browser (in order to check how the UI looks). I've tried entering the given public IP address with the port numbers specified in the firewall rules, but they all time out. Can anyone tell me how to do this?

how to enable ssl in auto assigned ip of aws ec2 running apache?

I have an amazon ec2 instance running apache server and nodejs express app. It has an auto assigned IP - http://ec2-13-126-38-24.ap-south-1.compute.amazonaws.com
I want to be able to access my node app on "https" instead of just http as it needs to be integrated with a frontend app. Does anyone know how to achieve this? Its kind of stupid that heroku provides ssl enabled subdomains by default but aws does not. What am I missing here?
this is intentional. AWS does not allow adding SSL certificates to their auto assigned domain. It wont work even if you try lets encrypt. Only solution is to have a custom domain instead.

AWS EC2 instance access internal server

In my Amazon EC2 instance I have a Pyramid server as well as a NodeJS server running. The NodeJS server acts as the frontend and I updated my security groups so I can use the public DNS to view the page.
The Pyramid server acts as a backend and the frontend accesses it by http://0.0.0.0:8002/. But when I do an http call to the backend I get a Failed to load resource: net::ERR_ADDRESS_INVALID error message.
Do I need to add a rule to the security groups, or update the iptables, or something?
If both of these services are running on the same server, you shouldn't be sending network traffic out of the server and back, so security groups will not be an issue here.
The question is, why are you using 0.0.0.0 here? I think you probably configured the Pyramid server to listen on 0.0.0.0, which really means "listen on all IP addresses". However you need to be using http://127.0.0.1:8002/ or http://localhost:8002/ in order to connect to the service from another service running on the same server.

Data not displaying from website hosted on AWS

I am facing very weird problem.Please help.
I have developed website using MEAN stack and it is hosted on aws ec2 instance.
If I access that website from my laptop, I can see the data(from mongodb installed on server) in my website.But at the same time when I access the website from some other laptop or say mobile phone(using browser), all the tables are coming blank without any data.
I am not getting, why It is working on my laptop as there is no relation between aws instance and my machine.Except that I use their console/dashboard from my machine.
Thanks.
Please check if you set your laptop host file while developing the website to resolve to the AWS EC2 instance IP where your website is hosted.
Or check the EC2 instance security group if you have opened the HTTP port of the instance just to your IP address.
As above 2 are the only causes that might give the issue mentioned by you.

How to connect Mongodb Admin GUI to Cloud Foundry?

I am looking a way to browse my Cloud Foundry Mongodb services. Look like there are two options:
Tunneling to a Cloud Foundry Service with Caldecott http://docs.cloudfoundry.com/tools/vmc/caldecott.html. I never tried this but I guess it may work.
My question is this: Is it possible to connect directly into Cloud Foundry from Mongodb Admin GUI such as mViewer or Mongovue? But if so, how do I know the username/password in process.env.VCAP_SERVICES['mongodb-1.8'][0]['credentials']?
https://github.com/Imaginea/mViewer
http://www.mongovue.com/2011/08/04/mongovue-connection-to-remote-server-over-ssh/
By using the GUI client you have to get a tunnel to the service. Once you open it in a CLI console the connection info will be generated and displayed, including the host address, usually 127.0.0.1, port number, username and password. You cannot connect using the values from VCAP_SERVICES if you try to do that from outside environment because these will be local values behind the CF router.
You need to create a tunnel using Caldecott.
See http://docs.cloudfoundry.com/tools/vmc/caldecott.html.
When you open the tunnel, it should provide you with either a command line client, or the credentials to use.
In case it does not, create a piece of code that returns a dump of process.env.VCAP_SERVICES when visit a certain url on your server.

Resources