ubuntu 12.04を実行しているAmazon ec2インスタンスを起動しました
次に、指示に従ってここから node.js をインストールしましたhttp://howtonode.org/how-to-install-nodejs
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
git clone git://github.com/ry/node.git
cd node
./configure
make
sudo make install
次に、サンプルコードを使用して作成しましたhello.js
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello Node.js\n');
}).listen(8124, "127.0.0.1");
console.log('Server running at http://127.0.0.1:8124/');
それから走ったhello.js
/var/www$ node hello.js
Server running at http://127.0.0.1:8124/
ただし、URLからこれにアクセスしようとするとhttp://ec2-***.compute-1.amazonaws.com:8124/
、ブラウザからエラーページが表示されます。
ブラウザに表示させる方法について何かアドバイスはありますか?
編集 上記のコード行を変更した後も、この問題が発生しています
}).listen(8124, "127.0.0.1");
これに
}).listen(8124);