-
Notifications
You must be signed in to change notification settings - Fork 2
/
ubuntu-deployment-notes.txt
70 lines (44 loc) · 1.77 KB
/
ubuntu-deployment-notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Setting up the server on Ubuntu 12.04 LTS
On the server:
1) Add a dev group
sudo groupadd dev
2) Add deploy users to dev group
sudo usermod -a -G dev <user name>
3) Set up deploy directory
sudo mkdir /var/www
sudo mkdir /var/www/node_apps
sudo chgrp dev /var/www/node_apps
sudo chmod g+ws /var/www/node_apps
4) Install node
sudo apt-get update
sudo apt-get install build-essential -y
sudo apt-get install libxslt-dev libxml2-dev -y
sudo apt-get install git -y
sudo apt-get install python libssl-dev -y
sudo apt-get install python-software-properties -y
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs -y
sudo apt-get install npm -y
5) Install some required NPMs
sudo npm install -g coffee-script
If inside a firewall, this may require
sudo HTTPS_PROXY=<proxy-url> npm install -g coffee-script
6) Install MongoDB
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
sudo sh -c 'echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" > /etc/apt/sources.list.d/10gen.list'
sudo apt-get update
sudo apt-get install mongodb-10gen -y
On a dev box, from the kamira source directory:
1) Create deployment setup and deploy; you'll need sudo on server for setup and, for now at least, deploy
cap deploy:setup
cap deploy
Done!
Future work needed:
Monitoring:
monit? As noted here: http://howtonode.org/deploying-node-upstart-monit
might not be needed, have respawn in upstart
Run as non-root:
change upstart line to: exec sudo -u username sh -c "/usr/local/bin/node /where/yourprogram.js >> /var/log/node.log 2>&1"
Correctly restart on server reboot
needs testing; might need to tweak upstart to use runlevels instead