strada
strada

Reputation: 942

Using Cloud9 IDE on an EC2 instance

I've installed Cloud9 IDE on an Amazon EC2 instance and started it with this line:

node bin/cloud9.js

But when I open the IDE address from the browser, there is no response. I've added the port 3000 in the instance security group. I think the problem is I'm trying to load the page from a url such as 'http://ec2-XXX-XXX.compute-1.amazonaws.com:3000/' where the Cloud9 server expects a request url like 'http://127.0.0.1:3000'. I get the page content if I 'wget' 'http://127.0.0.1:3000' from the EC2 instance, so the server is working.

Similar thing happens with node.js 'hello world' example, I get no response if the server 'listens' like this,

http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(1337, "127.0.0.1"); 

because of the ip parameter, and it works if I change the line to .listen(1337);

What should I change in Cloud9 IDE to make it work through 'http://ec2-XXX-XXX.compute-1.amazonaws.com:3000/'?

Upvotes: 0

Views: 2182

Answers (2)

tehbeard
tehbeard

Reputation: 21

The issue is the IP address cloud 9 is bound to by default is the local host address, you should be able to change the value in cloud 9's config to 0.0.0.0 (listen on all addresses)

Upvotes: 2

Farid Nouri Neshat
Farid Nouri Neshat

Reputation: 30410

You can try running this command and connect to it through localhost:3000. Had the same problem with couchdb.

ssh ec2-XXX-XXX.compute-1.amazonaws.com -L 3000:localhost:3000

Upvotes: 3

Related Questions