-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappsetup.sh
More file actions
executable file
·160 lines (104 loc) · 2.64 KB
/
appsetup.sh
File metadata and controls
executable file
·160 lines (104 loc) · 2.64 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
"""REPLACE IP ADDRESS WITH NEW ONE"""
ssh root@104.248.77.45
adduser bloom
usermod -aG sudo bloom
su - bloom
mkdir ~/.ssh
chmod 700 ~/.ssh
nano ~/.ssh/authorized_keys
"""Open new window on local"""
# ON LOCAL MACHINE
cat ~/.ssh/id_rsa.pub
##copy key##
chmod 600 ~/.ssh/authorized_keys
exit
#once to return to root
##dont have to do in 16...
##sudo nano /etc/ssh/sshd_config
##find line for Password Authentications... make no
##PasswordAuthentication no ##
##PubkeyAuthentication yes
##ChallengeResponseAuthentication no
##save and exit###
sudo systemctl reload sshd
##test login##
ssh bloom@104.248.77.45
# (exit other logged in session)
sudo ufw app list
"""type in Password"""
sudo ufw allow OpenSSH
sudo ufw enable
sudo ufw status
"""enter in y"""
##DONE WITH BASIC SETUP OF SERVER##
############APP SETUP###########
##wait
sudo apt-get update
sudo apt-get install python3-pip python3-dev nginx
sudo pip3 install virtualenv
mkdir ~/myproject
cd ~/myproject
virtualenv myprojectenv
source myprojectenv/bin/activate
pip3 install uwsgi
pip3 install flask
pip3 install plotly
pip3 install dash
pip3 install dash_core_components
pip3 install dash_html_components
pip3 install dash_table_experiments
pip3 install colorlover
pip3 install pandas
pip3 install pandas_datareader
pip3 install sklearn
pip3 install websocket
pip3 install websocket-client
sudo nano ~/myproject/myproject.py
###copy and paste main file###
sudo ufw allow 5000
"""On Local Machine"""
scp -r "-r for Folder/ALL FILES NEEDED" to bloom@104.248.67.189:/tmp
cd /tmp
mv "FILES" /home/bloom/myproject
"""BACK TO VIRTUAL"""
python3 myproject.py
"""on local to test"""
http://104.248.77.45:5000
nano ~/myproject/wsgi.py
###copy and paste file###
# from myproject import app
# if __name__ == "__main__":
# app.run()
####
uwsgi --socket 0.0.0.0:5000 --protocol=http -w wsgi:app
#go to domain:5000 for test
#ctrl C
deaactivate
nano ~/myproject/myproject.ini
## copy and paste ##
sudo nano /etc/systemd/system/myproject.service
##copy and paste ##
sudo systemctl start myproject
sudo systemctl enable myproject
sudo nano /etc/nginx/sites-available/myproject
## place in
server {
listen 80;
server_name 104.248.67.189;
###replace server_domain with IP###. come back to change to website
location / {
include uwsgi_params;
uwsgi_pass unix:/home/bloom/myproject/myproject.sock;
}
}
###
sudo ln -s /etc/nginx/sites-available/myproject /etc/nginx/sites-enabled
sudo nginx -t
sudo systemctl restart nginx
sudo ufw delete allow 5000
sudo ufw allow 'Nginx Full'
##test by going to http://domain
sudo systemctl reload nginx
cd /tmp
mv CryptosAbyss/ ~
cd /home/bloom