/ MONGODB, NODEJS, UBUNTU

Installing Node and Mongo

I need to install Node and Mongo an a server. These are my notes.

  1. Create Server

    • Create new Instance (ami-63be790a)
      • Ubuntu 10.04 LTS Lucid
      • EBS boot
      • Canonical
      • ubuntu@
      • 64 bit machine because that is what mongo recommends
      • us-east-1
      • m1.Large
    • Linux 2.6.36 kernel
  2. Create Security Group
    • Mongo Ports:
      • Standalone mongod : 27017
      • mongos : 27017
      • shard server (mongod –shardsvr) : 27018
      • config server (mongod –configsvr) : 27019
      • web stats page for mongod : add 1000 to port number (28017, by default)
    • Standard Ports:
      • 20 (ssh)
      • 80 (Http)
      • 443 (Https)
  3. Configure SSH

    • Add new user sudo adduser bbdiddle- Add user to sudoers `sudo vi /etc/sudoers

    # Add this line to the sodoers file bbdiddle ALL=(ALL) NOPASSWD:ALL- Enable ssh sudo vi /etc/ssh/sshd_config

    # Change to yes to allow ssh PasswordAuthentication yes- Restart ssh sudo /etc/init.d/ssh restart`

  4. Install Mongo
    • Download and install
       curl http://downloads.mongodb.org/linux/mongodb-linux-x86_64-2.0.2.tgz > mongo.tgz
       tar -xzvf mongo.tgz
       mv mongodb-linux-x86_64-2.0.2 /opt/mongo
       sudo mkdir -p /mnt/db
       sudo chown id -u /mnt/db
      
    • Test start server
       sudo ./mongodb-xxxxxxx/bin/mongod
      
    • Running as a Daemon
       ./mongod --fork --logpath /var/log/mongodb.log --logappend --dbpath /mnt/db
      
  5. Install Node
     # Install dependencies
     sudo apt-get install g++ curl libssl-dev apache2-utils
     sudo apt-get install git-core
    
     # Get latest code
     git clone https://github.com/joyent/node.git
     cd node
    
     # Make the project
     ./configure --prefix=/opt/node
     make
     sudo make install
    
     # Edit path variables
     sudo vi /etc/bash.bashrc
     // Add to bottom of file export PATH=$PATH:/opt/node/bin:.
    
     # Verify Installation
     node --version
     npm --version
    

Notes