ScholarNexus-ec2onrails 0.9.10
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +180 -0
- data/COPYING +339 -0
- data/Manifest +167 -0
- data/README.textile +211 -0
- data/Rakefile +37 -0
- data/TODO +104 -0
- data/ec2onrails.gemspec +42 -0
- data/examples/Capfile +3 -0
- data/examples/deploy.rb +107 -0
- data/examples/s3.yml +9 -0
- data/lib/ec2onrails/capistrano_utils.rb +43 -0
- data/lib/ec2onrails/recipes/db.rb +359 -0
- data/lib/ec2onrails/recipes/deploy.rb +30 -0
- data/lib/ec2onrails/recipes/server.rb +489 -0
- data/lib/ec2onrails/recipes.rb +141 -0
- data/lib/ec2onrails/version.rb +31 -0
- data/lib/ec2onrails.rb +20 -0
- data/server/build-ec2onrails.sh +44 -0
- data/server/files/etc/aliases +5 -0
- data/server/files/etc/aliases.db +0 -0
- data/server/files/etc/apache2/apache2.conf +295 -0
- data/server/files/etc/apache2/conf.d/app.proxy_cluster.conf +7 -0
- data/server/files/etc/apache2/conf.d/app.proxy_frontend.conf +10 -0
- data/server/files/etc/apache2/mods-available/proxy.conf +18 -0
- data/server/files/etc/apache2/sites-available/app.common +61 -0
- data/server/files/etc/apache2/sites-available/app.custom +0 -0
- data/server/files/etc/apache2/sites-available/default +14 -0
- data/server/files/etc/apache2/sites-available/default-ssl +19 -0
- data/server/files/etc/cron.d/ec2onrails +21 -0
- data/server/files/etc/cron.daily/app +24 -0
- data/server/files/etc/cron.daily/logrotate_post +19 -0
- data/server/files/etc/cron.hourly/app +24 -0
- data/server/files/etc/cron.monthly/app +24 -0
- data/server/files/etc/cron.weekly/app +24 -0
- data/server/files/etc/denyhosts.conf +628 -0
- data/server/files/etc/dpkg/dpkg.cfg +13 -0
- data/server/files/etc/ec2onrails/README +32 -0
- data/server/files/etc/ec2onrails/balancer_members +6 -0
- data/server/files/etc/ec2onrails/roles.yml +5 -0
- data/server/files/etc/environment +2 -0
- data/server/files/etc/god/app.god +40 -0
- data/server/files/etc/god/db.god +17 -0
- data/server/files/etc/god/dkim_filter.god +20 -0
- data/server/files/etc/god/examples/have_god_daemonize.god +18 -0
- data/server/files/etc/god/master.conf +35 -0
- data/server/files/etc/god/memcache.god +15 -0
- data/server/files/etc/god/notifications.god +14 -0
- data/server/files/etc/god/system.god +34 -0
- data/server/files/etc/god/web.god +38 -0
- data/server/files/etc/init.d/ec2-every-startup +29 -0
- data/server/files/etc/init.d/ec2-first-startup +36 -0
- data/server/files/etc/init.d/god +42 -0
- data/server/files/etc/init.d/nginx +78 -0
- data/server/files/etc/init.d/set_roles +3 -0
- data/server/files/etc/logrotate.d/apache2 +16 -0
- data/server/files/etc/logrotate.d/mongrel +11 -0
- data/server/files/etc/logrotate.d/nginx +11 -0
- data/server/files/etc/memcached.conf +47 -0
- data/server/files/etc/mongrel_cluster/app.yml +9 -0
- data/server/files/etc/motd.tail +13 -0
- data/server/files/etc/mysql/my.cnf +152 -0
- data/server/files/etc/nginx/nginx.conf +305 -0
- data/server/files/etc/postfix/main.cf +4 -0
- data/server/files/etc/rcS.d/S91ec2-first-startup +1 -0
- data/server/files/etc/rcS.d/S92ec2-every-startup +1 -0
- data/server/files/etc/rcS.d/S99set_roles +1 -0
- data/server/files/etc/ssh/sshd_config +94 -0
- data/server/files/etc/sudoers +1 -0
- data/server/files/etc/sudoers.full_access +26 -0
- data/server/files/etc/sudoers.restricted_access +28 -0
- data/server/files/etc/syslog.conf +69 -0
- data/server/files/usr/bin/god +26 -0
- data/server/files/usr/local/ec2onrails/COPYING +339 -0
- data/server/files/usr/local/ec2onrails/bin/archive_file.rb +44 -0
- data/server/files/usr/local/ec2onrails/bin/backup_app_db.rb +159 -0
- data/server/files/usr/local/ec2onrails/bin/ec2_meta_data.rb +80 -0
- data/server/files/usr/local/ec2onrails/bin/exec_runner +76 -0
- data/server/files/usr/local/ec2onrails/bin/init_services.rb +71 -0
- data/server/files/usr/local/ec2onrails/bin/optimize_mysql.rb +348 -0
- data/server/files/usr/local/ec2onrails/bin/rails_env +34 -0
- data/server/files/usr/local/ec2onrails/bin/rebundle.sh +70 -0
- data/server/files/usr/local/ec2onrails/bin/restore_app_db.rb +58 -0
- data/server/files/usr/local/ec2onrails/bin/set_rails_env +40 -0
- data/server/files/usr/local/ec2onrails/bin/set_roles.rb +87 -0
- data/server/files/usr/local/ec2onrails/bin/setup_web_proxy.rb +113 -0
- data/server/files/usr/local/ec2onrails/bin/update_hostname +40 -0
- data/server/files/usr/local/ec2onrails/config +30 -0
- data/server/files/usr/local/ec2onrails/lib/aws_helper.rb +76 -0
- data/server/files/usr/local/ec2onrails/lib/god_helper.rb +129 -0
- data/server/files/usr/local/ec2onrails/lib/god_patch.rb +43 -0
- data/server/files/usr/local/ec2onrails/lib/mysql_helper.rb +101 -0
- data/server/files/usr/local/ec2onrails/lib/roles_helper.rb +151 -0
- data/server/files/usr/local/ec2onrails/lib/s3_helper.rb +99 -0
- data/server/files/usr/local/ec2onrails/lib/utils.rb +16 -0
- data/server/files/usr/local/ec2onrails/lib/vendor/ini.rb +268 -0
- data/server/files/usr/local/ec2onrails/startup-scripts/every-startup/get-hostname.sh +23 -0
- data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/README +5 -0
- data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/create-dirs.sh +39 -0
- data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/generate-default-web-cert-and-key.sh +49 -0
- data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/misc.sh +27 -0
- data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/prepare-mysql-data-dir.sh +24 -0
- data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/setup-credentials.sh +29 -0
- data/server/files/usr/local/ec2onrails/startup-scripts/first-startup/setup-file-permissions.sh +30 -0
- data/server/rakefile.rb +249 -0
- data/setup.rb +1585 -0
- data/test/autobench.conf +60 -0
- data/test/spec/lib/s3_helper_spec.rb +134 -0
- data/test/spec/lib/s3_old.yml +3 -0
- data/test/spec/test_files/test1 +0 -0
- data/test/spec/test_files/test2 +0 -0
- data/test/test_app/Capfile +3 -0
- data/test/test_app/README +182 -0
- data/test/test_app/Rakefile +10 -0
- data/test/test_app/app/controllers/application.rb +7 -0
- data/test/test_app/app/controllers/db_fast_controller.rb +6 -0
- data/test/test_app/app/controllers/fast_controller.rb +5 -0
- data/test/test_app/app/controllers/slow_controller.rb +6 -0
- data/test/test_app/app/controllers/very_slow_controller.rb +6 -0
- data/test/test_app/app/helpers/application_helper.rb +3 -0
- data/test/test_app/app/helpers/db_fast_helper.rb +2 -0
- data/test/test_app/app/helpers/fast_helper.rb +2 -0
- data/test/test_app/app/helpers/slow_helper.rb +2 -0
- data/test/test_app/app/helpers/very_slow_helper.rb +2 -0
- data/test/test_app/config/boot.rb +109 -0
- data/test/test_app/config/database.yml +19 -0
- data/test/test_app/config/deploy.rb +21 -0
- data/test/test_app/config/environment.rb +60 -0
- data/test/test_app/config/environments/development.rb +21 -0
- data/test/test_app/config/environments/production.rb +18 -0
- data/test/test_app/config/environments/test.rb +19 -0
- data/test/test_app/config/routes.rb +27 -0
- data/test/test_app/db/schema.rb +7 -0
- data/test/test_app/doc/README_FOR_APP +2 -0
- data/test/test_app/public/404.html +30 -0
- data/test/test_app/public/500.html +30 -0
- data/test/test_app/public/dispatch.cgi +10 -0
- data/test/test_app/public/dispatch.fcgi +24 -0
- data/test/test_app/public/dispatch.rb +10 -0
- data/test/test_app/public/favicon.ico +0 -0
- data/test/test_app/public/images/rails.png +0 -0
- data/test/test_app/public/javascripts/application.js +2 -0
- data/test/test_app/public/javascripts/controls.js +963 -0
- data/test/test_app/public/javascripts/dragdrop.js +972 -0
- data/test/test_app/public/javascripts/effects.js +1120 -0
- data/test/test_app/public/javascripts/prototype.js +4225 -0
- data/test/test_app/public/robots.txt +1 -0
- data/test/test_app/script/about +3 -0
- data/test/test_app/script/breakpointer +3 -0
- data/test/test_app/script/console +3 -0
- data/test/test_app/script/destroy +3 -0
- data/test/test_app/script/generate +3 -0
- data/test/test_app/script/performance/benchmarker +3 -0
- data/test/test_app/script/performance/profiler +3 -0
- data/test/test_app/script/performance/request +3 -0
- data/test/test_app/script/plugin +3 -0
- data/test/test_app/script/process/inspector +3 -0
- data/test/test_app/script/process/reaper +3 -0
- data/test/test_app/script/process/spawner +3 -0
- data/test/test_app/script/runner +3 -0
- data/test/test_app/script/server +3 -0
- data/test/test_app/test/functional/db_fast_controller_test.rb +18 -0
- data/test/test_app/test/functional/fast_controller_test.rb +18 -0
- data/test/test_app/test/functional/slow_controller_test.rb +18 -0
- data/test/test_app/test/functional/very_slow_controller_test.rb +18 -0
- data/test/test_app/test/test_helper.rb +28 -0
- data/test/test_ec2onrails.rb +11 -0
- data/test/test_helper.rb +2 -0
- metadata +277 -0
@@ -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
|
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,61 @@
|
|
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 application/x-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
|
57
|
+
|
58
|
+
# Fix rails "IP spoofing attack?!" error
|
59
|
+
# see http://iprog.com/posting/2008/08/rails_500_error_ip_spoofing_attack
|
60
|
+
# see http://rails.lighthouseapp.com/projects/8994/tickets/322-don-t-return-500-if-client-ip-and-x-forwarded-for-agree
|
61
|
+
RequestHeader unset Client-IP
|
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Based on http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/
|
2
|
+
|
3
|
+
NameVirtualHost *:80
|
4
|
+
<VirtualHost *:80>
|
5
|
+
|
6
|
+
Include /etc/apache2/sites-available/app.custom
|
7
|
+
Include /etc/apache2/sites-available/app.common
|
8
|
+
|
9
|
+
ErrorLog /mnt/log/apache2/error.log
|
10
|
+
LogLevel warn
|
11
|
+
|
12
|
+
CustomLog /mnt/log/apache2/access.log combined
|
13
|
+
|
14
|
+
</VirtualHost>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Based on http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/
|
2
|
+
|
3
|
+
NameVirtualHost *:443
|
4
|
+
<VirtualHost *:443>
|
5
|
+
|
6
|
+
Include /etc/apache2/sites-available/app.custom
|
7
|
+
Include /etc/apache2/sites-available/app.common
|
8
|
+
|
9
|
+
ErrorLog /mnt/log/apache2/error.log
|
10
|
+
LogLevel warn
|
11
|
+
|
12
|
+
CustomLog /mnt/log/apache2/access.log combined
|
13
|
+
|
14
|
+
# see http://httpd.apache.org/docs/2.2/ssl/ssl_intro.html and http://httpd.apache.org/docs/2.2/mod/mod_ssl.html
|
15
|
+
SSLEngine On
|
16
|
+
SSLCertificateFile /etc/ec2onrails/ssl/cert/ec2onrails-default.crt
|
17
|
+
SSLCertificateKeyFile /etc/ec2onrails/ssl/private/ec2onrails-default.key
|
18
|
+
RequestHeader set X_FORWARDED_PROTO 'https'
|
19
|
+
</VirtualHost>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#
|
2
|
+
# different backup strategies depending on whether the db instance is using Amazon's EBS
|
3
|
+
#
|
4
|
+
|
5
|
+
# without EBS:
|
6
|
+
# Incremental backup every 5 minutes
|
7
|
+
*/5 * * * * root test ! -f /etc/mysql/conf.d/mysql-ec2-ebs.cnf && /usr/local/ec2onrails/bin/backup_app_db.rb --incremental
|
8
|
+
|
9
|
+
# without EBS:
|
10
|
+
# Full backup every day at 05:01, reset the binary logs.
|
11
|
+
# First kill any incremental backup that happens to be in progress
|
12
|
+
1 5 * * * root killall -q -u root backup_app_db.rb ; test ! -f /etc/mysql/conf.d/mysql-ec2-ebs.cnf && /usr/local/ec2onrails/bin/backup_app_db.rb --reset
|
13
|
+
|
14
|
+
# with EBS:
|
15
|
+
# Full snapshot every 2 hours
|
16
|
+
11 */2 * * * root test -f /etc/mysql/conf.d/mysql-ec2-ebs.cnf && /usr/local/ec2onrails/bin/backup_app_db.rb
|
17
|
+
|
18
|
+
|
19
|
+
# Check if the hostname has been updated every 15 minutes.
|
20
|
+
# This can happen if the user associated or disassociated an Elastic IP
|
21
|
+
12,27,42,57 * * * * root /usr/local/ec2onrails/bin/update_hostname
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
#NOTE: you can also call
|
4
|
+
# /usr/local/ec2onrails/bin/exec_runner
|
5
|
+
# to run a script under a specific role
|
6
|
+
# see the file for details
|
7
|
+
|
8
|
+
cd /mnt/app/current
|
9
|
+
|
10
|
+
if test -e /mnt/app/current/script/cron/daily; then
|
11
|
+
if test -f /mnt/app/current/script/cron/daily; then
|
12
|
+
sudo -u app /usr/local/ec2onrails/bin/rails_env script/cron/daily;
|
13
|
+
else
|
14
|
+
sudo -u app /usr/local/ec2onrails/bin/rails_env script/cron/daily/*;
|
15
|
+
fi
|
16
|
+
exit 0;
|
17
|
+
fi
|
18
|
+
|
19
|
+
#DEPRECATED: just for old usage....
|
20
|
+
if test -e /mnt/app/current/script/daily
|
21
|
+
then
|
22
|
+
sudo -u app /usr/local/ec2onrails/bin/rails_env script/daily
|
23
|
+
exit 0;
|
24
|
+
fi
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
RAILS_ENV=`/usr/local/ec2onrails/bin/rails_env`
|
4
|
+
|
5
|
+
if [ -x /mnt/app/current ] ; then
|
6
|
+
logfile=/mnt/app/current/log/$RAILS_ENV.log-`date +%Y%m%d`
|
7
|
+
if [ -e $logfile ] ; then
|
8
|
+
gzip $logfile
|
9
|
+
/usr/local/ec2onrails/bin/archive_file.rb --file $logfile.gz --dir logs/rails && rm $logfile.gz
|
10
|
+
fi
|
11
|
+
fi
|
12
|
+
|
13
|
+
for f in `ls /mnt/log/web_proxy/*.log` ; do
|
14
|
+
logfile=$f-`date +%Y%m%d`
|
15
|
+
if [ -e $logfile ] ; then
|
16
|
+
gzip $logfile
|
17
|
+
/usr/local/ec2onrails/bin/archive_file.rb --file $logfile.gz --dir logs/web_proxy && rm $logfile.gz
|
18
|
+
fi
|
19
|
+
done
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
#NOTE: you can also call
|
4
|
+
# /usr/local/ec2onrails/bin/exec_runner
|
5
|
+
# to run a script under a specific role
|
6
|
+
# see the file for details
|
7
|
+
|
8
|
+
cd /mnt/app/current
|
9
|
+
|
10
|
+
if test -e /mnt/app/current/script/cron/hourly; then
|
11
|
+
if test -f /mnt/app/current/script/cron/hourly; then
|
12
|
+
sudo -u app /usr/local/ec2onrails/bin/rails_env script/cron/hourly;
|
13
|
+
else
|
14
|
+
sudo -u app /usr/local/ec2onrails/bin/rails_env script/cron/hourly/*;
|
15
|
+
fi
|
16
|
+
exit 0;
|
17
|
+
fi
|
18
|
+
|
19
|
+
#DEPRECATED: just for old usage....
|
20
|
+
if test -e /mnt/app/current/script/hourly
|
21
|
+
then
|
22
|
+
sudo -u app /usr/local/ec2onrails/bin/rails_env script/hourly
|
23
|
+
exit 0;
|
24
|
+
fi
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
#NOTE: you can also call
|
4
|
+
# /usr/local/ec2onrails/bin/exec_runner
|
5
|
+
# to run a script under a specific role
|
6
|
+
# see the file for details
|
7
|
+
|
8
|
+
cd /mnt/app/current
|
9
|
+
|
10
|
+
if test -e /mnt/app/current/script/cron/monthly; then
|
11
|
+
if test -f /mnt/app/current/script/cron/monthly; then
|
12
|
+
sudo -u app /usr/local/ec2onrails/bin/rails_env script/cron/monthly;
|
13
|
+
else
|
14
|
+
sudo -u app /usr/local/ec2onrails/bin/rails_env script/cron/monthly/*;
|
15
|
+
fi
|
16
|
+
exit 0;
|
17
|
+
fi
|
18
|
+
|
19
|
+
#DEPRECATED: just for old usage....
|
20
|
+
if test -e /mnt/app/current/script/monthly
|
21
|
+
then
|
22
|
+
sudo -u app /usr/local/ec2onrails/bin/rails_env script/monthly
|
23
|
+
exit 0;
|
24
|
+
fi
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
#NOTE: you can also call
|
4
|
+
# /usr/local/ec2onrails/bin/exec_runner
|
5
|
+
# to run a script under a specific role
|
6
|
+
# see the file for details
|
7
|
+
|
8
|
+
cd /mnt/app/current
|
9
|
+
|
10
|
+
if test -e /mnt/app/current/script/cron/weekly; then
|
11
|
+
if test -f /mnt/app/current/script/cron/weekly; then
|
12
|
+
sudo -u app /usr/local/ec2onrails/bin/rails_env script/cron/weekly;
|
13
|
+
else
|
14
|
+
sudo -u app /usr/local/ec2onrails/bin/rails_env script/cron/weekly/*;
|
15
|
+
fi
|
16
|
+
exit 0;
|
17
|
+
fi
|
18
|
+
|
19
|
+
#DEPRECATED: just for old usage....
|
20
|
+
if test -e /mnt/app/current/script/weekly
|
21
|
+
then
|
22
|
+
sudo -u app /usr/local/ec2onrails/bin/rails_env script/weekly
|
23
|
+
exit 0;
|
24
|
+
fi
|