CentOS6 に node と cloud9 をインストール

CentOS 6.2にnode.js と cloud9をインストールする。

CentOS 5系は glibcのバージョンが 2.5 と古いため、とりあえず断念。

( nvm経由ならインストールできるらしい。)

 

> wget http://nodejs.tchol.org/repocfg/el/nodejs-stable-release.noarch.rpm
> yum localinstall --nogpgcheck nodejs-stable-release.noarch.rpm
> yum install nodejs-compat-symlinks npm

 

でインストール可能。

(前述のnvm経由でもインストールできるらしい。)

 

次にcould9

 

> npm install cloud9

> cd cloud9

> bin/cloud9.sh

 

実行時に libssl.so.0.9.8

がないエラー。

 

openssl 0.9.8 をrpm からインストール。

 

再度

> bin/cloud9.sh

で起動。

 

ただし、これだとcloud9をプロジェクトとして開いてしまうので

> bin/cloud9.sh -w /hoge/fuga

でワークスペースを指定する

 

http://hogehoge:3000

で使う。

 

上記のURLにアクセスするとプロジェクトが開かれた状態

で始まる。

 

一つファイルを作成し、

例えば、index.js

 

var http = require('http');

var server = http.createServer(
    function (request, response) {
    response.writeHead(200);
    response.end('Hello World!!\n');
}).listen(5000);
console.log('Server running');

と書いて保存し、実行する。

 

そして、

http://hogehoge:5000

にアクセスするとアプリケーションが実行される。