-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_info.txt
81 lines (51 loc) · 1.8 KB
/
config_info.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
71
72
73
74
75
76
77
78
79
80
81
for ubuntu
lxml:
sudo apt-get install libxml2-dev libxslt1-dev python-dev
sudo apt-get install python-lxml
remove lxml from requirements.txt
go to directory and pip install requirements.txt
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
set environment variables
install nodejs legacy
install npm
change 3000 to 80 port iptable
{
Create soft link for running node from CLI on ubuntu aws. (runs on nodejs)
sudo ln -s /usr/bin/nodejs /usr/bin/node
To View:
sudo iptables -t nat -L
To change:
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 3000
To remove:
sudo iptables -t nat -D PREROUTING 1
For Persisting on reboot:
Add these two lines in /etc/network/interfaces:
pre-up iptables-restore < /etc/iptables.rules
post-down iptables-save > /etc/iptables.rules
To start app on server restart:
pm2 startup
pm2 save
or pm2 update
find process
ps OR lsof -i :3000 (port number)
kill process:
kill -9 pid
}
install pm2
sudo npm install pm2 -g
redis:
http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/GettingStarted.ConnectToCacheNode.html
{
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make
src/redis-cli -c -h mycachecluster.eaogs8.0001.usw2.cache.amazonaws.com -p 6379
src/redis-cli -c -h news.wcekgc.0001.usw2.cache.amazonaws.com -p 6379
}
to daemonize script:
https://web.archive.org/web/20160305151936/http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
Dont do above, do this:
nohup some_command > nohup2.out&
put code in run method override, command python daemonscript.py start,stop,restart
reference supervisord: http://stackoverflow.com/questions/16420092/how-to-make-python-script-run-as-service