Installing Cloud9 on your own server

Cloud9 is a IDE in the browser. These are my installations notes. They are raw, but might help somebody.

What worked for me:

Important: Don't install it in your home directory. I had issues with the following error in the console. The IDE was also unusable. There was also a session id not found error.

rror: File already exists.
    at module.exports.from (/root/cloud9/node_modules/vfs-architect/node_modules/vfs-local/localfs.js:678:35)
    at Object.fs.exists [as oncomplete] (fs.js:91:19)
[CLIENT ERROR] { agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Firefox/24.0',
  type: 'C9 SERVER EXCEPTION',
  message:
   { type: 'error',
     sid: -1,
     code: 500,
     message: 'File already exists.' } }
Error: File already exists.
    at module.exports.from (/root/cloud9/node_modules/vfs-architect/node_modules/vfs-local/localfs.js:678:35)
    at Object.fs.exists [as oncomplete] (fs.js:91:19)

It seems that it can't find/use all the .session files in your workspace folder, because of permissions.

I used this approach to install it in the end. It might also have solved my problems above. (Source)

nvm install v0.10.15

cd /usr/local
git clone git://github.com/ajaxorg/cloud9.git
git clone https://github.com/creationix/nvm.git ~/.nvm
source ~/.nvm/nvm.sh
nvm install v0.8.25
cd cloud9
npm install packager
nvm deactivate
sed -i -e 's/~//g' package.json
npm install
echo "process.on('uncaughtException', function(err) {console.log('Uncaught exception'); return console.log(err);});" >> server.js

 

Tip: Add nvm to your .bashrc or .zshrc
For Bash users: echo '. ~/nvm/nvm.sh' >> ~/.bashrc && . ~/.bashrc
For zsh users: echo '. ~/nvm/nvm.sh' >> ~/.zshhrc && . ~/.bashrc

Additonal Tip:
If you need to run C9 as a different user, add following at the end of server.js:

process.setgid('www-data');
process.setuid('www-data');

 

Use Forever to run Cloud9 in the background

 

Written by Andreas Wildi on Wednesday November 6, 2013
Permalink -

« Mod_SSL Module not compiled when compiling apache. Install Mod_SSL without recompiling Apache! - Toolset / Software »