Description:
update NOTES
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@120 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r55:3e9e12386752 - - 1 file changed: 1 inserted, 1 deleted
@@ -1,69 +1,69 | |||
|
1 | 1 | Steps |
|
2 | 2 | ===== |
|
3 | 3 | |
|
4 | 4 | 1. Set up mongrel_cluster |
|
5 | 5 | |
|
6 | 6 | follow: http://mongrel.rubyforge.org/docs/mongrel_cluster.html |
|
7 | 7 | |
|
8 | 8 | run it with user ioi:ioi |
|
9 | 9 | |
|
10 | 10 | |
|
11 | 11 | 2. Set up Apache |
|
12 | 12 | |
|
13 | 13 | in general follow: |
|
14 | 14 | http://mongrel.rubyforge.org/docs/apache.html |
|
15 | 15 | |
|
16 | 16 | 2.1 enable mods |
|
17 | 17 | |
|
18 | 18 | run: |
|
19 | 19 | sudo a2enmod rewrite |
|
20 | 20 | sudo a2enmod proxy |
|
21 | 21 | sudo a2enmod proxy_balancer |
|
22 | 22 | sudo a2enmod proxy_http |
|
23 | 23 | sudo a2enmod deflate |
|
24 | 24 | sudo a2enmod headers |
|
25 | 25 | |
|
26 | 26 | 2.2 edit virtual host at /etc/apache2/site-(available|enabled) |
|
27 | 27 | |
|
28 | 28 | added: |
|
29 | 29 | =========================================== |
|
30 | 30 | <directory "/home/ioi/web_grader/public/"> |
|
31 | 31 | Options FollowSymLinks |
|
32 | 32 | AllowOverride None |
|
33 | 33 | Order allow,deny |
|
34 | 34 | Allow from all |
|
35 | 35 | </directory> |
|
36 | 36 | |
|
37 | 37 | <proxy balancer://mongrel_cluster> |
|
38 | 38 | BalancerMember http://127.0.0.1:8000 |
|
39 | 39 | BalancerMember http://127.0.0.1:8001 |
|
40 | 40 | BalancerMember http://127.0.0.1:8002 |
|
41 | 41 | BalancerMember http://127.0.0.1:8003 |
|
42 | 42 | BalancerMember http://127.0.0.1:8004 |
|
43 |
- Allow from |
|
|
43 | + Allow from all | |
|
44 | 44 | </proxy> |
|
45 | 45 | |
|
46 | 46 | # can't use proxypass because we want access to balancer-manager |
|
47 | 47 | #ProxyPass / balancer://mongrel_cluster/ |
|
48 | 48 | #ProxyPassReverse / balancer://mongrel_cluster/ |
|
49 | 49 | |
|
50 | 50 | <Location /balancer-manager> |
|
51 | 51 | SetHandler balancer-manager |
|
52 | 52 | </Location> |
|
53 | 53 | |
|
54 | 54 | RewriteEngine On |
|
55 | 55 | |
|
56 | 56 | # Uncomment for rewrite debugging |
|
57 | 57 | RewriteLog "/var/log/apache2/ioi_rewrite.log" |
|
58 | 58 | RewriteLogLevel 9 |
|
59 | 59 | |
|
60 | 60 | # Rewrite to check for Rails cached page |
|
61 | 61 | RewriteRule ^([^.]+)$ $1.html [QSA] |
|
62 | 62 | |
|
63 | 63 | # Redirect all non-static requests to cluster |
|
64 | 64 | RewriteCond %{REQUEST_URI} !^/balancer-manager/(.*)$ |
|
65 | 65 | RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f |
|
66 | 66 | RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L] |
|
67 | 67 | =========================================== |
|
68 | 68 | |
|
69 | 69 |
You need to be logged in to leave comments.
Login now