-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathNOTES
71 lines (51 loc) · 1.58 KB
/
NOTES
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
THIS IS OUT-DATED. To be updated later.
Steps
=====
1. Set up mongrel_cluster
follow: http://mongrel.rubyforge.org/docs/mongrel_cluster.html
run it with user ioi:ioi
2. Set up Apache
in general follow:
http://mongrel.rubyforge.org/docs/apache.html
2.1 enable mods
run:
sudo a2enmod rewrite
sudo a2enmod proxy
sudo a2enmod proxy_balancer
sudo a2enmod proxy_http
sudo a2enmod deflate
sudo a2enmod headers
2.2 edit virtual host at /etc/apache2/site-(available|enabled)
added:
===========================================
<directory "/home/ioi/web_grader/public/">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</directory>
<proxy balancer://mongrel_cluster>
BalancerMember http://127.0.0.1:8000
BalancerMember http://127.0.0.1:8001
BalancerMember http://127.0.0.1:8002
BalancerMember http://127.0.0.1:8003
BalancerMember http://127.0.0.1:8004
Allow from all
</proxy>
# can't use proxypass because we want access to balancer-manager
#ProxyPass / balancer://mongrel_cluster/
#ProxyPassReverse / balancer://mongrel_cluster/
<Location /balancer-manager>
SetHandler balancer-manager
</Location>
RewriteEngine On
# Uncomment for rewrite debugging
RewriteLog "/var/log/apache2/ioi_rewrite.log"
RewriteLogLevel 9
# Rewrite to check for Rails cached page
RewriteRule ^([^.]+)$ $1.html [QSA]
# Redirect all non-static requests to cluster
RewriteCond %{REQUEST_URI} !^/balancer-manager/(.*)$
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L]
===========================================