20
Go Live || Go home Localhost Internet

Go live or go home

Embed Size (px)

Citation preview

Page 1: Go live or go home

Go Live || Go home

Localhost

Internet

Page 2: Go live or go home

Setting up1) Account

2) SSH key

3) Create Server

4) Login

5) Setup project

6) Save to git

7) At server key to git

8) Pull to server

9) Install mongo local & on server

10) Add mongo adaptor/setup

11) Test

12) Push

13) Pull and try! ^_^

+

on

with

Brian Shannon

Page 3: Go live or go home

Account

https://www.digitalocean.com/?refcode=8a22966dbe8b $10 free for 2

months hosting

Page 4: Go live or go home

Account

Page 5: Go live or go home

Create Server

Page 6: Go live or go home

Create Server

Page 7: Go live or go home

Create Server

.ssh/id_rsa.pub

Page 8: Go live or go home

Login

ssh root@ ….

Page 9: Go live or go home

Login

Page 10: Go live or go home

Setup project

● sails new livesite● cd livesite● sails lift

Page 11: Go live or go home

git

Page 12: Go live or go home

git

Page 13: Go live or go home

git● git init● git remote add origin

ssh:// ..user.. @bitbucket.org/ ..user.. /..project.. .git● git add .● git commit -m "first"● git push origin master

Page 14: Go live or go home

Setting up a key on the server

● ssh root@ … *ip● ssh-keygen -t rsa

– Enter.. enter.. enter..

● cat .ssh/id_rsa.pub● Copy the out *for the next step● service ssh restart

Page 15: Go live or go home

Let the server read you git

In the project

Page 16: Go live or go home

Setup node on the server

● apt-get install python-software-properties python g++ make

● add-apt-repository ppa:chris-lea/node.js● apt-get update● apt-get install nodejs● npm -g install sails

Page 17: Go live or go home

clone

● apt-get install git● git clone [email protected]:hackership/sitelive.git● cd livesite● tmux● sails lift

New: tmuxLeave: -CTRL b, dExisting:tmux attach

tmux

Page 18: Go live or go home

Mongo● npm install sails-mongo –save

● sails generate api message

● Change config/models.jsconnection: 'someMongodbServer'

● http://localhost:1337/message

● http://localhost:1337/message/create?name=brian

● git add .● git commit -m “now with mongo”● git push origin master

Page 19: Go live or go home

Mongo on the 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 -y mongodb-org● mkdir /data● mkdir /data/db● mongod

Page 20: Go live or go home

Pull and updating

● git pull origin master● npm install● sails lift

We are done