Giter Club home page Giter Club logo

nodejs-vagrant's Introduction

Vagrant Node.js + MongoDB + Cloud9 IDE Setup

Vagrant files to build Node.js box with MongoDB and Cloud9 IDE on Precise32 box based.

Installation

Clone this repository

git clone [email protected]:junwatu/nodejs-vagrant.git

Install Vagrant from http://www.vagrantup.com/downloads.html

Type vagrant command to setup vagrant box

$ vagrant up

NOTE: This command will downloads all the necessary files to build vagrant nodejs box. It will take quite long time so it really depends on your computer speed and internet connectivity.

Usage

####SSH

To access vagrant box via ssh from host computer

$ vagrant ssh

and if everything good there will be welcome screen like this one

Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic-pae i686)

========================
System Info
========================
Node v0.10.24

MongoDB db version v2.0.4, pdfile version 4.5
Wed Jan  1 04:55:33 git version: nogitversion

MongoDB shell version: 2.0.4

========================

 * Documentation:  https://help.ubuntu.com/
Welcome to your Vagrant-built virtual machine.
Last login: Wed Jan  1 04:54:56 2014 from 10.0.2.2

vagrant@precise32:~$

####MongoDB

Database access from host computer

$ mongo -p 27117

####Web Application

To access web application from browser

http://localhost:8085

There some ways to develop nodejs application from host computer.

Cloud9 IDE

Vagrant nodejs have web editor from Cloud9. To access it

http://localhost:3131

Cloud9 IDE Screenhost

Shared Folder

The default shared folder host computer with vagrant nodejs box is

../sync/www

relative to vagrant nodejs directory.

You can set the default folder to anything folder by setting vagrant file key

config.vm.synced_folder "../sync/www", "/home/vagrant/www", create: true

Git

TODO

Internal

NOTE: This process automatically running by bootstrap.sh script so you don't need to do this manually.

Create service file for Node Forever

$ chmod 755 /etc/init.d/nodejs

$ chmod 755 /etc/init.d/cloud9

Run forever at startup

to enable at startup

$ update-rc.d nodejs defaults

$ update-rc.d cloud9 defaults

to remove from startup

$ update-rc.d nodejs remove

$ update-rc.d cloud9 remove

Port Forwading

Node.js app port forwading 80 to 8085

Mongodb port forwading 27017 to 27117

Cloud9 IDE forwarding default 3131 to 3131

Setup MongoDB

edit /etc/mongodb.conf

bind_ip = 0.0.0.0

restart mongodb

sudo /etc/init.d/mongodb restart

Change Welcome Screen

$ sudo vim /etc/update-motd.d/00-header

nodejs-vagrant's People

Stargazers

 avatar  avatar Svyatoslav Varpikhovsky avatar Larry Xu avatar David Sackmary avatar Islam Ali avatar  avatar Franco Laiuppa avatar Ribhararnus Pracutiar avatar Sonny Lazuardi avatar

Watchers

James Cloos avatar Sonny Lazuardi avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.