these are just some notes i took for the mean class, mean which means MongoDB Express AngularJS NodeJs,k

MEAN NOTES.txt

i tried these, but the last two command do not work to get the server started
 
this is what i did to install MEAN on this machine

 #SOURCE: https://www.digitalocean.com/community/tutorials/how-to-install-a-mean-js-stack-on-an-ubuntu-14-04-server
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install mongodb-org git build-essential openssl libssl-dev pkg-config
cd ~
wget https://nodejs.org/dist/v4.4.3/node-v4.4.3.tar.gz
tar xzvf node-v*
cd node-v*
./configure
make
# THIS WILL TAKE A LONG TIME
sudo make install
cd ~
rm -rf ~/node-v*

http://learn.mean.io/
curl -sL https://deb.nodesource.com/setup | sudo bash -
# THIS IS WHERE I SAVED THE UBUNTU - MEAN WITH JASON VM
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install git

sudo npm install -g gulp
// and bower
sudo npm install -g bower


sudo npm install -g mean-cli
mean init myApp
# What would you name your mean app? (myApp)
# Do you want to help us improve the mean network (Y/n)? n
#########################
Congratulations you have mean.io installed.

Before you install the dependencies and fire up the server we can help you with setting up your first admin user.
#####################
? Cool, bring it on: (N) y

Please provide your email so we can create your first admin user:[email protected]
Please provide your username so we can create your first admin user:toshiba
    DB connection successful!

Please provide password so we can create your first admin user
# Password must be only letters, spaces, or dashes 8-15 characters long
prompt: password:toshibalinux
role admin added to your new user

cd myApp

npm install
# THIS WILL TAKE A WHILE

gulp
# THIS WILL TAKE A WHILE @ [04:40:33] Finished 'jshint' after 14 s
# or
node server

Then, open a browser and go to:
http://localhost:3000

MEAN-bitnami-server-on-VirtualBox.txt

to get started, you can import the file on the seagate backup external usb drive (the black one), 
E:\VIRTUAL MACHINES -4-14-2016\IMPORT - EXPORT\bitnami-MEAN-SERVER.ova

once you have imported into virutalbox, run the server 

once you see BITNAMI the splash screen you can login as the default user:

user: bitnami
pass: bitnami

one quick way to know the server is running, go to the virtualbox server's ip address:
as of these notes, the ip was: http://192.168.100.191/
you will see: Congratulations!

also, you can SSH using putty, for this notes, the IP address was: 192.168.100.191

if this ip is not the same, you can just login to the virtualbox server with bitnami/bitnami and do an ifconfig to see the ip address

//START A NEW PROJECT:
//login to ssh then send these command:

cd /home/bitnami/htdocs/projects/first/sample
express sample
cd sample
npm install

//To start the application, use this command:
./bin/www


/// FINALLY IT WORKED, THIS IS WHAT I DID

1. IMPORT THE FILE CALLED: 
E:\VIRTUAL MACHINES -4-14-2016\IMPORT - EXPORT\bitnami-MEAN-SERVER.ova

ONCE THE SERVER IS RUNNING, OPEN PUTTY:
>Session >
	Host Name (or IP address) enter the ip address of the virtula maching (you can get it with ifconfig command)
	Save Sessions : MEAN SERVER
	click Save
> Connection > SSH > Tunnels
	Source port: 3000
	Destination: localhost:3000
	[x] Local
	[x] Auto
	CLick the Add Buttton
// GO BACK TO SESSION
CLICK OPEN

############################## NOTE
//make sure you have SSH enabled, for this .ova file, i had it alread enabled, but incase you dont, here is the commands:
sudo mv /etc/init/ssh.conf.back /etc/init/ssh.conf
sudo start ssh

//To disable it, perform the same steps in reverse:
sudo stop ssh
sudo mv /etc/init/ssh.conf /etc/init/ssh.conf.bac
##############################

//Step 1. Create a new MEAN project.
  cd /home/bitnami/projects
  express sample
  cd sample
  npm install
 ./bin/www
// NOTE: you will not get a message or anything, but the server is running

NOW OPEN YOUR BROWSER AND GO TO http://localhost:3000/
YOU WILL SEE A PAGE THAT SAYS:
Express
Welcome to Express

DONE


resources: 
https://docs.bitnami.com/virtual-machine/faq/
https://docs.bitnami.com/virtual-machine/infrastructure/mean/

http://www.webune.com/forums/how-to-run-mean-stack-server-on-oracle-virtualbox-with-bitnami-.html

//when you login for the first time using another network, click load in putty and change the ip adress then click open
//to login is:
bitnami
//then start the server with this command: 
./projects/sample/bin/www

then you can access server: http://localhost:3000/


########################################################################
Step 2. Add MongoDB and AngularJS to your MEAN application.
########################################################################

OPEN ANOTHER SSH by right click on putty and select: duplicate session
bitnami/bitnami


mongo admin --username root --password YOURPASSWORD
MongoDB shell version: 2.4.8
connecting to: 127.0.0.1:27017/admin
> db = db.getSiblingDB('admin')
admin
> db.changeUserPassword("root", "NEWPASSWORD")
> exit


//You can connect your application with MongoDB using MongooseJS, an object modelling driver for Node.js. It is already installed in the MEAN stack so you only have to 
// MAKE SURE TO STRETCH THE SSH WINDOW TO ALLOW THE LONG COMMAND

nano /home/bitnami/projects/sample/app.js

//add the following lines to your app.js file:

var Mongoose = require('mongoose');
var db = Mongoose.createConnection('mongodb://USER:PASSWORD@localhost/DATABASE');

//You can use install AngularJS in your application with Bower. 
//Create a file named .bowerrc in your application 

touch /home/bitnami/projects/sample/.bowerrc

//with the following content:
{ "directory" : "public/javascripts/vendor" }

//Then, run this command in the project directory:
bower install angular