node and iojs with nvm

NVM is a version manager for node.js just like RVM is for ruby. io.js is a fork of node which has more features than current node.js implementation. They may merge in the future.

I use both with NVM. I can switch between node and iojs as well as target specific versions of either one of them. Install NVM by following directions on its site.

I used Homebrew to install nvm.

brew install nvm

After installation is done…

// list all installed node versions on my machine (I have been using nvm...)
nvm ls
->       system
node -> stable (-> v0.12.4) (default)
stable -> 0.12 (-> v0.12.4) (default)
iojs -> iojs- (-> system) (default)

// check what node versions are available remotely
nvm ls-remote

// switch to iojs
nvm use iojs

// switch back to node
nvm use node

// install node version
nvm install v0.10.11

// switch to installed version
nvm use v0.10.11

// uninstall a node version
nvm uninstall v0.10.11

// uninstall nvm entirely
rm -rf ~/.nvm ~/.npm ~/.bower

These are simple and useful tasks. See nvm site for details.

New Ubuntu Server AMI

Boot up Ubuntu AMI and go to work…

sudo apt-get update
sudo apt-get dist-upgrade


sudo apt-get install apache2
sudo a2enmod rewrite
sudo service apache2 restart
sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

sudo apt-key adv --keyserver hkp:// --recv 7F0CEB10
echo 'deb dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install mongodb-10gen

sudo apt-get install git-core

local wordpress setup on mac osx lion

  1. Download WordPress to /Users/yourusername/Sites folder
  2. Extract package to a folder name to be your wordpress install. I called it wordpress
  3. Setup permissions on the wp-content folder so that wordpress can modify files there. I simply gave ownership to _www group.
    sudo chown -R _www wp-content
  4. Update /etc/apache2/users/yourusername.conf
    <Directory "/Users/yourusername/Sites/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride All AuthConfig
        Order allow,deny
        Allow from all
  5. .htaccess
  6. Restart apache for chaneges to take effect:
    sudo apachectl restart
  7. Edit wp-config.php to add this constant so wordpress will not ask your FTP credentials while installing plugins.
    define('FS_METHOD', 'direct');
  8. Create database for this wordpress installation in phpmyadmin.
  9. Create user for this database.
  10. Follow the 5 minute setup instructions localhost/~yourusername/wordpress/readme.html

Optional  Steps

  1. Update php version to 5.5 since Mac OSX lion comes with PHP 5.2 out of the box.
  2. Update Apache to 2.4 since Max OSX come with Apache 2.2 out of the box.

Hope this helps.