mongrel 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (263) hide show
  1. data.tar.gz.sig +2 -0
  2. data/CHANGELOG +2 -0
  3. data/Manifest +68 -0
  4. data/bin/mongrel_rails +55 -22
  5. data/examples/camping/README +3 -0
  6. data/examples/httpd.conf +474 -0
  7. data/examples/mime.yaml +3 -0
  8. data/examples/mongrel.conf +9 -0
  9. data/examples/monitrc +57 -0
  10. data/ext/http11/http11.c +25 -12
  11. data/ext/http11/http11_parser.c +456 -331
  12. data/ext/http11/http11_parser.h +1 -0
  13. data/ext/http11/http11_parser.java.rl +170 -0
  14. data/ext/http11/http11_parser.rl +8 -48
  15. data/ext/http11/http11_parser_common.rl +54 -0
  16. data/ext/http11/tst.h +2 -2
  17. data/ext/http11/tst_cleanup.c +0 -1
  18. data/ext/http11/tst_insert.c +29 -3
  19. data/ext/http11/tst_search.c +60 -55
  20. data/lib/mongrel.rb +68 -53
  21. data/lib/mongrel/cgi.rb +3 -3
  22. data/lib/mongrel/command.rb +1 -1
  23. data/lib/mongrel/configurator.rb +41 -31
  24. data/lib/mongrel/debug.rb +2 -5
  25. data/lib/mongrel/handlers.rb +23 -9
  26. data/lib/mongrel/mime_types.yml +2 -1
  27. data/lib/mongrel/rails.rb +7 -15
  28. data/mongrel-public_cert.pem +20 -0
  29. data/mongrel.gemspec +211 -0
  30. data/test/jruby_socket.rb +39 -0
  31. data/test/test_cgi_wrapper.rb +26 -0
  32. data/test/test_command.rb +1 -4
  33. data/test/test_conditional.rb +6 -18
  34. data/test/test_configurator.rb +5 -8
  35. data/test/test_debug.rb +3 -11
  36. data/test/test_handlers.rb +8 -10
  37. data/test/test_http11.rb +24 -5
  38. data/test/test_redirect_handler.rb +2 -6
  39. data/test/test_request_progress.rb +5 -9
  40. data/test/test_response.rb +24 -3
  41. data/test/test_stats.rb +1 -3
  42. data/test/test_uriclassifier.rb +170 -81
  43. data/test/test_ws.rb +25 -24
  44. data/test/testhelp.rb +26 -3
  45. data/tools/trickletest.rb +2 -2
  46. metadata +138 -333
  47. metadata.gz.sig +0 -0
  48. data/Rakefile +0 -117
  49. data/doc/rdoc/classes/IO.html +0 -170
  50. data/doc/rdoc/classes/IO.src/M000003.html +0 -19
  51. data/doc/rdoc/classes/IO.src/M000004.html +0 -19
  52. data/doc/rdoc/classes/Kernel.html +0 -159
  53. data/doc/rdoc/classes/Kernel.src/M000012.html +0 -19
  54. data/doc/rdoc/classes/Kernel.src/M000013.html +0 -23
  55. data/doc/rdoc/classes/Mongrel.html +0 -204
  56. data/doc/rdoc/classes/Mongrel/CGIWrapper.html +0 -404
  57. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000115.html +0 -25
  58. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000116.html +0 -47
  59. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000117.html +0 -34
  60. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000118.html +0 -32
  61. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000119.html +0 -25
  62. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000120.html +0 -18
  63. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000121.html +0 -18
  64. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000122.html +0 -18
  65. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000123.html +0 -19
  66. data/doc/rdoc/classes/Mongrel/Camping.html +0 -177
  67. data/doc/rdoc/classes/Mongrel/Camping.src/M000041.html +0 -22
  68. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.html +0 -184
  69. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000042.html +0 -20
  70. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000043.html +0 -58
  71. data/doc/rdoc/classes/Mongrel/Command.html +0 -132
  72. data/doc/rdoc/classes/Mongrel/Command/Base.html +0 -384
  73. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000018.html +0 -24
  74. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000019.html +0 -42
  75. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000020.html +0 -18
  76. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000021.html +0 -18
  77. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000022.html +0 -18
  78. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000023.html +0 -18
  79. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000024.html +0 -22
  80. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000025.html +0 -18
  81. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000026.html +0 -18
  82. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000027.html +0 -18
  83. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000028.html +0 -24
  84. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000029.html +0 -24
  85. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000030.html +0 -18
  86. data/doc/rdoc/classes/Mongrel/Command/Registry.html +0 -192
  87. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000031.html +0 -20
  88. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000032.html +0 -29
  89. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000033.html +0 -58
  90. data/doc/rdoc/classes/Mongrel/Configurator.html +0 -716
  91. data/doc/rdoc/classes/Mongrel/Configurator.src/M000093.html +0 -27
  92. data/doc/rdoc/classes/Mongrel/Configurator.src/M000094.html +0 -31
  93. data/doc/rdoc/classes/Mongrel/Configurator.src/M000095.html +0 -18
  94. data/doc/rdoc/classes/Mongrel/Configurator.src/M000096.html +0 -21
  95. data/doc/rdoc/classes/Mongrel/Configurator.src/M000097.html +0 -20
  96. data/doc/rdoc/classes/Mongrel/Configurator.src/M000098.html +0 -23
  97. data/doc/rdoc/classes/Mongrel/Configurator.src/M000099.html +0 -18
  98. data/doc/rdoc/classes/Mongrel/Configurator.src/M000100.html +0 -38
  99. data/doc/rdoc/classes/Mongrel/Configurator.src/M000101.html +0 -19
  100. data/doc/rdoc/classes/Mongrel/Configurator.src/M000102.html +0 -39
  101. data/doc/rdoc/classes/Mongrel/Configurator.src/M000103.html +0 -33
  102. data/doc/rdoc/classes/Mongrel/Configurator.src/M000104.html +0 -18
  103. data/doc/rdoc/classes/Mongrel/Configurator.src/M000105.html +0 -24
  104. data/doc/rdoc/classes/Mongrel/Configurator.src/M000106.html +0 -19
  105. data/doc/rdoc/classes/Mongrel/Configurator.src/M000107.html +0 -18
  106. data/doc/rdoc/classes/Mongrel/Configurator.src/M000108.html +0 -22
  107. data/doc/rdoc/classes/Mongrel/Configurator.src/M000109.html +0 -22
  108. data/doc/rdoc/classes/Mongrel/Configurator.src/M000110.html +0 -18
  109. data/doc/rdoc/classes/Mongrel/Configurator.src/M000111.html +0 -34
  110. data/doc/rdoc/classes/Mongrel/Configurator.src/M000112.html +0 -18
  111. data/doc/rdoc/classes/Mongrel/Configurator.src/M000113.html +0 -36
  112. data/doc/rdoc/classes/Mongrel/Configurator.src/M000114.html +0 -18
  113. data/doc/rdoc/classes/Mongrel/Const.html +0 -337
  114. data/doc/rdoc/classes/Mongrel/DeflateFilter.html +0 -188
  115. data/doc/rdoc/classes/Mongrel/DeflateFilter.src/M000124.html +0 -19
  116. data/doc/rdoc/classes/Mongrel/DeflateFilter.src/M000125.html +0 -23
  117. data/doc/rdoc/classes/Mongrel/DirHandler.html +0 -303
  118. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000051.html +0 -21
  119. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000052.html +0 -42
  120. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000053.html +0 -38
  121. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000054.html +0 -65
  122. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000055.html +0 -39
  123. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000056.html +0 -18
  124. data/doc/rdoc/classes/Mongrel/Error404Handler.html +0 -171
  125. data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000126.html +0 -18
  126. data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000127.html +0 -18
  127. data/doc/rdoc/classes/Mongrel/HeaderOut.html +0 -190
  128. data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000066.html +0 -21
  129. data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000067.html +0 -21
  130. data/doc/rdoc/classes/Mongrel/HttpHandler.html +0 -215
  131. data/doc/rdoc/classes/Mongrel/HttpHandler.src/M000072.html +0 -17
  132. data/doc/rdoc/classes/Mongrel/HttpHandler.src/M000073.html +0 -17
  133. data/doc/rdoc/classes/Mongrel/HttpHandler.src/M000074.html +0 -17
  134. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.html +0 -210
  135. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000014.html +0 -17
  136. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000015.html +0 -17
  137. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000016.html +0 -19
  138. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000017.html +0 -17
  139. data/doc/rdoc/classes/Mongrel/HttpParams.html +0 -131
  140. data/doc/rdoc/classes/Mongrel/HttpParser.html +0 -278
  141. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000044.html +0 -28
  142. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000045.html +0 -29
  143. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000046.html +0 -29
  144. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000047.html +0 -59
  145. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000048.html +0 -27
  146. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000049.html +0 -27
  147. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000050.html +0 -28
  148. data/doc/rdoc/classes/Mongrel/HttpParserError.html +0 -111
  149. data/doc/rdoc/classes/Mongrel/HttpRequest.html +0 -284
  150. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000133.html +0 -50
  151. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000134.html +0 -41
  152. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000135.html +0 -29
  153. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000136.html +0 -20
  154. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000137.html +0 -20
  155. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000138.html +0 -32
  156. data/doc/rdoc/classes/Mongrel/HttpResponse.html +0 -443
  157. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000075.html +0 -25
  158. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000076.html +0 -20
  159. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000077.html +0 -26
  160. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000078.html +0 -22
  161. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000079.html +0 -22
  162. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000080.html +0 -22
  163. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000081.html +0 -31
  164. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000082.html +0 -21
  165. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000083.html +0 -20
  166. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000084.html +0 -20
  167. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000085.html +0 -20
  168. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000086.html +0 -18
  169. data/doc/rdoc/classes/Mongrel/HttpServer.html +0 -402
  170. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000057.html +0 -25
  171. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000058.html +0 -100
  172. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000059.html +0 -32
  173. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000060.html +0 -21
  174. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000061.html +0 -29
  175. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000062.html +0 -65
  176. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000063.html +0 -34
  177. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000064.html +0 -18
  178. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000065.html +0 -22
  179. data/doc/rdoc/classes/Mongrel/Rails.html +0 -112
  180. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.html +0 -225
  181. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000034.html +0 -37
  182. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000035.html +0 -25
  183. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000036.html +0 -26
  184. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.html +0 -263
  185. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000037.html +0 -23
  186. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000038.html +0 -56
  187. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000039.html +0 -20
  188. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000040.html +0 -25
  189. data/doc/rdoc/classes/Mongrel/RedirectHandler.html +0 -187
  190. data/doc/rdoc/classes/Mongrel/RedirectHandler.src/M000131.html +0 -22
  191. data/doc/rdoc/classes/Mongrel/RedirectHandler.src/M000132.html +0 -27
  192. data/doc/rdoc/classes/Mongrel/StatisticsFilter.html +0 -211
  193. data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/M000128.html +0 -24
  194. data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/M000129.html +0 -24
  195. data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/M000130.html +0 -18
  196. data/doc/rdoc/classes/Mongrel/Stats.html +0 -309
  197. data/doc/rdoc/classes/Mongrel/Stats.src/M000139.html +0 -19
  198. data/doc/rdoc/classes/Mongrel/Stats.src/M000140.html +0 -23
  199. data/doc/rdoc/classes/Mongrel/Stats.src/M000141.html +0 -26
  200. data/doc/rdoc/classes/Mongrel/Stats.src/M000142.html +0 -18
  201. data/doc/rdoc/classes/Mongrel/Stats.src/M000143.html +0 -18
  202. data/doc/rdoc/classes/Mongrel/Stats.src/M000144.html +0 -18
  203. data/doc/rdoc/classes/Mongrel/Stats.src/M000145.html +0 -23
  204. data/doc/rdoc/classes/Mongrel/Stats.src/M000146.html +0 -20
  205. data/doc/rdoc/classes/Mongrel/StatusHandler.html +0 -194
  206. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000068.html +0 -18
  207. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000069.html +0 -24
  208. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000070.html +0 -42
  209. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000071.html +0 -20
  210. data/doc/rdoc/classes/Mongrel/StopServer.html +0 -117
  211. data/doc/rdoc/classes/Mongrel/TimeoutError.html +0 -117
  212. data/doc/rdoc/classes/Mongrel/URIClassifier.html +0 -317
  213. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000087.html +0 -18
  214. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000088.html +0 -18
  215. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000089.html +0 -39
  216. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000090.html +0 -51
  217. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000091.html +0 -36
  218. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000092.html +0 -83
  219. data/doc/rdoc/classes/MongrelDbg.html +0 -209
  220. data/doc/rdoc/classes/MongrelDbg.src/M000007.html +0 -24
  221. data/doc/rdoc/classes/MongrelDbg.src/M000008.html +0 -20
  222. data/doc/rdoc/classes/MongrelDbg.src/M000009.html +0 -22
  223. data/doc/rdoc/classes/MongrelDbg.src/M000010.html +0 -21
  224. data/doc/rdoc/classes/MongrelDbg.src/M000011.html +0 -18
  225. data/doc/rdoc/classes/Mutex.html +0 -158
  226. data/doc/rdoc/classes/Mutex.src/M000001.html +0 -24
  227. data/doc/rdoc/classes/Mutex.src/M000002.html +0 -32
  228. data/doc/rdoc/classes/RequestLog.html +0 -115
  229. data/doc/rdoc/classes/RequestLog/Access.html +0 -151
  230. data/doc/rdoc/classes/RequestLog/Access.src/M000147.html +0 -19
  231. data/doc/rdoc/classes/RequestLog/Files.html +0 -144
  232. data/doc/rdoc/classes/RequestLog/Files.src/M000148.html +0 -19
  233. data/doc/rdoc/classes/RequestLog/Objects.html +0 -150
  234. data/doc/rdoc/classes/RequestLog/Objects.src/M000150.html +0 -51
  235. data/doc/rdoc/classes/RequestLog/Params.html +0 -144
  236. data/doc/rdoc/classes/RequestLog/Params.src/M000151.html +0 -19
  237. data/doc/rdoc/classes/RequestLog/Threads.html +0 -144
  238. data/doc/rdoc/classes/RequestLog/Threads.src/M000149.html +0 -34
  239. data/doc/rdoc/classes/TCPServer.html +0 -173
  240. data/doc/rdoc/classes/TCPServer.src/M000005.html +0 -19
  241. data/doc/rdoc/created.rid +0 -1
  242. data/doc/rdoc/files/COPYING.html +0 -168
  243. data/doc/rdoc/files/LICENSE.html +0 -168
  244. data/doc/rdoc/files/README.html +0 -213
  245. data/doc/rdoc/files/ext/http11/http11_c.html +0 -101
  246. data/doc/rdoc/files/lib/mongrel/camping_rb.html +0 -120
  247. data/doc/rdoc/files/lib/mongrel/cgi_rb.html +0 -120
  248. data/doc/rdoc/files/lib/mongrel/command_rb.html +0 -123
  249. data/doc/rdoc/files/lib/mongrel/configurator_rb.html +0 -111
  250. data/doc/rdoc/files/lib/mongrel/debug_rb.html +0 -122
  251. data/doc/rdoc/files/lib/mongrel/handlers_rb.html +0 -122
  252. data/doc/rdoc/files/lib/mongrel/init_rb.html +0 -121
  253. data/doc/rdoc/files/lib/mongrel/rails_rb.html +0 -123
  254. data/doc/rdoc/files/lib/mongrel/stats_rb.html +0 -113
  255. data/doc/rdoc/files/lib/mongrel/tcphack_rb.html +0 -113
  256. data/doc/rdoc/files/lib/mongrel_rb.html +0 -135
  257. data/doc/rdoc/files/lib/mutex_fix_rb.html +0 -108
  258. data/doc/rdoc/fr_class_index.html +0 -68
  259. data/doc/rdoc/fr_file_index.html +0 -42
  260. data/doc/rdoc/fr_method_index.html +0 -177
  261. data/doc/rdoc/index.html +0 -24
  262. data/doc/rdoc/rdoc-style.css +0 -208
  263. data/tools/rakehelp.rb +0 -117
@@ -0,0 +1,2 @@
1
+ /�w�=�~�"WT��:Kk���6l��b��U�|�k�;m=up5���ZQH���o��>�ZP@��a�����i�<L��)Մ��ݐ��=�}�����E5c�J ��y�M���u��9V�c��`IA �ƅl��t�H�Z[��fy>_S�Ss��\
2
+ ttC�R�h�ʀ.1;gg�a6�o% ����y��Vz��
@@ -0,0 +1,2 @@
1
+
2
+ v1.0.2. Signed gem; many minor bugfixes and patches.
@@ -0,0 +1,68 @@
1
+ bin/mongrel_rails
2
+ CHANGELOG
3
+ COPYING
4
+ examples/builder.rb
5
+ examples/camping/blog.rb
6
+ examples/camping/README
7
+ examples/camping/tepee.rb
8
+ examples/httpd.conf
9
+ examples/mime.yaml
10
+ examples/mongrel.conf
11
+ examples/mongrel_simple_ctrl.rb
12
+ examples/mongrel_simple_service.rb
13
+ examples/monitrc
14
+ examples/random_thrash.rb
15
+ examples/simpletest.rb
16
+ examples/webrick_compare.rb
17
+ ext/http11/ext_help.h
18
+ ext/http11/extconf.rb
19
+ ext/http11/http11.c
20
+ ext/http11/http11_parser.c
21
+ ext/http11/http11_parser.h
22
+ ext/http11/http11_parser.java.rl
23
+ ext/http11/http11_parser.rl
24
+ ext/http11/http11_parser_common.rl
25
+ ext/http11/MANIFEST
26
+ ext/http11/tst.h
27
+ ext/http11/tst_cleanup.c
28
+ ext/http11/tst_delete.c
29
+ ext/http11/tst_grow_node_free_list.c
30
+ ext/http11/tst_init.c
31
+ ext/http11/tst_insert.c
32
+ ext/http11/tst_search.c
33
+ lib/mongrel/camping.rb
34
+ lib/mongrel/cgi.rb
35
+ lib/mongrel/command.rb
36
+ lib/mongrel/configurator.rb
37
+ lib/mongrel/debug.rb
38
+ lib/mongrel/handlers.rb
39
+ lib/mongrel/init.rb
40
+ lib/mongrel/mime_types.yml
41
+ lib/mongrel/rails.rb
42
+ lib/mongrel/stats.rb
43
+ lib/mongrel/tcphack.rb
44
+ lib/mongrel.rb
45
+ lib/mutex_fix.rb
46
+ LICENSE
47
+ Manifest
48
+ mongrel-public_cert.pem
49
+ README
50
+ setup.rb
51
+ test/jruby_socket.rb
52
+ test/mime.yaml
53
+ test/mongrel.conf
54
+ test/test_cgi_wrapper.rb
55
+ test/test_command.rb
56
+ test/test_conditional.rb
57
+ test/test_configurator.rb
58
+ test/test_debug.rb
59
+ test/test_handlers.rb
60
+ test/test_http11.rb
61
+ test/test_redirect_handler.rb
62
+ test/test_request_progress.rb
63
+ test/test_response.rb
64
+ test/test_stats.rb
65
+ test/test_uriclassifier.rb
66
+ test/test_ws.rb
67
+ test/testhelp.rb
68
+ tools/trickletest.rb
@@ -1,7 +1,7 @@
1
- # Copyright (c) 2005 Zed A. Shaw
1
+ # Copyright (c) 2005 Zed A. Shaw
2
2
  # You can redistribute it and/or modify it under the same terms as Ruby.
3
3
  #
4
- # Additional work donated by contributors. See http://mongrel.rubyforge.org/attributions.html
4
+ # Additional work donated by contributors. See http://mongrel.rubyforge.org/attributions.html
5
5
  # for more information.
6
6
 
7
7
  require 'rubygems'
@@ -9,7 +9,6 @@ require 'yaml'
9
9
  require 'mongrel'
10
10
  require 'mongrel/rails'
11
11
  require 'etc'
12
- require 'cgi_multipart_eof_fix' rescue nil
13
12
 
14
13
  module Mongrel
15
14
  class Start < GemPlugin::Plugin "/commands"
@@ -24,7 +23,8 @@ module Mongrel
24
23
  ['-l', '--log FILE', "Where to write log messages", :@log_file, "log/mongrel.log"],
25
24
  ['-P', '--pid FILE', "Where to write the PID", :@pid_file, "log/mongrel.pid"],
26
25
  ['-n', '--num-procs INT', "Number of processors active before clients denied", :@num_procs, 1024],
27
- ['-t', '--timeout TIME', "Timeout all requests after 100th seconds time", :@timeout, 0],
26
+ ['-o', '--timeout TIME', "Time to wait (in seconds) before killing a stalled thread", :@timeout, 60],
27
+ ['-t', '--throttle TIME', "Time to pause (in hundredths of a second) between accepting clients", :@throttle, 0],
28
28
  ['-m', '--mime PATH', "A YAML file that lists additional MIME types", :@mime_map, nil],
29
29
  ['-c', '--chdir PATH', "Change to dir before starting (will be expanded)", :@cwd, Dir.pwd],
30
30
  ['-r', '--root PATH', "Set the document root (default 'public')", :@docroot, "public"],
@@ -39,13 +39,21 @@ module Mongrel
39
39
  end
40
40
 
41
41
  def validate
42
+ if @config_file
43
+ valid_exists?(@config_file, "Config file not there: #@config_file")
44
+ return false unless @valid
45
+ @config_file = File.expand_path(@config_file)
46
+ load_config
47
+ return false unless @valid
48
+ end
49
+
42
50
  @cwd = File.expand_path(@cwd)
43
51
  valid_dir? @cwd, "Invalid path to change to during daemon mode: #@cwd"
44
52
 
45
53
  # Change there to start, then we'll have to come back after daemonize
46
54
  Dir.chdir(@cwd)
47
55
 
48
- valid?(@prefix[0].chr == "/" && @prefix[-1].chr != "/", "Prefix must begin with / and not end in /") if @prefix
56
+ valid?(@prefix[0] == ?/ && @prefix[-1] != ?/, "Prefix must begin with / and not end in /") if @prefix
49
57
  valid_dir? File.dirname(@log_file), "Path to log file not valid: #@log_file"
50
58
  valid_dir? File.dirname(@pid_file), "Path to pid file not valid: #@pid_file"
51
59
  valid_dir? @docroot, "Path to docroot not valid: #@docroot"
@@ -59,27 +67,14 @@ module Mongrel
59
67
  end
60
68
 
61
69
  def run
62
- # Config file settings will override command line settings
63
- settings = { :host => @address, :port => @port, :cwd => @cwd,
64
- :log_file => @log_file, :pid_file => @pid_file, :environment => @environment,
65
- :docroot => @docroot, :mime_map => @mime_map, :daemon => @daemon,
66
- :debug => @debug, :includes => ["mongrel"], :config_script => @config_script,
67
- :num_processors => @num_procs, :timeout => @timeout,
68
- :user => @user, :group => @group, :prefix => @prefix, :config_file => @config_file
69
- }
70
-
71
70
  if @generate
71
+ @generate = File.expand_path(@generate)
72
72
  STDERR.puts "** Writing config to \"#@generate\"."
73
73
  open(@generate, "w") {|f| f.write(settings.to_yaml) }
74
- STDERR.puts "** Finished. Run \"mongrel_rails -C #@generate\" to use the config file."
74
+ STDERR.puts "** Finished. Run \"mongrel_rails start -C #@generate\" to use the config file."
75
75
  exit 0
76
76
  end
77
77
 
78
- if @config_file
79
- settings.merge! YAML.load_file(@config_file)
80
- STDERR.puts "** Loading settings from #{@config_file} (they override command line)." unless settings[:daemon]
81
- end
82
-
83
78
  config = Mongrel::Rails::RailsConfigurator.new(settings) do
84
79
  if defaults[:daemon]
85
80
  if File.exist? defaults[:pid_file]
@@ -125,7 +120,7 @@ module Mongrel
125
120
  end
126
121
 
127
122
  config.run
128
- config.log "Mongrel available at #{settings[:host]}:#{settings[:port]}"
123
+ config.log "Mongrel available at #{@address}:#{@port}"
129
124
 
130
125
  if config.defaults[:daemon]
131
126
  config.write_pid_file
@@ -139,7 +134,7 @@ module Mongrel
139
134
  if RUBY_PLATFORM !~ /mswin/
140
135
  cmd = "ruby #{__FILE__} start #{original_args.join(' ')}"
141
136
  config.log "Restarting with arguments: #{cmd}"
142
- config.stop
137
+ config.stop(false, true)
143
138
  config.remove_pid_file
144
139
 
145
140
  if config.defaults[:daemon]
@@ -153,6 +148,44 @@ module Mongrel
153
148
  end
154
149
  end
155
150
  end
151
+
152
+ def load_config
153
+ settings = {}
154
+ begin
155
+ settings = YAML.load_file(@config_file)
156
+ ensure
157
+ STDERR.puts "** Loading settings from #{@config_file} (they override command line)." unless @daemon || settings[:daemon]
158
+ end
159
+
160
+ settings[:includes] ||= ["mongrel"]
161
+
162
+ # Config file settings will override command line settings
163
+ settings.each do |key, value|
164
+ key = key.to_s
165
+ if config_keys.include?(key)
166
+ key = 'address' if key == 'host'
167
+ self.instance_variable_set("@#{key}", value)
168
+ else
169
+ failure "Unknown configuration setting: #{key}"
170
+ @valid = false
171
+ end
172
+ end
173
+ end
174
+
175
+ def config_keys
176
+ @config_keys ||=
177
+ %w(host port cwd log_file pid_file environment docroot mime_map daemon debug includes config_script
178
+ num_processors timeout throttle user group prefix)
179
+ end
180
+
181
+ def settings
182
+ config_keys.inject({}) do |hash, key|
183
+ value = self.instance_variable_get("@#{key}")
184
+ key = 'host' if key == 'address'
185
+ hash[key.to_sym] = value
186
+ hash
187
+ end
188
+ end
156
189
  end
157
190
 
158
191
  def Mongrel::send_signal(signal, pid_file)
@@ -0,0 +1,3 @@
1
+ To get these examples running, install Camping.
2
+
3
+ Instructions here: http://code.whytheluckystiff.net/camping/
@@ -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
+