mdh-ec2onrails 0.9.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. data/CHANGELOG +180 -0
  2. data/COPYING +339 -0
  3. data/Manifest +162 -0
  4. data/README.textile +214 -0
  5. data/Rakefile +36 -0
  6. data/TODO +102 -0
  7. data/ec2onrails.gemspec +42 -0
  8. data/examples/Capfile +3 -0
  9. data/examples/deploy.rb +101 -0
  10. data/examples/s3.yml +9 -0
  11. data/lib/ec2onrails.rb +20 -0
  12. data/lib/ec2onrails/capistrano_utils.rb +43 -0
  13. data/lib/ec2onrails/recipes.rb +844 -0
  14. data/lib/ec2onrails/version.rb +31 -0
  15. data/server/build-ec2onrails.sh +44 -0
  16. data/server/files/etc/aliases +5 -0
  17. data/server/files/etc/aliases.db +0 -0
  18. data/server/files/etc/apache2/apache2.conf +295 -0
  19. data/server/files/etc/apache2/conf.d/app.proxy_cluster.conf +7 -0
  20. data/server/files/etc/apache2/conf.d/app.proxy_frontend.conf +10 -0
  21. data/server/files/etc/apache2/mods-available/proxy.conf +18 -0
  22. data/server/files/etc/apache2/sites-available/app.common +56 -0
  23. data/server/files/etc/apache2/sites-available/app.custom +0 -0
  24. data/server/files/etc/apache2/sites-available/default +14 -0
  25. data/server/files/etc/apache2/sites-available/default-ssl +19 -0
  26. data/server/files/etc/cron.d/backup_app_db_to_s3 +16 -0
  27. data/server/files/etc/cron.daily/app +9 -0
  28. data/server/files/etc/cron.daily/logrotate_post +19 -0
  29. data/server/files/etc/cron.hourly/app +10 -0
  30. data/server/files/etc/cron.monthly/app +10 -0
  31. data/server/files/etc/cron.weekly/app +10 -0
  32. data/server/files/etc/denyhosts.conf +628 -0
  33. data/server/files/etc/dpkg/dpkg.cfg +13 -0
  34. data/server/files/etc/ec2onrails/README +32 -0
  35. data/server/files/etc/ec2onrails/balancer_members +6 -0
  36. data/server/files/etc/ec2onrails/roles.yml +5 -0
  37. data/server/files/etc/environment +2 -0
  38. data/server/files/etc/god/app.god +35 -0
  39. data/server/files/etc/god/db.god +17 -0
  40. data/server/files/etc/god/examples/have_god_daemonize.god +18 -0
  41. data/server/files/etc/god/master.conf +35 -0
  42. data/server/files/etc/god/memcache.god +15 -0
  43. data/server/files/etc/god/notifications.god +14 -0
  44. data/server/files/etc/god/system.god +34 -0
  45. data/server/files/etc/god/web.god +36 -0
  46. data/server/files/etc/init.d/ec2-every-startup +29 -0
  47. data/server/files/etc/init.d/ec2-first-startup +36 -0
  48. data/server/files/etc/init.d/god +42 -0
  49. data/server/files/etc/init.d/nginx +78 -0
  50. data/server/files/etc/init.d/set_roles +3 -0
  51. data/server/files/etc/logrotate.d/apache2 +16 -0
  52. data/server/files/etc/logrotate.d/mongrel +11 -0
  53. data/server/files/etc/logrotate.d/nginx +11 -0
  54. data/server/files/etc/memcached.conf +47 -0
  55. data/server/files/etc/mongrel_cluster/app.yml +9 -0
  56. data/server/files/etc/motd.tail +13 -0
  57. data/server/files/etc/mysql/my.cnf +152 -0
  58. data/server/files/etc/nginx/nginx.conf +296 -0
  59. data/server/files/etc/postfix/main.cf +4 -0
  60. data/server/files/etc/rcS.d/S91ec2-first-startup +1 -0
  61. data/server/files/etc/rcS.d/S92ec2-every-startup +1 -0
  62. data/server/files/etc/rcS.d/S99set_roles +1 -0
  63. data/server/files/etc/ssh/sshd_config +94 -0
  64. data/server/files/etc/sudoers +1 -0
  65. data/server/files/etc/sudoers.full_access +26 -0
  66. data/server/files/etc/sudoers.restricted_access +28 -0
  67. data/server/files/etc/syslog.conf +69 -0
  68. data/server/files/usr/bin/god +26 -0
  69. data/server/files/usr/local/ec2onrails/COPYING +339 -0
  70. data/server/files/usr/local/ec2onrails/bin/archive_file.rb +44 -0
  71. data/server/files/usr/local/ec2onrails/bin/backup_app_db.rb +159 -0
  72. data/server/files/usr/local/ec2onrails/bin/ec2_meta_data.rb +80 -0
  73. data/server/files/usr/local/ec2onrails/bin/exec_runner +73 -0
  74. data/server/files/usr/local/ec2onrails/bin/init_services.rb +64 -0
  75. data/server/files/usr/local/ec2onrails/bin/optimize_mysql.rb +348 -0
  76. data/server/files/usr/local/ec2onrails/bin/rails_env +35 -0
  77. data/server/files/usr/local/ec2onrails/bin/rebundle.sh +70 -0
  78. data/server/files/usr/local/ec2onrails/bin/restore_app_db.rb +58 -0
  79. data/server/files/usr/local/ec2onrails/bin/set_rails_env +40 -0
  80. data/server/files/usr/local/ec2onrails/bin/set_roles.rb +87 -0
  81. data/server/files/usr/local/ec2onrails/bin/setup_web_proxy.rb +109 -0
  82. data/server/files/usr/local/ec2onrails/config +30 -0
  83. data/server/files/usr/local/ec2onrails/lib/aws_helper.rb +76 -0
  84. data/server/files/usr/local/ec2onrails/lib/god_helper.rb +129 -0
  85. data/server/files/usr/local/ec2onrails/lib/god_patch.rb +43 -0
  86. data/server/files/usr/local/ec2onrails/lib/mysql_helper.rb +101 -0
  87. data/server/files/usr/local/ec2onrails/lib/roles_helper.rb +151 -0
  88. data/server/files/usr/local/ec2onrails/lib/s3_helper.rb +99 -0
  89. data/server/files/usr/local/ec2onrails/lib/utils.rb +16 -0
  90. data/server/files/usr/local/ec2onrails/lib/vendor/ini.rb +268 -0
  91. data/server/files/usr/local/ec2onrails/startup-scripts/every-startup/get-hostname.sh +25 -0
  92. data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/README +5 -0
  93. data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/create-dirs.sh +39 -0
  94. data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/generate-default-web-cert-and-key.sh +49 -0
  95. data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/misc.sh +27 -0
  96. data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/prepare-mysql-data-dir.sh +24 -0
  97. data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/setup-credentials.sh +29 -0
  98. data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/setup-file-permissions.sh +30 -0
  99. data/server/rakefile.rb +248 -0
  100. data/setup.rb +1585 -0
  101. data/test/autobench.conf +60 -0
  102. data/test/spec/lib/s3_helper_spec.rb +134 -0
  103. data/test/spec/lib/s3_old.yml +3 -0
  104. data/test/spec/test_files/test1 +0 -0
  105. data/test/spec/test_files/test2 +0 -0
  106. data/test/test_app/Capfile +3 -0
  107. data/test/test_app/README +182 -0
  108. data/test/test_app/Rakefile +10 -0
  109. data/test/test_app/app/controllers/application.rb +7 -0
  110. data/test/test_app/app/controllers/db_fast_controller.rb +6 -0
  111. data/test/test_app/app/controllers/fast_controller.rb +5 -0
  112. data/test/test_app/app/controllers/slow_controller.rb +6 -0
  113. data/test/test_app/app/controllers/very_slow_controller.rb +6 -0
  114. data/test/test_app/app/helpers/application_helper.rb +3 -0
  115. data/test/test_app/app/helpers/db_fast_helper.rb +2 -0
  116. data/test/test_app/app/helpers/fast_helper.rb +2 -0
  117. data/test/test_app/app/helpers/slow_helper.rb +2 -0
  118. data/test/test_app/app/helpers/very_slow_helper.rb +2 -0
  119. data/test/test_app/config/boot.rb +109 -0
  120. data/test/test_app/config/database.yml +19 -0
  121. data/test/test_app/config/deploy.rb +21 -0
  122. data/test/test_app/config/environment.rb +60 -0
  123. data/test/test_app/config/environments/development.rb +21 -0
  124. data/test/test_app/config/environments/production.rb +18 -0
  125. data/test/test_app/config/environments/test.rb +19 -0
  126. data/test/test_app/config/routes.rb +27 -0
  127. data/test/test_app/db/schema.rb +7 -0
  128. data/test/test_app/doc/README_FOR_APP +2 -0
  129. data/test/test_app/public/404.html +30 -0
  130. data/test/test_app/public/500.html +30 -0
  131. data/test/test_app/public/dispatch.cgi +10 -0
  132. data/test/test_app/public/dispatch.fcgi +24 -0
  133. data/test/test_app/public/dispatch.rb +10 -0
  134. data/test/test_app/public/favicon.ico +0 -0
  135. data/test/test_app/public/images/rails.png +0 -0
  136. data/test/test_app/public/javascripts/application.js +2 -0
  137. data/test/test_app/public/javascripts/controls.js +963 -0
  138. data/test/test_app/public/javascripts/dragdrop.js +972 -0
  139. data/test/test_app/public/javascripts/effects.js +1120 -0
  140. data/test/test_app/public/javascripts/prototype.js +4225 -0
  141. data/test/test_app/public/robots.txt +1 -0
  142. data/test/test_app/script/about +3 -0
  143. data/test/test_app/script/breakpointer +3 -0
  144. data/test/test_app/script/console +3 -0
  145. data/test/test_app/script/destroy +3 -0
  146. data/test/test_app/script/generate +3 -0
  147. data/test/test_app/script/performance/benchmarker +3 -0
  148. data/test/test_app/script/performance/profiler +3 -0
  149. data/test/test_app/script/performance/request +3 -0
  150. data/test/test_app/script/plugin +3 -0
  151. data/test/test_app/script/process/inspector +3 -0
  152. data/test/test_app/script/process/reaper +3 -0
  153. data/test/test_app/script/process/spawner +3 -0
  154. data/test/test_app/script/runner +3 -0
  155. data/test/test_app/script/server +3 -0
  156. data/test/test_app/test/functional/db_fast_controller_test.rb +18 -0
  157. data/test/test_app/test/functional/fast_controller_test.rb +18 -0
  158. data/test/test_app/test/functional/slow_controller_test.rb +18 -0
  159. data/test/test_app/test/functional/very_slow_controller_test.rb +18 -0
  160. data/test/test_app/test/test_helper.rb +28 -0
  161. data/test/test_ec2onrails.rb +11 -0
  162. data/test/test_helper.rb +2 -0
  163. metadata +274 -0
@@ -0,0 +1,31 @@
1
+ # This file is part of EC2 on Rails.
2
+ # http://rubyforge.org/projects/ec2onrails/
3
+ #
4
+ # Copyright 2007 Paul Dowman, http://pauldowman.com/
5
+ #
6
+ # EC2 on Rails is free software; you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation; either version 2 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # EC2 on Rails is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+
19
+ module Ec2onrails #:nodoc:
20
+ module VERSION #:nodoc:
21
+ MAJOR = 0
22
+ MINOR = 9
23
+ TINY = 10
24
+ # GEM_UPDATE = 0
25
+ # STRING = [MAJOR, MINOR, TINY, GEM_UPDATE].join('.')
26
+ STRING = [MAJOR, MINOR, TINY].join('.')
27
+
28
+ AMI_ID_32_BIT = 'ami-c9bc58a0'
29
+ AMI_ID_64_BIT = 'ami-cbbc58a2'
30
+ end
31
+ end
@@ -0,0 +1,44 @@
1
+ #!/bin/sh
2
+
3
+ # This file is part of EC2 on Rails.
4
+ # http://rubyforge.org/projects/ec2onrails/
5
+ #
6
+ # Copyright 2007 Paul Dowman, http://pauldowman.com/
7
+ #
8
+ # EC2 on Rails is free software; you can redistribute it and/or modify
9
+ # it under the terms of the GNU General Public License as published by
10
+ # the Free Software Foundation; either version 2 of the License, or
11
+ # (at your option) any later version.
12
+ #
13
+ # EC2 on Rails is distributed in the hope that it will be useful,
14
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ # GNU General Public License for more details.
17
+ #
18
+ # You should have received a copy of the GNU General Public License
19
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+
21
+
22
+ # This script runs the EC2 on Rails rakefile, it's meant to be called by
23
+ # Eric Hammond's Ubuntu build script: http://alestic.com/
24
+
25
+
26
+ if [ -z `which rake` ] ; then
27
+ echo "Installing rake..."
28
+ (
29
+ cd /tmp
30
+ wget http://rubyforge.org/frs/download.php/29752/rake-0.8.1.tgz
31
+ tar xvf rake-0.8.1.tgz
32
+ cd rake-0.8.1
33
+ ruby install.rb
34
+ )
35
+ fi
36
+
37
+ cd `dirname $0`
38
+
39
+ if [ $(uname -m) = 'x86_64' ]; then
40
+ export ARCH=x86_64
41
+ rake
42
+ else
43
+ rake
44
+ fi
@@ -0,0 +1,5 @@
1
+ # See man 5 aliases for format
2
+
3
+ # send all mail to app user.
4
+ root: app
5
+ postmaster: app
Binary file
@@ -0,0 +1,295 @@
1
+ #
2
+ # Based upon the NCSA server configuration files originally by Rob McCool.
3
+ #
4
+ # This is the main Apache server configuration file. It contains the
5
+ # configuration directives that give the server its instructions.
6
+ # See http://httpd.apache.org/docs/2.2/ for detailed information about
7
+ # the directives.
8
+ #
9
+ # Do NOT simply read the instructions in here without understanding
10
+ # what they do. They're here only as hints or reminders. If you are unsure
11
+ # consult the online docs. You have been warned.
12
+ #
13
+ # The configuration directives are grouped into three basic sections:
14
+ # 1. Directives that control the operation of the Apache server process as a
15
+ # whole (the 'global environment').
16
+ # 2. Directives that define the parameters of the 'main' or 'default' server,
17
+ # which responds to requests that aren't handled by a virtual host.
18
+ # These directives also provide default values for the settings
19
+ # of all virtual hosts.
20
+ # 3. Settings for virtual hosts, which allow Web requests to be sent to
21
+ # different IP addresses or hostnames and have them handled by the
22
+ # same Apache server process.
23
+ #
24
+ # Configuration and logfile names: If the filenames you specify for many
25
+ # of the server's control files begin with "/" (or "drive:/" for Win32), the
26
+ # server will use that explicit path. If the filenames do *not* begin
27
+ # with "/", the value of ServerRoot is prepended -- so "/var/log/apache2/foo.log"
28
+ # with ServerRoot set to "" will be interpreted by the
29
+ # server as "//var/log/apache2/foo.log".
30
+ #
31
+
32
+ ### Section 1: Global Environment
33
+ #
34
+ # The directives in this section affect the overall operation of Apache,
35
+ # such as the number of concurrent requests it can handle or where it
36
+ # can find its configuration files.
37
+ #
38
+
39
+ #
40
+ # ServerRoot: The top of the directory tree under which the server's
41
+ # configuration, error, and log files are kept.
42
+ #
43
+ # NOTE! If you intend to place this on an NFS (or otherwise network)
44
+ # mounted filesystem then please read the LockFile documentation (available
45
+ # at <URL:http://httpd.apache.org/docs-2.1/mod/mpm_common.html#lockfile>);
46
+ # you will save yourself a lot of trouble.
47
+ #
48
+ # Do NOT add a slash at the end of the directory path.
49
+ #
50
+ ServerRoot "/etc/apache2"
51
+
52
+ #
53
+ # The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
54
+ #
55
+ #<IfModule !mpm_winnt.c>
56
+ #<IfModule !mpm_netware.c>
57
+ LockFile /var/lock/apache2/accept.lock
58
+ #</IfModule>
59
+ #</IfModule>
60
+
61
+ #
62
+ # PidFile: The file in which the server should record its process
63
+ # identification number when it starts.
64
+ #
65
+ PidFile /var/run/apache2.pid
66
+
67
+ #
68
+ # Timeout: The number of seconds before receives and sends time out.
69
+ #
70
+ Timeout 300
71
+
72
+ #
73
+ # KeepAlive: Whether or not to allow persistent connections (more than
74
+ # one request per connection). Set to "Off" to deactivate.
75
+ #
76
+ KeepAlive On
77
+
78
+ #
79
+ # MaxKeepAliveRequests: The maximum number of requests to allow
80
+ # during a persistent connection. Set to 0 to allow an unlimited amount.
81
+ # We recommend you leave this number high, for maximum performance.
82
+ #
83
+ MaxKeepAliveRequests 100
84
+
85
+ #
86
+ # KeepAliveTimeout: Number of seconds to wait for the next request from the
87
+ # same client on the same connection.
88
+ #
89
+ KeepAliveTimeout 15
90
+
91
+ ##
92
+ ## Server-Pool Size Regulation (MPM specific)
93
+ ##
94
+
95
+ # prefork MPM
96
+ # StartServers: number of server processes to start
97
+ # MinSpareServers: minimum number of server processes which are kept spare
98
+ # MaxSpareServers: maximum number of server processes which are kept spare
99
+ # MaxClients: maximum number of server processes allowed to start
100
+ # MaxRequestsPerChild: maximum number of requests a server process serves
101
+ <IfModule mpm_prefork_module>
102
+ StartServers 5
103
+ MinSpareServers 5
104
+ MaxSpareServers 10
105
+ MaxClients 250
106
+ MaxRequestsPerChild 0
107
+ </IfModule>
108
+
109
+ # worker MPM
110
+ # StartServers: initial number of server processes to start
111
+ # MaxClients: maximum number of simultaneous client connections
112
+ # MinSpareThreads: minimum number of worker threads which are kept spare
113
+ # MaxSpareThreads: maximum number of worker threads which are kept spare
114
+ # ThreadsPerChild: constant number of worker threads in each server process
115
+ # MaxRequestsPerChild: maximum number of requests a server process serves
116
+ <IfModule mpm_worker_module>
117
+ StartServers 2
118
+ MaxClients 150
119
+ MinSpareThreads 25
120
+ MaxSpareThreads 75
121
+ ThreadsPerChild 25
122
+ MaxRequestsPerChild 0
123
+ </IfModule>
124
+
125
+ User www-data
126
+ Group www-data
127
+
128
+ #
129
+ # AccessFileName: The name of the file to look for in each directory
130
+ # for additional configuration directives. See also the AllowOverride
131
+ # directive.
132
+ #
133
+
134
+ AccessFileName .htaccess
135
+
136
+ #
137
+ # The following lines prevent .htaccess and .htpasswd files from being
138
+ # viewed by Web clients.
139
+ #
140
+ <Files ~ "^\.ht">
141
+ Order allow,deny
142
+ Deny from all
143
+ </Files>
144
+
145
+ #
146
+ # DefaultType is the default MIME type the server will use for a document
147
+ # if it cannot otherwise determine one, such as from filename extensions.
148
+ # If your server contains mostly text or HTML documents, "text/plain" is
149
+ # a good value. If most of your content is binary, such as applications
150
+ # or images, you may want to use "application/octet-stream" instead to
151
+ # keep browsers from trying to display binary files as though they are
152
+ # text.
153
+ #
154
+ DefaultType text/plain
155
+
156
+
157
+ #
158
+ # HostnameLookups: Log the names of clients or just their IP addresses
159
+ # e.g., www.apache.org (on) or 204.62.129.132 (off).
160
+ # The default is off because it'd be overall better for the net if people
161
+ # had to knowingly turn this feature on, since enabling it means that
162
+ # each client request will result in AT LEAST one lookup request to the
163
+ # nameserver.
164
+ #
165
+ HostnameLookups Off
166
+
167
+ # ErrorLog: The location of the error log file.
168
+ # If you do not specify an ErrorLog directive within a <VirtualHost>
169
+ # container, error messages relating to that virtual host will be
170
+ # logged here. If you *do* define an error logfile for a <VirtualHost>
171
+ # container, that host's errors will be logged there and not here.
172
+ #
173
+ ErrorLog /mnt/log/apache2/error.log
174
+
175
+ #
176
+ # LogLevel: Control the number of messages logged to the error_log.
177
+ # Possible values include: debug, info, notice, warn, error, crit,
178
+ # alert, emerg.
179
+ #
180
+ LogLevel warn
181
+
182
+ # Include module configuration:
183
+ Include /etc/apache2/mods-enabled/*.load
184
+ Include /etc/apache2/mods-enabled/*.conf
185
+
186
+ # Include all the user configurations:
187
+ Include /etc/apache2/httpd.conf
188
+
189
+ # Include ports listing
190
+ Include /etc/apache2/ports.conf
191
+
192
+ #
193
+ # The following directives define some format nicknames for use with
194
+ # a CustomLog directive (see below).
195
+ #
196
+ LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
197
+ LogFormat "%h %l %u %t \"%r\" %>s %b" common
198
+ LogFormat "%{Referer}i -> %U" referer
199
+ LogFormat "%{User-agent}i" agent
200
+
201
+ #
202
+ # ServerTokens
203
+ # This directive configures what you return as the Server HTTP response
204
+ # Header. The default is 'Full' which sends information about the OS-Type
205
+ # and compiled in modules.
206
+ # Set to one of: Full | OS | Minor | Minimal | Major | Prod
207
+ # where Full conveys the most information, and Prod the least.
208
+ #
209
+ ServerTokens Prod
210
+
211
+ #
212
+ # Optionally add a line containing the server version and virtual host
213
+ # name to server-generated pages (internal error documents, FTP directory
214
+ # listings, mod_status and mod_info output etc., but not CGI generated
215
+ # documents or custom error documents).
216
+ # Set to "EMail" to also include a mailto: link to the ServerAdmin.
217
+ # Set to one of: On | Off | EMail
218
+ #
219
+ ServerSignature Off
220
+
221
+
222
+
223
+ #
224
+ # Customizable error responses come in three flavors:
225
+ # 1) plain text 2) local redirects 3) external redirects
226
+ #
227
+ # Some examples:
228
+ #ErrorDocument 500 "The server made a boo boo."
229
+ #ErrorDocument 404 /missing.html
230
+ #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
231
+ #ErrorDocument 402 http://www.example.com/subscription_info.html
232
+ #
233
+
234
+ #
235
+ # Putting this all together, we can internationalize error responses.
236
+ #
237
+ # We use Alias to redirect any /error/HTTP_<error>.html.var response to
238
+ # our collection of by-error message multi-language collections. We use
239
+ # includes to substitute the appropriate text.
240
+ #
241
+ # You can modify the messages' appearance without changing any of the
242
+ # default HTTP_<error>.html.var files by adding the line:
243
+ #
244
+ # Alias /error/include/ "/your/include/path/"
245
+ #
246
+ # which allows you to create your own set of files by starting with the
247
+ # /usr/share/apache2/error/include/ files and copying them to /your/include/path/,
248
+ # even on a per-VirtualHost basis. The default include files will display
249
+ # your Apache version number and your ServerAdmin email address regardless
250
+ # of the setting of ServerSignature.
251
+ #
252
+ # The internationalized error documents require mod_alias, mod_include
253
+ # and mod_negotiation. To activate them, uncomment the following 30 lines.
254
+
255
+ # Alias /error/ "/usr/share/apache2/error/"
256
+ #
257
+ # <Directory "/usr/share/apache2/error">
258
+ # AllowOverride None
259
+ # Options IncludesNoExec
260
+ # AddOutputFilter Includes html
261
+ # AddHandler type-map var
262
+ # Order allow,deny
263
+ # Allow from all
264
+ # LanguagePriority en cs de es fr it nl sv pt-br ro
265
+ # ForceLanguagePriority Prefer Fallback
266
+ # </Directory>
267
+ #
268
+ # ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
269
+ # ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
270
+ # ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
271
+ # ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
272
+ # ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
273
+ # ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
274
+ # ErrorDocument 410 /error/HTTP_GONE.html.var
275
+ # ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
276
+ # ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
277
+ # ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
278
+ # ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
279
+ # ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
280
+ # ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
281
+ # ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
282
+ # ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
283
+ # ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
284
+ # ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
285
+
286
+
287
+
288
+ # Include of directories ignores editors' and dpkg's backup files,
289
+ # see README.Debian for details.
290
+
291
+ # Include generic snippets of statements
292
+ Include /etc/apache2/conf.d/
293
+
294
+ # Include the virtual host configurations:
295
+ Include /etc/apache2/sites-enabled/
@@ -0,0 +1,7 @@
1
+ # Based on http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/
2
+
3
+ <Proxy balancer://mongrel_cluster>
4
+ Include /etc/ec2onrails/balancer_members
5
+ SetEnv force-proxy-request-1.0 1
6
+ SetEnv proxy-nokeepalive 1
7
+ </Proxy>
@@ -0,0 +1,10 @@
1
+ # Based on http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/
2
+
3
+ Listen 8080
4
+ <VirtualHost *:8080>
5
+ <Location />
6
+ SetHandler balancer-manager
7
+ Deny from all
8
+ Allow from localhost
9
+ </Location>
10
+ </VirtualHost>
@@ -0,0 +1,18 @@
1
+ <IfModule mod_proxy.c>
2
+ #turning ProxyRequests on and allowing proxying from all may allow
3
+ #spammers to use your proxy to send email.
4
+
5
+ ProxyRequests Off
6
+
7
+ <Proxy *>
8
+ AddDefaultCharset off
9
+ Order deny,allow
10
+ Allow from all
11
+ </Proxy>
12
+
13
+ # Enable/disable the handling of HTTP/1.1 "Via:" headers.
14
+ # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
15
+ # Set to one of: Off | On | Full | Block
16
+
17
+ ProxyVia Off
18
+ </IfModule>
@@ -0,0 +1,56 @@
1
+ ServerSignature Off
2
+
3
+ <Directory />
4
+ Options FollowSymLinks
5
+ AllowOverride None
6
+ </Directory>
7
+
8
+ DocumentRoot /mnt/app/current/public
9
+
10
+ <Directory "/mnt/app/current/public">
11
+ Options FollowSymLinks
12
+ AllowOverride None
13
+ Order allow,deny
14
+ Allow from all
15
+ </Directory>
16
+
17
+ # Disallow browsing of Subversion working copy administrative dirs.
18
+ <DirectoryMatch "^/.*/\.svn/">
19
+ Order allow,deny
20
+ Deny from all
21
+ </DirectoryMatch>
22
+
23
+ RewriteEngine On
24
+
25
+ # Uncomment for rewrite debugging
26
+ #RewriteLog /mnt/log/apache2/app_rewrite_log
27
+ #RewriteLogLevel 9
28
+
29
+ # Check for maintenance file and redirect all requests
30
+ RewriteCond %{REQUEST_URI} !\.(png|jpg|jpeg|gif|css)$
31
+ RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
32
+ RewriteCond %{SCRIPT_FILENAME} !maintenance.html
33
+ RewriteRule ^.*$ /system/maintenance.html [L]
34
+
35
+ # Rewrite index to check for static
36
+ RewriteRule ^/$ /index.html [QSA]
37
+
38
+ # Rewrite to check for Rails cached page
39
+ RewriteRule ^([^.]+)$ $1.html [QSA]
40
+
41
+ # Redirect all non-static requests to cluster
42
+ RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
43
+ RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L]
44
+
45
+ # Deflate
46
+ AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css
47
+ BrowserMatch ^Mozilla/4 gzip-only-text/html
48
+ BrowserMatch ^Mozilla/4.0[678] no-gzip
49
+ BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
50
+
51
+ # Uncomment for deflate debugging
52
+ #DeflateFilterNote Input input_info
53
+ #DeflateFilterNote Output output_info
54
+ #DeflateFilterNote Ratio ratio_info
55
+ #LogFormat '"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)' deflate
56
+ #CustomLog logs/myapp_deflate_log deflate