So you want to run the following:
This is a quick blog on installing node.js, RabbitMQ and then rabbit.js on Ubuntu 11.04. I may have forgotten a few steps, so please feel free to add comments.
1) Download Ubuntu 11.04 Natty Narwal iso (I am using 32bit)
2) I am running a MBP so I installed the iso on Fusion 3.1.3. I took the defaults and created a 20gig drive and standard 512MB RAM for memory.
3) Installing Node.js from source
- Make sure that you do the following:
- sudo apt-get install ubuntu-dev-tools
- sudo apt-get install python2.7
- Python tools to interact with RabbitMQ (Perhaps for later not necessary for node)
- sudo apt-get install python-pip git-core
- sudo pip install pika==0.9.5
- Here is the interesting part and I tried several different methods, but this seemed to work for me.
- Click on it and then install it. We are then going to "uninstall" once this has been completed. I don't know why...but it must bring the necessary dependencies. .
- Node.js will work if you install this way, BUT, Node Package Manager (npm) will not...and trust me you want the Package Manager
- Now following the instructions as written for the installation of Node.js:
- Open a terminal and make sure you are at /home/[username] and follow the instructions to get node.js installed
- Once you have node installed from the source...you should have a directory as follows:
- node executable is now in your .profile and sourced, so you should be able to execute "node" in any terminal window.
- Ok, now we need to get npm installed
- Now let's get to the heart of this effort and install rabbit.js. In terminal go to /home/[username]/local/node/lib/node_modules
- Execute in the terminal: npm install amqp -g
- Execute in the terminal: npm install rabbit.js
- Execute in the terminal: npm install email@example.com
- Execute in the terminal: npm ls (this command lists all of the installed node plugins)
- If all went well you should then have a directory like this:
│ ├── firstname.lastname@example.org
│ ├── email@example.com
│ ├── firstname.lastname@example.org
│ ├─┬ email@example.com
│ │ └── firstname.lastname@example.org
│ ├── email@example.com
│ ├── firstname.lastname@example.org
│ ├── email@example.com
│ ├── firstname.lastname@example.org
│ ├── email@example.com
│ ├── firstname.lastname@example.org
│ ├── email@example.com
│ └── firstname.lastname@example.org
- Now we need to get RabbitMQ installed. This is pretty straightforward:
- In gnome, navigate to the Downloads folder and right mouse button the deb file
- Open the file with "Open With Ubuntu Software Center"
- This will state that an older version of RabbitMQ is installed. Go ahead and install this version
- Nice management addins to install are the RabbitMQ Management plugins.
- Download these addins from here:
- To install the plugins, you need to stop the server. In the terminal:
- Copy all of the .ez files in /home/[username]/Downloads to the RabbitMQ plugin directory
- Restart RabbitMQ with the following:
- Execute in the terminal: sudo rabbitmq-server
- In firefox, navigate to http://localhost:55672 and login as guest / guest
- Now, let's get node and rabbit chatting with each other. Navigate to /home/[username]/local/node/lib/node_modules/rabbit.js in the terminal.
- You should see in the terminal...something like:
20 Sep 13:29:49 - Your node instance does not have root privileges. This means that the flash XML policy file will be served inline instead of on port 843. This will slow down initial connections slightly.
20 Sep 13:29:49 - socket.io ready - accepting connections
- Finally...whew...if all of this is working...then you will be able to login into the node server at http://localhost:8080 and follow the instructions from there...if not...well it works on my vm. ;-)