public
Description: Recipes to get your app up and running quickly and easily.
Clone URL: git://github.com/nakajima/capistrano-bells.git
Search Repo:
finalized apache recipe and balancer members
Sean Brown (author)
Fri Jun 06 08:59:00 -0700 2008
commit  e1a8fd8d362b6397f3433ea85eb899b5fb5c1cc1
tree    803aaf3b32f9395bf8b54ae717bb670ef85637ab
parent  4b857dae4b72541c3c897156664e4742e8926370
...
30
31
32
33
34
 
 
35
36
 
37
38
 
39
40
41
...
44
45
46
47
48
 
 
49
50
51
...
68
69
70
71
 
72
73
74
...
76
77
78
79
80
 
 
81
82
83
84
85
86
 
 
 
87
88
89
...
30
31
32
 
 
33
34
35
 
36
37
 
38
39
40
41
...
44
45
46
 
 
47
48
49
50
51
...
68
69
70
 
71
72
73
74
...
76
77
78
 
 
79
80
81
82
83
84
 
 
85
86
87
88
89
90
0
@@ -30,12 +30,12 @@ namespace :deploy do
0
       logger.info "generating .conf file"
0
       template_file = %q{
0
 <VirtualHost *:80>
0
- ServerName #{domain}
0
- ServerAlias www.#{domain}
0
+ ServerName <%= domain %>
0
+ ServerAlias www.<%= domain %>
0
 
0
- DocumentRoot #{deploy_to}/current/public
0
+ DocumentRoot <%= deploy_to %>/current/public
0
 
0
- <Directory #{deploy_to}/current/public>
0
+ <Directory <%= deploy_to %>/current/public>
0
     Options FollowSymLinks
0
     AllowOverride None
0
     Order allow,deny
0
@@ -44,8 +44,8 @@ namespace :deploy do
0
 
0
   # Configure mongrel_cluster
0
   
0
- <Proxy balancer://#{application}_cluster>
0
- <% (app_server_port.to_i...(app_servers.to_i+app_server_port.to_i)).each do |port| %><%= %{BalancerMember http://#{mongrel_address}:#{port}} %>
0
+ <Proxy balancer://<%=application%>_cluster>
0
+ <% (app_server_port.to_i...(app_servers.to_i+app_server_port.to_i)).each do |port| %><%= %{BalancerMember http://#{app_server_address}:#{port}} %>
0
   <% end %>
0
   </Proxy>
0
 
0
@@ -68,7 +68,7 @@ namespace :deploy do
0
 
0
   # Redirect all non-static requests to cluster
0
   RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
0
- RewriteRule ^/(.*)$ balancer://#{application}_cluster%{REQUEST_URI} [P,QSA,L]
0
+ RewriteRule ^/(.*)$ balancer://<%=application%>_cluster%{REQUEST_URI} [P,QSA,L]
0
 
0
   # Deflate
0
   AddOutputFilterByType DEFLATE text/html text/plain text/xml
0
@@ -76,14 +76,15 @@ namespace :deploy do
0
   BrowserMatch ^Mozilla/4\.0[678] no-gzip
0
   BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
0
 
0
- ErrorLog logs/#{domain}-error_log
0
- CustomLog logs/#{domain}-access_log combined
0
+ ErrorLog logs/<%=domain%>-error_log
0
+ CustomLog logs/<%=domain%>-access_log combined
0
 </VirtualHost>
0
 }
0
       
0
       require 'erb'
0
- result = ERB.new(template_file).result(binding)
0
- put result, "#{application}.conf"
0
+
0
+ config = ERB.new(template_file)
0
+ put config.result(binding), "#{application}.conf"
0
       logger.info "placing #{application}.conf on remote server"
0
       sudo "mv #{application}.conf #{apache_conf}"
0
       sudo "chown deploy:users #{apache_conf}"

Comments

    No one has commented yet.