This repository has been archived by the owner on Aug 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
INSTALL
162 lines (112 loc) · 3.02 KB
/
INSTALL
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
160
Here is an example log of an installation on a 12.04 Ubuntu Linode:
(starting as root)
yes | apt-get install uuid
useradd captain -G sudo -s /bin/bash -m
passwd captain
apt-get update
yes | apt-get install bison curl file git libreadline6-dev libsqlite3-dev libxml2-dev zlib1g-dev build-essential libyaml-dev nodejs
yes | apt-get install postgresql-9.1 libpq-dev
yes | apt-get install rubygems
gem install bluepill # causes error in doc for activesupport
useradd teach -m -s /bin/bash
passwd teach
su teach
bash --login # maybe repeat after changing paths if things are not found
cd
mkdir source
cd source
wget http://download.racket-lang.org/installers/5.3.6/racket/racket-5.3.6-bin-x86_64-linux-ubuntu-precise.sh
# http://download.racket-lang.org/installers/5.93/racket-5.93-i386-linux-ubuntu-precise.sh
mkdir ~/bin
sh racket-5.3.6-bin-x86_64-linux-ubuntu-precise.sh
# > no
# > 3
# > /home/teach
source ~/.profile
\curl -L https://get.rvm.io | bash -s -- --autolibs=read-fail
source ~/.bash_profile
rvm install 2.0.0 --autolibs=0
ssh-keygen
# <enter>
# <enter>
# <enter>
# <Copy public key to Github release key for captain-teach-assignments>
git clone https://github.com/brownplt/captain-teach.git
git clone https://github.com/brownplt/pyret-lang.git
cd pyret-lang
make dep
make
make test # Will ask for libcairo; not necessary for server-pyret
cd
cd captain-teach
rvm use 2.0.0
rvm gemset create captain-teach
make
cd web
rvm rvmrc warning ignore /home/teach/captain-teach/web/.rvmrc
bundle
logout
logout
su postgres
cd
createdb captain_teach
psql
# create user teach with password 'TEACH_PASSWORD'
# grant all privileges on database captain_teach to teach;
logout
su teach
cd ~/captain-teach/web
vim config/database.yml
Edit production:
production:
adapter: postgresql
encoding: utf8
database: captain_teach
timeout: 5000
password: 'TEACH_PASSWORD'
logout
yes | apt-get install nginx
cat <<EOF > /etc/nginx/sites-enabled/captain-teach.conf
server {
listen 80;
root /home/teach/captain-teach/web/public;
location / {
try_files \$uri @web;
}
location @web {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host \$host;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded_For \$proxy_add_x_forwarded_for;
}
}
server {
listen 4000;
root /home/teach/captain-teach/pyret-editor-backend/htdocs/;
location / {
try_files \$uri @web;
}
location @web {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host \$host;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded_For \$proxy_add_x_forwarded_for;
}
}
# gzip on;
# gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 9;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
EOF
rm /etc/nginx/sites-enabled/default
su teach
cd
bash --login
cd captain-teach/web
make keys
rake db:migrate RAILS_ENV=production
rake db:seeds RAILS_ENV=production