mongrel 1.1.5-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +4 -0
- data/CHANGELOG +18 -0
- data/COPYING +55 -0
- data/LICENSE +55 -0
- data/Manifest +69 -0
- data/README +74 -0
- data/TODO +5 -0
- data/bin/mongrel_rails +283 -0
- data/examples/builder.rb +29 -0
- data/examples/camping/README +3 -0
- data/examples/camping/blog.rb +294 -0
- data/examples/camping/tepee.rb +149 -0
- data/examples/httpd.conf +474 -0
- data/examples/mime.yaml +3 -0
- data/examples/mongrel.conf +9 -0
- data/examples/mongrel_simple_ctrl.rb +92 -0
- data/examples/mongrel_simple_service.rb +116 -0
- data/examples/monitrc +57 -0
- data/examples/random_thrash.rb +19 -0
- data/examples/simpletest.rb +52 -0
- data/examples/webrick_compare.rb +20 -0
- data/ext/http11/ext_help.h +14 -0
- data/ext/http11/extconf.rb +6 -0
- data/ext/http11/http11.c +402 -0
- data/ext/http11/http11_parser.c +1221 -0
- data/ext/http11/http11_parser.h +49 -0
- data/ext/http11/http11_parser.java.rl +170 -0
- data/ext/http11/http11_parser.rl +152 -0
- data/ext/http11/http11_parser_common.rl +54 -0
- data/ext/http11_java/Http11Service.java +13 -0
- data/ext/http11_java/org/jruby/mongrel/Http11.java +266 -0
- data/ext/http11_java/org/jruby/mongrel/Http11Parser.java +572 -0
- data/lib/http11.so +0 -0
- data/lib/mongrel.rb +355 -0
- data/lib/mongrel/camping.rb +107 -0
- data/lib/mongrel/cgi.rb +181 -0
- data/lib/mongrel/command.rb +222 -0
- data/lib/mongrel/configurator.rb +388 -0
- data/lib/mongrel/const.rb +110 -0
- data/lib/mongrel/debug.rb +203 -0
- data/lib/mongrel/gems.rb +22 -0
- data/lib/mongrel/handlers.rb +468 -0
- data/lib/mongrel/header_out.rb +28 -0
- data/lib/mongrel/http_request.rb +155 -0
- data/lib/mongrel/http_response.rb +163 -0
- data/lib/mongrel/init.rb +10 -0
- data/lib/mongrel/mime_types.yml +616 -0
- data/lib/mongrel/rails.rb +185 -0
- data/lib/mongrel/stats.rb +89 -0
- data/lib/mongrel/tcphack.rb +18 -0
- data/lib/mongrel/uri_classifier.rb +76 -0
- data/mongrel-public_cert.pem +20 -0
- data/mongrel.gemspec +242 -0
- data/setup.rb +1585 -0
- data/test/mime.yaml +3 -0
- data/test/mongrel.conf +1 -0
- data/test/test_cgi_wrapper.rb +26 -0
- data/test/test_command.rb +86 -0
- data/test/test_conditional.rb +107 -0
- data/test/test_configurator.rb +88 -0
- data/test/test_debug.rb +25 -0
- data/test/test_handlers.rb +126 -0
- data/test/test_http11.rb +156 -0
- data/test/test_redirect_handler.rb +45 -0
- data/test/test_request_progress.rb +100 -0
- data/test/test_response.rb +127 -0
- data/test/test_stats.rb +35 -0
- data/test/test_uriclassifier.rb +261 -0
- data/test/test_ws.rb +115 -0
- data/test/testhelp.rb +79 -0
- data/tools/trickletest.rb +45 -0
- metadata +197 -0
- metadata.gz.sig +1 -0
data/examples/httpd.conf
ADDED
@@ -0,0 +1,474 @@
|
|
1
|
+
#
|
2
|
+
# This is the main Apache HTTP server configuration file. It contains the
|
3
|
+
# configuration directives that give the server its instructions.
|
4
|
+
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
|
5
|
+
# In particular, see
|
6
|
+
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
|
7
|
+
# for a discussion of each configuration directive.
|
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
|
+
# Configuration and logfile names: If the filenames you specify for many
|
14
|
+
# of the server's control files begin with "/" (or "drive:/" for Win32), the
|
15
|
+
# server will use that explicit path. If the filenames do *not* begin
|
16
|
+
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
|
17
|
+
# with ServerRoot set to "/usr/local/apache2" will be interpreted by the
|
18
|
+
# server as "/usr/local/apache2/logs/foo.log".
|
19
|
+
|
20
|
+
#
|
21
|
+
# ServerRoot: The top of the directory tree under which the server's
|
22
|
+
# configuration, error, and log files are kept.
|
23
|
+
#
|
24
|
+
# Do not add a slash at the end of the directory path. If you point
|
25
|
+
# ServerRoot at a non-local disk, be sure to point the LockFile directive
|
26
|
+
# at a local disk. If you wish to share the same ServerRoot for multiple
|
27
|
+
# httpd daemons, you will need to change at least LockFile and PidFile.
|
28
|
+
#
|
29
|
+
ServerRoot "/usr/local/apache2"
|
30
|
+
|
31
|
+
#
|
32
|
+
# Listen: Allows you to bind Apache to specific IP addresses and/or
|
33
|
+
# ports, instead of the default. See also the <VirtualHost>
|
34
|
+
# directive.
|
35
|
+
#
|
36
|
+
# Change this to Listen on specific IP addresses as shown below to
|
37
|
+
# prevent Apache from glomming onto all bound IP addresses.
|
38
|
+
#
|
39
|
+
#Listen 12.34.56.78:80
|
40
|
+
Listen 8088
|
41
|
+
|
42
|
+
#
|
43
|
+
# Dynamic Shared Object (DSO) Support
|
44
|
+
#
|
45
|
+
# To be able to use the functionality of a module which was built as a DSO you
|
46
|
+
# have to place corresponding `LoadModule' lines at this location so the
|
47
|
+
# directives contained in it are actually available _before_ they are used.
|
48
|
+
# Statically compiled modules (those listed by `httpd -l') do not need
|
49
|
+
# to be loaded here.
|
50
|
+
#
|
51
|
+
# Example:
|
52
|
+
# LoadModule foo_module modules/mod_foo.so
|
53
|
+
#
|
54
|
+
|
55
|
+
LoadModule deflate_module modules/mod_deflate.so
|
56
|
+
LoadModule expires_module modules/mod_expires.so
|
57
|
+
LoadModule headers_module modules/mod_headers.so
|
58
|
+
LoadModule mime_magic_module modules/mod_mime_magic.so
|
59
|
+
LoadModule proxy_module modules/mod_proxy.so
|
60
|
+
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
|
61
|
+
LoadModule proxy_http_module modules/mod_proxy_http.so
|
62
|
+
LoadModule rewrite_module modules/mod_rewrite.so
|
63
|
+
LoadModule version_module modules/mod_version.so
|
64
|
+
LoadModule vhost_alias_module modules/mod_vhost_alias.so
|
65
|
+
|
66
|
+
<IfModule !mpm_netware_module>
|
67
|
+
#
|
68
|
+
# If you wish httpd to run as a different user or group, you must run
|
69
|
+
# httpd as root initially and it will switch.
|
70
|
+
#
|
71
|
+
# User/Group: The name (or #number) of the user/group to run httpd as.
|
72
|
+
# It is usually good practice to create a dedicated user and group for
|
73
|
+
# running httpd, as with most system services.
|
74
|
+
#
|
75
|
+
User www-data
|
76
|
+
Group www-data
|
77
|
+
</IfModule>
|
78
|
+
|
79
|
+
# 'Main' server configuration
|
80
|
+
#
|
81
|
+
# The directives in this section set up the values used by the 'main'
|
82
|
+
# server, which responds to any requests that aren't handled by a
|
83
|
+
# <VirtualHost> definition. These values also provide defaults for
|
84
|
+
# any <VirtualHost> containers you may define later in the file.
|
85
|
+
#
|
86
|
+
# All of these directives may appear inside <VirtualHost> containers,
|
87
|
+
# in which case these default settings will be overridden for the
|
88
|
+
# virtual host being defined.
|
89
|
+
#
|
90
|
+
|
91
|
+
#
|
92
|
+
# ServerAdmin: Your address, where problems with the server should be
|
93
|
+
# e-mailed. This address appears on some server-generated pages, such
|
94
|
+
# as error documents. e.g. admin@your-domain.com
|
95
|
+
#
|
96
|
+
ServerAdmin admin@SERVER
|
97
|
+
|
98
|
+
#
|
99
|
+
# ServerName gives the name and port that the server uses to identify itself.
|
100
|
+
# This can often be determined automatically, but we recommend you specify
|
101
|
+
# it explicitly to prevent problems during startup.
|
102
|
+
#
|
103
|
+
# If your host doesn't have a registered DNS name, enter its IP address here.
|
104
|
+
#
|
105
|
+
ServerName SERVER:8088
|
106
|
+
|
107
|
+
#
|
108
|
+
# DocumentRoot: The directory out of which you will serve your
|
109
|
+
# documents. By default, all requests are taken from this directory, but
|
110
|
+
# symbolic links and aliases may be used to point to other locations.
|
111
|
+
#
|
112
|
+
DocumentRoot "/usr/local/apache2/htdocs"
|
113
|
+
|
114
|
+
#
|
115
|
+
# Each directory to which Apache has access can be configured with respect
|
116
|
+
# to which services and features are allowed and/or disabled in that
|
117
|
+
# directory (and its subdirectories).
|
118
|
+
#
|
119
|
+
# First, we configure the "default" to be a very restrictive set of
|
120
|
+
# features.
|
121
|
+
#
|
122
|
+
<Directory />
|
123
|
+
Options FollowSymLinks
|
124
|
+
AllowOverride None
|
125
|
+
Order deny,allow
|
126
|
+
Deny from all
|
127
|
+
</Directory>
|
128
|
+
|
129
|
+
#
|
130
|
+
# Note that from this point forward you must specifically allow
|
131
|
+
# particular features to be enabled - so if something's not working as
|
132
|
+
# you might expect, make sure that you have specifically enabled it
|
133
|
+
# below.
|
134
|
+
#
|
135
|
+
|
136
|
+
#
|
137
|
+
# This should be changed to whatever you set DocumentRoot to.
|
138
|
+
#
|
139
|
+
<Directory "/usr/local/apache2/htdocs">
|
140
|
+
#
|
141
|
+
# Possible values for the Options directive are "None", "All",
|
142
|
+
# or any combination of:
|
143
|
+
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
|
144
|
+
#
|
145
|
+
# Note that "MultiViews" must be named *explicitly* --- "Options All"
|
146
|
+
# doesn't give it to you.
|
147
|
+
#
|
148
|
+
# The Options directive is both complicated and important. Please see
|
149
|
+
# http://httpd.apache.org/docs/2.2/mod/core.html#options
|
150
|
+
# for more information.
|
151
|
+
#
|
152
|
+
Options Indexes FollowSymLinks
|
153
|
+
|
154
|
+
#
|
155
|
+
# AllowOverride controls what directives may be placed in .htaccess files.
|
156
|
+
# It can be "All", "None", or any combination of the keywords:
|
157
|
+
# Options FileInfo AuthConfig Limit
|
158
|
+
#
|
159
|
+
AllowOverride None
|
160
|
+
|
161
|
+
#
|
162
|
+
# Controls who can get stuff from this server.
|
163
|
+
#
|
164
|
+
Order allow,deny
|
165
|
+
Allow from all
|
166
|
+
|
167
|
+
</Directory>
|
168
|
+
|
169
|
+
#
|
170
|
+
# DirectoryIndex: sets the file that Apache will serve if a directory
|
171
|
+
# is requested.
|
172
|
+
#
|
173
|
+
<IfModule dir_module>
|
174
|
+
DirectoryIndex index.html
|
175
|
+
</IfModule>
|
176
|
+
|
177
|
+
#
|
178
|
+
# The following lines prevent .htaccess and .htpasswd files from being
|
179
|
+
# viewed by Web clients.
|
180
|
+
#
|
181
|
+
<FilesMatch "^\.ht">
|
182
|
+
Order allow,deny
|
183
|
+
Deny from all
|
184
|
+
Satisfy All
|
185
|
+
</FilesMatch>
|
186
|
+
|
187
|
+
#
|
188
|
+
# ErrorLog: The location of the error log file.
|
189
|
+
# If you do not specify an ErrorLog directive within a <VirtualHost>
|
190
|
+
# container, error messages relating to that virtual host will be
|
191
|
+
# logged here. If you *do* define an error logfile for a <VirtualHost>
|
192
|
+
# container, that host's errors will be logged there and not here.
|
193
|
+
#
|
194
|
+
ErrorLog logs/error_log
|
195
|
+
|
196
|
+
#
|
197
|
+
# LogLevel: Control the number of messages logged to the error_log.
|
198
|
+
# Possible values include: debug, info, notice, warn, error, crit,
|
199
|
+
# alert, emerg.
|
200
|
+
#
|
201
|
+
LogLevel warn
|
202
|
+
|
203
|
+
<IfModule log_config_module>
|
204
|
+
#
|
205
|
+
# The following directives define some format nicknames for use with
|
206
|
+
# a CustomLog directive (see below).
|
207
|
+
#
|
208
|
+
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
|
209
|
+
LogFormat "%h %l %u %t \"%r\" %>s %b" common
|
210
|
+
|
211
|
+
<IfModule logio_module>
|
212
|
+
# You need to enable mod_logio.c to use %I and %O
|
213
|
+
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
|
214
|
+
</IfModule>
|
215
|
+
|
216
|
+
#
|
217
|
+
# The location and format of the access logfile (Common Logfile Format).
|
218
|
+
# If you do not define any access logfiles within a <VirtualHost>
|
219
|
+
# container, they will be logged here. Contrariwise, if you *do*
|
220
|
+
# define per-<VirtualHost> access logfiles, transactions will be
|
221
|
+
# logged therein and *not* in this file.
|
222
|
+
#
|
223
|
+
CustomLog logs/access_log common
|
224
|
+
|
225
|
+
#
|
226
|
+
# If you prefer a logfile with access, agent, and referer information
|
227
|
+
# (Combined Logfile Format) you can use the following directive.
|
228
|
+
#
|
229
|
+
#CustomLog logs/access_log combined
|
230
|
+
</IfModule>
|
231
|
+
|
232
|
+
<IfModule alias_module>
|
233
|
+
#
|
234
|
+
# Redirect: Allows you to tell clients about documents that used to
|
235
|
+
# exist in your server's namespace, but do not anymore. The client
|
236
|
+
# will make a new request for the document at its new location.
|
237
|
+
# Example:
|
238
|
+
# Redirect permanent /foo http://www.example.com/bar
|
239
|
+
|
240
|
+
#
|
241
|
+
# Alias: Maps web paths into filesystem paths and is used to
|
242
|
+
# access content that does not live under the DocumentRoot.
|
243
|
+
# Example:
|
244
|
+
# Alias /webpath /full/filesystem/path
|
245
|
+
#
|
246
|
+
# If you include a trailing / on /webpath then the server will
|
247
|
+
# require it to be present in the URL. You will also likely
|
248
|
+
# need to provide a <Directory> section to allow access to
|
249
|
+
# the filesystem path.
|
250
|
+
|
251
|
+
#
|
252
|
+
# ScriptAlias: This controls which directories contain server scripts.
|
253
|
+
# ScriptAliases are essentially the same as Aliases, except that
|
254
|
+
# documents in the target directory are treated as applications and
|
255
|
+
# run by the server when requested rather than as documents sent to the
|
256
|
+
# client. The same rules about trailing "/" apply to ScriptAlias
|
257
|
+
# directives as to Alias.
|
258
|
+
#
|
259
|
+
ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"
|
260
|
+
|
261
|
+
</IfModule>
|
262
|
+
|
263
|
+
<IfModule cgid_module>
|
264
|
+
#
|
265
|
+
# ScriptSock: On threaded servers, designate the path to the UNIX
|
266
|
+
# socket used to communicate with the CGI daemon of mod_cgid.
|
267
|
+
#
|
268
|
+
#Scriptsock logs/cgisock
|
269
|
+
</IfModule>
|
270
|
+
|
271
|
+
#
|
272
|
+
# "/usr/local/apache2/cgi-bin" should be changed to whatever your ScriptAliased
|
273
|
+
# CGI directory exists, if you have that configured.
|
274
|
+
#
|
275
|
+
<Directory "/usr/local/apache2/cgi-bin">
|
276
|
+
AllowOverride None
|
277
|
+
Options None
|
278
|
+
Order allow,deny
|
279
|
+
Allow from all
|
280
|
+
</Directory>
|
281
|
+
|
282
|
+
#
|
283
|
+
# DefaultType: the default MIME type the server will use for a document
|
284
|
+
# if it cannot otherwise determine one, such as from filename extensions.
|
285
|
+
# If your server contains mostly text or HTML documents, "text/plain" is
|
286
|
+
# a good value. If most of your content is binary, such as applications
|
287
|
+
# or images, you may want to use "application/octet-stream" instead to
|
288
|
+
# keep browsers from trying to display binary files as though they are
|
289
|
+
# text.
|
290
|
+
#
|
291
|
+
DefaultType text/plain
|
292
|
+
|
293
|
+
<IfModule mime_module>
|
294
|
+
#
|
295
|
+
# TypesConfig points to the file containing the list of mappings from
|
296
|
+
# filename extension to MIME-type.
|
297
|
+
#
|
298
|
+
TypesConfig conf/mime.types
|
299
|
+
|
300
|
+
#
|
301
|
+
# AddType allows you to add to or override the MIME configuration
|
302
|
+
# file specified in TypesConfig for specific file types.
|
303
|
+
#
|
304
|
+
#AddType application/x-gzip .tgz
|
305
|
+
#
|
306
|
+
# AddEncoding allows you to have certain browsers uncompress
|
307
|
+
# information on the fly. Note: Not all browsers support this.
|
308
|
+
#
|
309
|
+
#AddEncoding x-compress .Z
|
310
|
+
#AddEncoding x-gzip .gz .tgz
|
311
|
+
#
|
312
|
+
# If the AddEncoding directives above are commented-out, then you
|
313
|
+
# probably should define those extensions to indicate media types:
|
314
|
+
#
|
315
|
+
AddType application/x-compress .Z
|
316
|
+
AddType application/x-gzip .gz .tgz
|
317
|
+
|
318
|
+
#
|
319
|
+
# AddHandler allows you to map certain file extensions to "handlers":
|
320
|
+
# actions unrelated to filetype. These can be either built into the server
|
321
|
+
# or added with the Action directive (see below)
|
322
|
+
#
|
323
|
+
# To use CGI scripts outside of ScriptAliased directories:
|
324
|
+
# (You will also need to add "ExecCGI" to the "Options" directive.)
|
325
|
+
#
|
326
|
+
#AddHandler cgi-script .cgi
|
327
|
+
|
328
|
+
# For type maps (negotiated resources):
|
329
|
+
#AddHandler type-map var
|
330
|
+
|
331
|
+
#
|
332
|
+
# Filters allow you to process content before it is sent to the client.
|
333
|
+
#
|
334
|
+
# To parse .shtml files for server-side includes (SSI):
|
335
|
+
# (You will also need to add "Includes" to the "Options" directive.)
|
336
|
+
#
|
337
|
+
#AddType text/html .shtml
|
338
|
+
#AddOutputFilter INCLUDES .shtml
|
339
|
+
</IfModule>
|
340
|
+
|
341
|
+
#
|
342
|
+
# The mod_mime_magic module allows the server to use various hints from the
|
343
|
+
# contents of the file itself to determine its type. The MIMEMagicFile
|
344
|
+
# directive tells the module where the hint definitions are located.
|
345
|
+
#
|
346
|
+
#MIMEMagicFile conf/magic
|
347
|
+
|
348
|
+
#
|
349
|
+
# Customizable error responses come in three flavors:
|
350
|
+
# 1) plain text 2) local redirects 3) external redirects
|
351
|
+
#
|
352
|
+
# Some examples:
|
353
|
+
#ErrorDocument 500 "The server made a boo boo."
|
354
|
+
#ErrorDocument 404 /missing.html
|
355
|
+
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
|
356
|
+
#ErrorDocument 402 http://www.example.com/subscription_info.html
|
357
|
+
#
|
358
|
+
|
359
|
+
#
|
360
|
+
# EnableMMAP and EnableSendfile: On systems that support it,
|
361
|
+
# memory-mapping or the sendfile syscall is used to deliver
|
362
|
+
# files. This usually improves server performance, but must
|
363
|
+
# be turned off when serving from networked-mounted
|
364
|
+
# filesystems or if support for these functions is otherwise
|
365
|
+
# broken on your system.
|
366
|
+
#
|
367
|
+
#EnableMMAP off
|
368
|
+
EnableSendfile on
|
369
|
+
|
370
|
+
# Supplemental configuration
|
371
|
+
#
|
372
|
+
# The configuration files in the conf/extra/ directory can be
|
373
|
+
# included to add extra features or to modify the default configuration of
|
374
|
+
# the server, or you may simply copy their contents here and change as
|
375
|
+
# necessary.
|
376
|
+
|
377
|
+
# Server-pool management (MPM specific)
|
378
|
+
#Include conf/extra/httpd-mpm.conf
|
379
|
+
|
380
|
+
# Multi-language error messages
|
381
|
+
#Include conf/extra/httpd-multilang-errordoc.conf
|
382
|
+
|
383
|
+
# Fancy directory listings
|
384
|
+
#Include conf/extra/httpd-autoindex.conf
|
385
|
+
|
386
|
+
# Language settings
|
387
|
+
#Include conf/extra/httpd-languages.conf
|
388
|
+
|
389
|
+
# User home directories
|
390
|
+
#Include conf/extra/httpd-userdir.conf
|
391
|
+
|
392
|
+
# Real-time info on requests and configuration
|
393
|
+
#Include conf/extra/httpd-info.conf
|
394
|
+
|
395
|
+
# Virtual hosts
|
396
|
+
#Include conf/extra/httpd-vhosts.conf
|
397
|
+
|
398
|
+
# Local access to the Apache HTTP Server Manual
|
399
|
+
#Include conf/extra/httpd-manual.conf
|
400
|
+
|
401
|
+
# Distributed authoring and versioning (WebDAV)
|
402
|
+
#Include conf/extra/httpd-dav.conf
|
403
|
+
|
404
|
+
# Various default settings
|
405
|
+
#Include conf/extra/httpd-default.conf
|
406
|
+
|
407
|
+
# Secure (SSL/TLS) connections
|
408
|
+
#Include conf/extra/httpd-ssl.conf
|
409
|
+
#
|
410
|
+
# Note: The following must must be present to support
|
411
|
+
# starting without SSL on platforms with no /dev/random equivalent
|
412
|
+
# but a statically compiled-in mod_ssl.
|
413
|
+
#
|
414
|
+
<IfModule ssl_module>
|
415
|
+
SSLRandomSeed startup builtin
|
416
|
+
SSLRandomSeed connect builtin
|
417
|
+
</IfModule>
|
418
|
+
|
419
|
+
<VirtualHost *:8088>
|
420
|
+
ServerName SERVER
|
421
|
+
DocumentRoot /var/rails/MYAPP/public
|
422
|
+
|
423
|
+
<Directory "/var/rails/MYAPP/public">
|
424
|
+
Options FollowSymLinks
|
425
|
+
AllowOverride None
|
426
|
+
Order allow,deny
|
427
|
+
Allow from all
|
428
|
+
</Directory>
|
429
|
+
|
430
|
+
# Configure mongrel_cluster
|
431
|
+
<Proxy balancer://mongrel_cluster>
|
432
|
+
BalancerMember http://127.0.0.1:8000
|
433
|
+
BalancerMember http://127.0.0.1:8001
|
434
|
+
</Proxy>
|
435
|
+
|
436
|
+
RewriteEngine On
|
437
|
+
|
438
|
+
# Uncomment for rewrite debugging
|
439
|
+
#RewriteLog logs/your_app_rewrite_log
|
440
|
+
#RewriteLogLevel 9
|
441
|
+
|
442
|
+
# Check for maintenance file and redirect all requests
|
443
|
+
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
|
444
|
+
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
|
445
|
+
RewriteRule ^.*$ /system/maintenance.html [L]
|
446
|
+
|
447
|
+
# Rewrite index to check for static
|
448
|
+
RewriteRule ^/$ /index.html [QSA]
|
449
|
+
|
450
|
+
# Rewrite to check for Rails cached page
|
451
|
+
RewriteRule ^([^.]+)$ $1.html [QSA]
|
452
|
+
|
453
|
+
# Redirect all non-static requests to cluster
|
454
|
+
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
|
455
|
+
RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L]
|
456
|
+
|
457
|
+
# Deflate
|
458
|
+
AddOutputFilterByType DEFLATE text/html text/plain text/xml
|
459
|
+
BrowserMatch ^Mozilla/4 gzip-only-text/html
|
460
|
+
BrowserMatch ^Mozilla/4\.0[678] no-gzip
|
461
|
+
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
|
462
|
+
|
463
|
+
# Uncomment for deflate debugging
|
464
|
+
#DeflateFilterNote Input input_info
|
465
|
+
#DeflateFilterNote Output output_info
|
466
|
+
#DeflateFilterNote Ratio ratio_info
|
467
|
+
#LogFormat '"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)' deflate
|
468
|
+
#CustomLog logs/your_app_deflate_log deflate
|
469
|
+
|
470
|
+
ErrorLog logs/your_app_error_log
|
471
|
+
CustomLog logs/your_access_log combined
|
472
|
+
</VirtualHost>
|
473
|
+
|
474
|
+
|