Wikistream is great applications and publish on HackerNews. Today, I want to install and run Wikistream on My Ubuntu 11.10 Oneric. I have NodeJS 0.6.5 installed and run properly on my Ubuntu. If you don’t have, then you should install it. In case you need how to install NodeJS on Ubuntu 11.10, open your console and follow this steps :
1. Installing NodeJS
1 2 3 4 5 6 7 8 9 10 11 12 13 | cd ~/ sudo apt-get install git-core curl build-essential openssl libssl-dev pkg-config mkdir ~/local wget -c http://nodejs.org/dist/v0.6.6/node-v0.6.6.tar.gz tar -xvvf node-v0.6.5.tar.gz cd node-v0.6.5 export JOBS=2 ./configure –prefix=$HOME/local/node make make install echo ‘export PATH=$HOME/local/node/bin:$PATH’ >> ~/.profile echo ‘export NODE_PATH=$HOME/local/node:$HOME/local/node/lib/node_modules’ >> ~/.profile source ~/.profile |
Now, you have NodeJS installed in your Ubuntu. You should set “/etc/environment” and load nodeJS path that can be executed by another users. For example :
1 2 3 | NODE="/home/ubuntu/local/node" PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:$NODE/bin:$NODE/lib/node_modules" #PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" |
And restart your Ubuntu. You must do this 🙂
2. Clone Wikistream
Then we can go start with forking Wikistream from github by :
1 | git clone https://github.com/edsu/wikistream.git |
We need to copy example configuration inside wikistream :
1 2 | cd wikistream cp config.json.example config.json |
Attention :
Edit ircNick “wikistream” into unique name or you can’t updates! For instance I use “cisightwikistream”.
3. Install dependencies
You need to install several packages to make Wikistream running. I use global node_modules here, so i delete node_modules inside wikistream and installing new packages in global node_modules.
1 | rm -rf node_modules |
1. Installing redis-server
1 | sudo apt-get install redis-server |
2. Installing NPM
wikistream need redis, socket.io, irc-js, jade and express.
1 2 3 4 5 | npm install -g express@2.5.1 npm install -g socket.io npm install -g irc-js npm install -g redis npm install -g jade |
Because we install in global mode, every changes should do in :
1 | ~/local/node/lib/node_modules/ |
4. Fixing & Configure Wikistream
Change “wikistream.conf” as your system. For example,my wikistream location in “/home/ubuntu/htdocs/js/nodejs/wikistream” this is mine :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | description "wikistream node.js app" author "Ed Summers <ehs@pobox.com>" start on started mountall stop on shutdown respawn respawn limit 99 5 script export HOME=/var/tmp/ sudo -i -u ubuntu node /home/ubuntu/htdocs/js/nodejs/wikistream/app.js >> /var/tmp/wikistream.log 2>&1 end script post-start script echo "wikistream started"; end script |
Also, edit “wikistream-irc.conf” :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | description "wikistream node.js app" author "Ed Summers <ehs@pobox.com>" start on started mountall stop on shutdown respawn respawn limit 99 5 script export HOME=/var/tmp/ sudo -i -u ubuntu node /home/ubuntu/htdocs/js/nodejs/wikistream/app.js >> /var/tmp/wikistream.log 2>&1 end script post-start script echo "wikistream started"; end script |
Then you should copy links both files “wikistream.conf” and “wikistream-irc.conf” into “/etc/init”.
5. Fixing irc-js problem
Updated!
Irc-js updated into new version and solve this bug.
In case you using old version, do this :
Fixing problem with irc-js which require.paths is removed in Node 0.6.5 by editing
1 2 | ~/local/node/lib/node_modules/irc-js/lib/irc.js ~/local/node/lib/node_modules/irc-js/lib/compiler.js |
Follow this to fix irc-js issue :
https://github.com/gf3/IRC-js/pull/49/files
6. Run
Basically, we run wikistream-irc to get updates from IRC then show it on localhost:3000 by wikistream apps.
1 2 | sudo start wikistream-irc sudo start wikistream |
Now open your http://localhost:3000 🙂
To stop service :
1 2 | sudo stop wikistream-irc sudo stop wikistream |