passenger 3.0.21 → 3.9.1.beta

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (835) hide show
  1. data/DEVELOPERS.TXT +4 -10
  2. data/NEWS +19 -27
  3. data/Rakefile +20 -19
  4. data/bin/passenger +3 -2
  5. data/bin/passenger-config +35 -5
  6. data/bin/passenger-install-apache2-module +12 -12
  7. data/bin/passenger-install-nginx-module +55 -38
  8. data/bin/passenger-memory-stats +3 -1
  9. data/bin/passenger-status +7 -35
  10. data/build/agents.rb +107 -21
  11. data/build/apache2.rb +11 -46
  12. data/build/basics.rb +61 -9
  13. data/build/common_library.rb +59 -142
  14. data/build/cxx_tests.rb +111 -110
  15. data/build/documentation.rb +33 -0
  16. data/build/misc.rb +30 -12
  17. data/build/nginx.rb +10 -39
  18. data/build/oxt_tests.rb +1 -0
  19. data/build/ruby_extension.rb +1 -5
  20. data/build/test_basics.rb +3 -2
  21. data/dev/copy_boost_headers.rb +2 -1
  22. data/doc/Architectural overview.html +49 -90
  23. data/doc/DebuggingAndStressTesting.txt.md +49 -0
  24. data/doc/Packaging.txt.md +254 -0
  25. data/doc/Security of user switching support.html +35 -66
  26. data/doc/Users guide Apache.html +588 -758
  27. data/doc/Users guide Apache.idmap.txt +253 -136
  28. data/doc/Users guide Apache.txt +154 -109
  29. data/doc/Users guide Nginx.html +544 -660
  30. data/doc/Users guide Nginx.idmap.txt +179 -91
  31. data/doc/Users guide Nginx.txt +192 -118
  32. data/doc/Users guide Standalone.html +65 -48
  33. data/doc/Users guide Standalone.idmap.txt +10 -2
  34. data/doc/Users guide Standalone.txt +4 -0
  35. data/doc/images/glyphicons-halflings-white.png +0 -0
  36. data/doc/images/glyphicons-halflings.png +0 -0
  37. data/doc/images/phusion_banner_small.png +0 -0
  38. data/doc/images/{smart-lv2.png → smart.png} +0 -0
  39. data/doc/images/{smart-lv2.svg → smart.svg} +0 -0
  40. data/doc/templates/bootstrap.min.css +397 -0
  41. data/doc/templates/markdown.html.erb +117 -0
  42. data/doc/users_guide_snippets/analysis_and_system_maintenance.txt +2 -1
  43. data/doc/users_guide_snippets/appendix_c_spawning_methods.txt +26 -48
  44. data/doc/users_guide_snippets/passenger_spawn_method.txt +18 -30
  45. data/doc/users_guide_snippets/support_information.txt +30 -0
  46. data/ext/apache2/Bucket.cpp +9 -26
  47. data/ext/apache2/Bucket.h +13 -10
  48. data/ext/apache2/Configuration.cpp +70 -58
  49. data/ext/apache2/Configuration.hpp +19 -47
  50. data/ext/apache2/DirectoryMapper.h +7 -7
  51. data/ext/apache2/Hooks.cpp +150 -313
  52. data/ext/boost/algorithm/string/detail/case_conv.hpp +4 -2
  53. data/ext/boost/algorithm/string/detail/find_format.hpp +20 -20
  54. data/ext/boost/algorithm/string/detail/find_format_all.hpp +23 -23
  55. data/ext/boost/algorithm/string/detail/find_format_store.hpp +2 -2
  56. data/ext/boost/algorithm/string/detail/formatter.hpp +25 -0
  57. data/ext/boost/algorithm/string/formatter.hpp +20 -3
  58. data/ext/boost/assert.hpp +85 -4
  59. data/ext/boost/bind/bind.hpp +1 -1
  60. data/ext/boost/concept/detail/backward_compatibility.hpp +1 -1
  61. data/ext/boost/concept_check.hpp +140 -64
  62. data/ext/boost/config.hpp +1 -1
  63. data/ext/boost/config/auto_link.hpp +8 -6
  64. data/ext/boost/config/compiler/borland.hpp +12 -2
  65. data/ext/boost/config/compiler/clang.hpp +89 -30
  66. data/ext/boost/config/compiler/codegear.hpp +3 -2
  67. data/ext/boost/config/compiler/common_edg.hpp +7 -5
  68. data/ext/boost/config/compiler/cray.hpp +61 -0
  69. data/ext/boost/config/compiler/digitalmars.hpp +9 -1
  70. data/ext/boost/config/compiler/gcc.hpp +33 -24
  71. data/ext/boost/config/compiler/gcc_xml.hpp +4 -0
  72. data/ext/boost/config/compiler/hp_acc.hpp +12 -1
  73. data/ext/boost/config/compiler/intel.hpp +78 -4
  74. data/ext/boost/config/compiler/metrowerks.hpp +4 -1
  75. data/ext/boost/config/compiler/mpw.hpp +4 -1
  76. data/ext/boost/config/compiler/nvcc.hpp +8 -66
  77. data/ext/boost/config/compiler/pathscale.hpp +80 -0
  78. data/ext/boost/config/compiler/pgi.hpp +5 -5
  79. data/ext/boost/config/compiler/sunpro_cc.hpp +4 -1
  80. data/ext/boost/config/compiler/vacpp.hpp +37 -13
  81. data/ext/boost/config/compiler/visualc.hpp +24 -11
  82. data/ext/boost/config/platform/bsd.hpp +1 -1
  83. data/ext/boost/config/platform/cray.hpp +18 -0
  84. data/ext/boost/config/platform/cygwin.hpp +10 -0
  85. data/ext/boost/config/platform/linux.hpp +5 -0
  86. data/ext/boost/config/platform/macos.hpp +5 -4
  87. data/ext/boost/config/platform/symbian.hpp +5 -2
  88. data/ext/boost/config/platform/vms.hpp +25 -0
  89. data/ext/boost/config/platform/win32.hpp +7 -1
  90. data/ext/boost/config/select_compiler_config.hpp +8 -25
  91. data/ext/boost/config/select_platform_config.hpp +8 -1
  92. data/ext/boost/config/select_stdlib_config.hpp +9 -1
  93. data/ext/boost/config/stdlib/dinkumware.hpp +6 -9
  94. data/ext/boost/config/stdlib/libcomo.hpp +1 -4
  95. data/ext/boost/config/stdlib/libcpp.hpp +36 -0
  96. data/ext/boost/config/stdlib/libstdcpp3.hpp +37 -11
  97. data/ext/boost/config/stdlib/modena.hpp +1 -4
  98. data/ext/boost/config/stdlib/msl.hpp +1 -4
  99. data/ext/boost/config/stdlib/roguewave.hpp +9 -6
  100. data/ext/boost/config/stdlib/sgi.hpp +12 -4
  101. data/ext/boost/config/stdlib/stlport.hpp +11 -4
  102. data/ext/boost/config/stdlib/vacpp.hpp +11 -4
  103. data/ext/boost/config/suffix.hpp +71 -6
  104. data/ext/boost/config/warning_disable.hpp +1 -1
  105. data/ext/boost/container/container_fwd.hpp +177 -0
  106. data/ext/boost/cstdint.hpp +17 -12
  107. data/ext/boost/current_function.hpp +2 -1
  108. data/ext/boost/date_time/c_time.hpp +17 -1
  109. data/ext/boost/date_time/compiler_config.hpp +13 -15
  110. data/ext/boost/date_time/date_formatting.hpp +7 -1
  111. data/ext/boost/date_time/filetime_functions.hpp +4 -4
  112. data/ext/boost/date_time/gregorian_calendar.ipp +2 -2
  113. data/ext/boost/date_time/strings_from_facet.hpp +3 -3
  114. data/ext/boost/date_time/time_facet.hpp +101 -101
  115. data/ext/boost/detail/endian.hpp +4 -2
  116. data/ext/boost/detail/fenv.hpp +74 -0
  117. data/ext/boost/detail/sp_typeinfo.hpp +6 -0
  118. data/ext/boost/exception/detail/clone_current_exception.hpp +47 -0
  119. data/ext/boost/exception/detail/exception_ptr.hpp +194 -122
  120. data/ext/boost/exception/detail/type_info.hpp +3 -3
  121. data/ext/boost/exception/diagnostic_information.hpp +37 -21
  122. data/ext/boost/exception/exception.hpp +21 -1
  123. data/ext/boost/exception/info.hpp +0 -1
  124. data/ext/boost/function.hpp +2 -2
  125. data/ext/boost/function/function_base.hpp +15 -9
  126. data/ext/boost/function/function_template.hpp +26 -48
  127. data/ext/boost/integer_fwd.hpp +0 -16
  128. data/ext/boost/integer_traits.hpp +2 -2
  129. data/ext/boost/iterator.hpp +1 -1
  130. data/ext/boost/iterator/iterator_adaptor.hpp +1 -7
  131. data/ext/boost/iterator/iterator_facade.hpp +13 -13
  132. data/ext/boost/iterator/transform_iterator.hpp +5 -20
  133. data/ext/boost/lexical_cast.hpp +1655 -673
  134. data/ext/boost/math/policies/policy.hpp +982 -0
  135. data/ext/boost/math/special_functions/detail/fp_traits.hpp +570 -0
  136. data/ext/boost/math/special_functions/detail/round_fwd.hpp +80 -0
  137. data/ext/boost/math/special_functions/fpclassify.hpp +533 -0
  138. data/ext/boost/math/special_functions/math_fwd.hpp +1070 -0
  139. data/ext/boost/math/special_functions/sign.hpp +145 -0
  140. data/ext/boost/math/tools/config.hpp +321 -0
  141. data/ext/boost/math/tools/promotion.hpp +150 -0
  142. data/ext/boost/math/tools/real_cast.hpp +29 -0
  143. data/ext/boost/math/tools/user.hpp +97 -0
  144. data/ext/boost/move/move.hpp +1222 -0
  145. data/ext/boost/mpl/O1_size.hpp +40 -0
  146. data/ext/boost/mpl/O1_size_fwd.hpp +24 -0
  147. data/ext/boost/mpl/advance.hpp +76 -0
  148. data/ext/boost/mpl/advance_fwd.hpp +28 -0
  149. data/ext/boost/mpl/at.hpp +52 -0
  150. data/ext/boost/mpl/at_fwd.hpp +24 -0
  151. data/ext/boost/mpl/aux_/O1_size_impl.hpp +87 -0
  152. data/ext/boost/mpl/aux_/advance_backward.hpp +128 -0
  153. data/ext/boost/mpl/aux_/advance_forward.hpp +127 -0
  154. data/ext/boost/mpl/aux_/arithmetic_op.hpp +92 -0
  155. data/ext/boost/mpl/aux_/at_impl.hpp +45 -0
  156. data/ext/boost/mpl/aux_/begin_end_impl.hpp +101 -0
  157. data/ext/boost/mpl/aux_/clear_impl.hpp +35 -0
  158. data/ext/boost/mpl/aux_/comparison_op.hpp +83 -0
  159. data/ext/boost/mpl/aux_/config/forwarding.hpp +27 -0
  160. data/ext/boost/mpl/aux_/config/typeof.hpp +38 -0
  161. data/ext/boost/mpl/aux_/contains_impl.hpp +61 -0
  162. data/ext/boost/mpl/aux_/find_if_pred.hpp +31 -0
  163. data/ext/boost/mpl/aux_/fold_impl.hpp +43 -0
  164. data/ext/boost/mpl/aux_/has_begin.hpp +23 -0
  165. data/ext/boost/mpl/aux_/has_size.hpp +23 -0
  166. data/ext/boost/mpl/aux_/has_tag.hpp +23 -0
  167. data/ext/boost/mpl/aux_/inserter_algorithm.hpp +159 -0
  168. data/ext/boost/mpl/aux_/is_msvc_eti_arg.hpp +64 -0
  169. data/ext/boost/mpl/aux_/iter_apply.hpp +47 -0
  170. data/ext/boost/mpl/aux_/iter_fold_if_impl.hpp +210 -0
  171. data/ext/boost/mpl/aux_/iter_fold_impl.hpp +42 -0
  172. data/ext/boost/mpl/aux_/lambda_spec.hpp +49 -0
  173. data/ext/boost/mpl/aux_/largest_int.hpp +63 -0
  174. data/ext/boost/mpl/aux_/msvc_eti_base.hpp +77 -0
  175. data/ext/boost/mpl/aux_/msvc_type.hpp +62 -0
  176. data/ext/boost/mpl/aux_/numeric_cast_utils.hpp +77 -0
  177. data/ext/boost/mpl/aux_/numeric_op.hpp +315 -0
  178. data/ext/boost/mpl/aux_/preprocessed/gcc/advance_backward.hpp +97 -0
  179. data/ext/boost/mpl/aux_/preprocessed/gcc/advance_forward.hpp +97 -0
  180. data/ext/boost/mpl/aux_/preprocessed/gcc/equal_to.hpp +94 -0
  181. data/ext/boost/mpl/aux_/preprocessed/gcc/fold_impl.hpp +180 -0
  182. data/ext/boost/mpl/aux_/preprocessed/gcc/greater.hpp +94 -0
  183. data/ext/boost/mpl/aux_/preprocessed/gcc/greater_equal.hpp +94 -0
  184. data/ext/boost/mpl/aux_/preprocessed/gcc/iter_fold_if_impl.hpp +133 -0
  185. data/ext/boost/mpl/aux_/preprocessed/gcc/iter_fold_impl.hpp +180 -0
  186. data/ext/boost/mpl/aux_/preprocessed/gcc/less.hpp +94 -0
  187. data/ext/boost/mpl/aux_/preprocessed/gcc/less_equal.hpp +94 -0
  188. data/ext/boost/mpl/aux_/preprocessed/gcc/list.hpp +323 -0
  189. data/ext/boost/mpl/aux_/preprocessed/gcc/minus.hpp +146 -0
  190. data/ext/boost/mpl/aux_/preprocessed/gcc/not_equal_to.hpp +94 -0
  191. data/ext/boost/mpl/aux_/preprocessed/gcc/plus.hpp +146 -0
  192. data/ext/boost/mpl/aux_/preprocessed/gcc/reverse_fold_impl.hpp +231 -0
  193. data/ext/boost/mpl/aux_/preprocessed/gcc/times.hpp +146 -0
  194. data/ext/boost/mpl/aux_/preprocessed/gcc/vector.hpp +323 -0
  195. data/ext/boost/mpl/aux_/preprocessor/default_params.hpp +67 -0
  196. data/ext/boost/mpl/aux_/push_back_impl.hpp +70 -0
  197. data/ext/boost/mpl/aux_/push_front_impl.hpp +71 -0
  198. data/ext/boost/mpl/aux_/reverse_fold_impl.hpp +44 -0
  199. data/ext/boost/mpl/aux_/size_impl.hpp +52 -0
  200. data/ext/boost/mpl/aux_/traits_lambda_spec.hpp +63 -0
  201. data/ext/boost/mpl/back_fwd.hpp +24 -0
  202. data/ext/boost/mpl/back_inserter.hpp +34 -0
  203. data/ext/boost/mpl/begin_end.hpp +57 -0
  204. data/ext/boost/mpl/begin_end_fwd.hpp +27 -0
  205. data/ext/boost/mpl/clear.hpp +39 -0
  206. data/ext/boost/mpl/clear_fwd.hpp +24 -0
  207. data/ext/boost/mpl/comparison.hpp +24 -0
  208. data/ext/boost/mpl/contains.hpp +41 -0
  209. data/ext/boost/mpl/contains_fwd.hpp +25 -0
  210. data/ext/boost/mpl/deref.hpp +41 -0
  211. data/ext/boost/mpl/distance.hpp +78 -0
  212. data/ext/boost/mpl/distance_fwd.hpp +28 -0
  213. data/ext/boost/mpl/empty_fwd.hpp +24 -0
  214. data/ext/boost/mpl/equal_to.hpp +21 -0
  215. data/ext/boost/mpl/find.hpp +38 -0
  216. data/ext/boost/mpl/find_if.hpp +50 -0
  217. data/ext/boost/mpl/fold.hpp +48 -0
  218. data/ext/boost/mpl/front_fwd.hpp +24 -0
  219. data/ext/boost/mpl/front_inserter.hpp +33 -0
  220. data/ext/boost/mpl/greater.hpp +21 -0
  221. data/ext/boost/mpl/greater_equal.hpp +21 -0
  222. data/ext/boost/mpl/inserter.hpp +32 -0
  223. data/ext/boost/mpl/iter_fold.hpp +49 -0
  224. data/ext/boost/mpl/iter_fold_if.hpp +117 -0
  225. data/ext/boost/mpl/iterator_range.hpp +42 -0
  226. data/ext/boost/mpl/iterator_tags.hpp +27 -0
  227. data/ext/boost/mpl/less.hpp +21 -0
  228. data/ext/boost/mpl/less_equal.hpp +21 -0
  229. data/ext/boost/mpl/limits/list.hpp +21 -0
  230. data/ext/boost/mpl/limits/vector.hpp +21 -0
  231. data/ext/boost/mpl/list.hpp +57 -0
  232. data/ext/boost/mpl/list/aux_/O1_size.hpp +33 -0
  233. data/ext/boost/mpl/list/aux_/begin_end.hpp +44 -0
  234. data/ext/boost/mpl/list/aux_/clear.hpp +34 -0
  235. data/ext/boost/mpl/list/aux_/empty.hpp +34 -0
  236. data/ext/boost/mpl/list/aux_/front.hpp +33 -0
  237. data/ext/boost/mpl/list/aux_/include_preprocessed.hpp +35 -0
  238. data/ext/boost/mpl/list/aux_/item.hpp +55 -0
  239. data/ext/boost/mpl/list/aux_/iterator.hpp +76 -0
  240. data/ext/boost/mpl/list/aux_/pop_front.hpp +34 -0
  241. data/ext/boost/mpl/list/aux_/preprocessed/plain/list10.hpp +149 -0
  242. data/ext/boost/mpl/list/aux_/preprocessed/plain/list20.hpp +169 -0
  243. data/ext/boost/mpl/list/aux_/push_back.hpp +36 -0
  244. data/ext/boost/mpl/list/aux_/push_front.hpp +39 -0
  245. data/ext/boost/mpl/list/aux_/size.hpp +33 -0
  246. data/ext/boost/mpl/list/aux_/tag.hpp +24 -0
  247. data/ext/boost/mpl/list/list0.hpp +42 -0
  248. data/ext/boost/mpl/list/list10.hpp +43 -0
  249. data/ext/boost/mpl/list/list20.hpp +43 -0
  250. data/ext/boost/mpl/long.hpp +22 -0
  251. data/ext/boost/mpl/long_fwd.hpp +27 -0
  252. data/ext/boost/mpl/minus.hpp +21 -0
  253. data/ext/boost/mpl/multiplies.hpp +53 -0
  254. data/ext/boost/mpl/negate.hpp +81 -0
  255. data/ext/boost/mpl/not_equal_to.hpp +21 -0
  256. data/ext/boost/mpl/numeric_cast.hpp +41 -0
  257. data/ext/boost/mpl/pair.hpp +70 -0
  258. data/ext/boost/mpl/plus.hpp +21 -0
  259. data/ext/boost/mpl/pop_back_fwd.hpp +24 -0
  260. data/ext/boost/mpl/pop_front_fwd.hpp +24 -0
  261. data/ext/boost/mpl/prior.hpp +19 -0
  262. data/ext/boost/mpl/push_back.hpp +53 -0
  263. data/ext/boost/mpl/push_back_fwd.hpp +24 -0
  264. data/ext/boost/mpl/push_front.hpp +52 -0
  265. data/ext/boost/mpl/push_front_fwd.hpp +24 -0
  266. data/ext/boost/mpl/remove_if.hpp +83 -0
  267. data/ext/boost/mpl/reverse_fold.hpp +50 -0
  268. data/ext/boost/mpl/same_as.hpp +55 -0
  269. data/ext/boost/mpl/sequence_tag.hpp +124 -0
  270. data/ext/boost/mpl/sequence_tag_fwd.hpp +26 -0
  271. data/ext/boost/mpl/size.hpp +42 -0
  272. data/ext/boost/mpl/size_fwd.hpp +24 -0
  273. data/ext/boost/mpl/tag.hpp +52 -0
  274. data/ext/boost/mpl/times.hpp +21 -0
  275. data/ext/boost/mpl/vector.hpp +57 -0
  276. data/ext/boost/mpl/vector/aux_/O1_size.hpp +56 -0
  277. data/ext/boost/mpl/vector/aux_/at.hpp +116 -0
  278. data/ext/boost/mpl/vector/aux_/back.hpp +59 -0
  279. data/ext/boost/mpl/vector/aux_/begin_end.hpp +49 -0
  280. data/ext/boost/mpl/vector/aux_/clear.hpp +55 -0
  281. data/ext/boost/mpl/vector/aux_/empty.hpp +68 -0
  282. data/ext/boost/mpl/vector/aux_/front.hpp +56 -0
  283. data/ext/boost/mpl/vector/aux_/include_preprocessed.hpp +55 -0
  284. data/ext/boost/mpl/vector/aux_/item.hpp +103 -0
  285. data/ext/boost/mpl/vector/aux_/iterator.hpp +130 -0
  286. data/ext/boost/mpl/vector/aux_/pop_back.hpp +40 -0
  287. data/ext/boost/mpl/vector/aux_/pop_front.hpp +40 -0
  288. data/ext/boost/mpl/vector/aux_/preprocessed/plain/vector10.hpp +829 -0
  289. data/ext/boost/mpl/vector/aux_/preprocessed/plain/vector20.hpp +1144 -0
  290. data/ext/boost/mpl/vector/aux_/preprocessed/typeof_based/vector10.hpp +139 -0
  291. data/ext/boost/mpl/vector/aux_/preprocessed/typeof_based/vector20.hpp +159 -0
  292. data/ext/boost/mpl/vector/aux_/push_back.hpp +40 -0
  293. data/ext/boost/mpl/vector/aux_/push_front.hpp +40 -0
  294. data/ext/boost/mpl/vector/aux_/size.hpp +49 -0
  295. data/ext/boost/mpl/vector/aux_/tag.hpp +32 -0
  296. data/ext/boost/mpl/vector/aux_/vector0.hpp +52 -0
  297. data/ext/boost/mpl/vector/vector0.hpp +34 -0
  298. data/ext/boost/mpl/vector/vector10.hpp +45 -0
  299. data/ext/boost/mpl/vector/vector20.hpp +45 -0
  300. data/ext/boost/none.hpp +1 -1
  301. data/ext/boost/numeric/conversion/bounds.hpp +24 -0
  302. data/ext/boost/numeric/conversion/cast.hpp +61 -0
  303. data/ext/boost/numeric/conversion/conversion_traits.hpp +39 -0
  304. data/ext/boost/numeric/conversion/converter.hpp +68 -0
  305. data/ext/boost/numeric/conversion/converter_policies.hpp +186 -0
  306. data/ext/boost/numeric/conversion/detail/bounds.hpp +58 -0
  307. data/ext/boost/numeric/conversion/detail/conversion_traits.hpp +97 -0
  308. data/ext/boost/numeric/conversion/detail/converter.hpp +602 -0
  309. data/ext/boost/numeric/conversion/detail/int_float_mixture.hpp +72 -0
  310. data/ext/boost/numeric/conversion/detail/is_subranged.hpp +234 -0
  311. data/ext/boost/numeric/conversion/detail/meta.hpp +120 -0
  312. data/ext/boost/numeric/conversion/detail/numeric_cast_traits.hpp +138 -0
  313. data/ext/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_common.hpp +1741 -0
  314. data/ext/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_long_long.hpp +347 -0
  315. data/ext/boost/numeric/conversion/detail/sign_mixture.hpp +72 -0
  316. data/ext/boost/numeric/conversion/detail/udt_builtin_mixture.hpp +69 -0
  317. data/ext/boost/numeric/conversion/int_float_mixture_enum.hpp +29 -0
  318. data/ext/boost/numeric/conversion/numeric_cast_traits.hpp +31 -0
  319. data/ext/boost/numeric/conversion/sign_mixture_enum.hpp +29 -0
  320. data/ext/boost/numeric/conversion/udt_builtin_mixture_enum.hpp +26 -0
  321. data/ext/boost/operators.hpp +3 -1
  322. data/ext/boost/optional/optional.hpp +146 -79
  323. data/ext/boost/optional/optional_fwd.hpp +8 -1
  324. data/ext/boost/preprocessor/cat.hpp +2 -2
  325. data/ext/boost/preprocessor/config/config.hpp +39 -4
  326. data/ext/boost/preprocessor/facilities/intercept.hpp +277 -0
  327. data/ext/boost/preprocessor/facilities/overload.hpp +25 -0
  328. data/ext/boost/preprocessor/iteration/detail/iter/forward1.hpp +3 -3
  329. data/ext/boost/preprocessor/iteration/iterate.hpp +3 -3
  330. data/ext/boost/preprocessor/punctuation/paren.hpp +23 -0
  331. data/ext/boost/preprocessor/repetition/enum_shifted_params.hpp +44 -0
  332. data/ext/boost/preprocessor/seq/cat.hpp +5 -4
  333. data/ext/boost/preprocessor/seq/size.hpp +0 -1
  334. data/ext/boost/preprocessor/tuple/eat.hpp +83 -34
  335. data/ext/boost/preprocessor/tuple/elem.hpp +161 -355
  336. data/ext/boost/preprocessor/tuple/rem.hpp +110 -48
  337. data/ext/boost/preprocessor/tuple/to_list.hpp +90 -36
  338. data/ext/boost/preprocessor/variadic/elem.hpp +94 -0
  339. data/ext/boost/preprocessor/variadic/size.hpp +30 -0
  340. data/ext/boost/range/begin.hpp +17 -6
  341. data/ext/boost/range/concepts.hpp +37 -2
  342. data/ext/boost/range/detail/safe_bool.hpp +72 -0
  343. data/ext/boost/range/end.hpp +14 -9
  344. data/ext/boost/range/iterator_range_core.hpp +120 -12
  345. data/ext/boost/range/size.hpp +21 -5
  346. data/ext/boost/smart_ptr/detail/shared_count.hpp +88 -0
  347. data/ext/boost/smart_ptr/detail/sp_counted_base.hpp +3 -0
  348. data/ext/boost/smart_ptr/detail/sp_counted_base_aix.hpp +142 -0
  349. data/ext/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp +9 -0
  350. data/ext/boost/smart_ptr/detail/sp_counted_impl.hpp +10 -2
  351. data/ext/boost/smart_ptr/detail/sp_has_sync.hpp +5 -1
  352. data/ext/boost/smart_ptr/detail/spinlock.hpp +4 -1
  353. data/ext/boost/smart_ptr/detail/spinlock_gcc_arm.hpp +20 -3
  354. data/ext/boost/smart_ptr/detail/spinlock_pool.hpp +4 -0
  355. data/ext/boost/smart_ptr/make_shared.hpp +591 -22
  356. data/ext/boost/smart_ptr/shared_array.hpp +29 -1
  357. data/ext/boost/smart_ptr/shared_ptr.hpp +29 -13
  358. data/ext/boost/smart_ptr/weak_ptr.hpp +24 -12
  359. data/ext/boost/src/pthread/once.cpp +9 -7
  360. data/ext/boost/src/pthread/thread.cpp +32 -28
  361. data/ext/boost/src/pthread/timeconv.inl +4 -5
  362. data/ext/boost/src/tss_null.cpp +5 -1
  363. data/ext/boost/static_assert.hpp +8 -2
  364. data/ext/boost/thread/detail/config.hpp +19 -4
  365. data/ext/boost/thread/detail/move.hpp +11 -5
  366. data/ext/boost/thread/detail/thread.hpp +59 -43
  367. data/ext/boost/thread/exceptions.hpp +9 -9
  368. data/ext/boost/thread/future.hpp +150 -82
  369. data/ext/boost/thread/locks.hpp +101 -60
  370. data/ext/boost/thread/pthread/condition_variable.hpp +79 -32
  371. data/ext/boost/thread/pthread/condition_variable_fwd.hpp +12 -3
  372. data/ext/boost/thread/pthread/mutex.hpp +17 -14
  373. data/ext/boost/thread/pthread/once.hpp +3 -4
  374. data/ext/boost/thread/pthread/pthread_mutex_scoped_lock.hpp +12 -2
  375. data/ext/boost/thread/pthread/recursive_mutex.hpp +19 -19
  376. data/ext/boost/thread/pthread/shared_mutex.hpp +13 -13
  377. data/ext/boost/thread/pthread/thread_data.hpp +40 -12
  378. data/ext/boost/thread/thread_time.hpp +5 -0
  379. data/ext/boost/throw_exception.hpp +1 -1
  380. data/ext/boost/token_functions.hpp +34 -10
  381. data/ext/boost/type_traits/add_rvalue_reference.hpp +66 -0
  382. data/ext/boost/type_traits/alignment_of.hpp +1 -1
  383. data/ext/boost/type_traits/detail/bool_trait_def.hpp +26 -3
  384. data/ext/boost/type_traits/detail/bool_trait_undef.hpp +3 -2
  385. data/ext/boost/type_traits/detail/cv_traits_impl.hpp +1 -1
  386. data/ext/boost/type_traits/detail/size_t_trait_def.hpp +6 -4
  387. data/ext/boost/type_traits/detail/type_trait_def.hpp +8 -2
  388. data/ext/boost/type_traits/function_traits.hpp +1 -1
  389. data/ext/boost/type_traits/has_nothrow_constructor.hpp +53 -0
  390. data/ext/boost/type_traits/has_nothrow_copy.hpp +19 -5
  391. data/ext/boost/type_traits/has_trivial_constructor.hpp +51 -0
  392. data/ext/boost/type_traits/has_trivial_copy.hpp +20 -5
  393. data/ext/boost/type_traits/has_trivial_destructor.hpp +12 -5
  394. data/ext/boost/type_traits/intrinsics.hpp +119 -71
  395. data/ext/boost/type_traits/is_const.hpp +5 -5
  396. data/ext/boost/type_traits/is_convertible.hpp +14 -13
  397. data/ext/boost/type_traits/is_enum.hpp +1 -1
  398. data/ext/boost/type_traits/is_floating_point.hpp +27 -0
  399. data/ext/boost/type_traits/is_function.hpp +3 -3
  400. data/ext/boost/type_traits/is_fundamental.hpp +1 -1
  401. data/ext/boost/type_traits/is_member_function_pointer.hpp +2 -2
  402. data/ext/boost/type_traits/is_member_pointer.hpp +2 -2
  403. data/ext/boost/type_traits/is_pod.hpp +11 -3
  404. data/ext/boost/type_traits/is_pointer.hpp +2 -2
  405. data/ext/boost/type_traits/is_signed.hpp +8 -3
  406. data/ext/boost/type_traits/is_union.hpp +8 -0
  407. data/ext/boost/type_traits/is_unsigned.hpp +9 -4
  408. data/ext/boost/type_traits/is_volatile.hpp +5 -5
  409. data/ext/boost/type_traits/remove_cv.hpp +4 -3
  410. data/ext/boost/type_traits/remove_pointer.hpp +51 -2
  411. data/ext/boost/type_traits/remove_reference.hpp +2 -2
  412. data/ext/boost/type_traits/type_with_alignment.hpp +8 -2
  413. data/ext/boost/utility/declval.hpp +44 -0
  414. data/ext/boost/utility/detail/in_place_factory_prefix.hpp +36 -0
  415. data/ext/boost/utility/detail/in_place_factory_suffix.hpp +23 -0
  416. data/ext/boost/utility/detail/result_of_iterate.hpp +142 -0
  417. data/ext/boost/utility/in_place_factory.hpp +88 -0
  418. data/ext/boost/utility/result_of.hpp +103 -0
  419. data/ext/boost/utility/swap.hpp +55 -0
  420. data/ext/common/AnsiColorConstants.h +36 -0
  421. data/ext/common/ApplicationPool2/Common.h +87 -0
  422. data/ext/common/ApplicationPool2/ComponentInfo.h +53 -0
  423. data/ext/common/ApplicationPool2/Group.h +648 -0
  424. data/ext/common/ApplicationPool2/Implementation.cpp +580 -0
  425. data/ext/common/ApplicationPool2/Options.h +576 -0
  426. data/ext/common/ApplicationPool2/PipeWatcher.h +61 -0
  427. data/ext/common/ApplicationPool2/Pool.h +1181 -0
  428. data/ext/common/ApplicationPool2/Process.h +425 -0
  429. data/ext/common/ApplicationPool2/README.md +96 -0
  430. data/ext/common/ApplicationPool2/Session.h +158 -0
  431. data/ext/common/ApplicationPool2/Socket.h +246 -0
  432. data/ext/common/ApplicationPool2/Spawner.h +2212 -0
  433. data/ext/common/ApplicationPool2/SuperGroup.h +749 -0
  434. data/ext/common/BackgroundEventLoop.cpp +129 -0
  435. data/ext/common/BackgroundEventLoop.h +61 -0
  436. data/ext/common/Constants.h +3 -1
  437. data/ext/common/EventedBufferedInput.h +331 -0
  438. data/ext/common/EventedMessageServer.h +17 -34
  439. data/ext/common/EventedServer.h +2 -2
  440. data/ext/common/Exceptions.h +71 -19
  441. data/ext/common/FileDescriptor.h +8 -6
  442. data/ext/common/HttpConstants.h +167 -0
  443. data/ext/common/IniFile.h +24 -0
  444. data/ext/common/Logging.h +62 -849
  445. data/ext/common/MessageReadersWriters.h +19 -0
  446. data/ext/common/MessageServer.h +11 -14
  447. data/ext/common/MultiLibeio.cpp +198 -0
  448. data/ext/common/MultiLibeio.h +67 -0
  449. data/ext/common/ResourceLocator.h +24 -41
  450. data/ext/common/SafeLibev.h +186 -14
  451. data/ext/common/StaticString.h +23 -3
  452. data/ext/common/UnionStation.h +972 -0
  453. data/ext/common/Utils.cpp +168 -24
  454. data/ext/common/Utils.h +25 -3
  455. data/ext/common/Utils/CachedFileStat.hpp +4 -3
  456. data/ext/common/Utils/FileChangeChecker.h +2 -2
  457. data/ext/common/Utils/HashMap.h +50 -0
  458. data/ext/common/Utils/IOUtils.cpp +229 -68
  459. data/ext/common/Utils/IOUtils.h +134 -3
  460. data/ext/common/Utils/Lock.h +28 -0
  461. data/ext/common/Utils/MemoryBarrier.h +52 -0
  462. data/ext/common/Utils/PriorityQueue.h +54 -0
  463. data/ext/common/Utils/ProcessMetricsCollector.h +9 -11
  464. data/ext/common/Utils/ScopeGuard.h +50 -1
  465. data/ext/common/Utils/SmallVector.h +653 -0
  466. data/ext/common/Utils/StrIntUtils.cpp +26 -2
  467. data/ext/common/Utils/StrIntUtils.h +18 -2
  468. data/ext/common/Utils/StringMap.h +125 -8
  469. data/ext/common/Utils/Template.h +212 -0
  470. data/ext/common/Utils/fib.c +699 -0
  471. data/ext/common/Utils/fib.h +101 -0
  472. data/ext/common/Utils/fibpriv.h +67 -0
  473. data/ext/common/Utils/json-forwards.h +249 -0
  474. data/ext/common/Utils/json.h +1855 -0
  475. data/ext/common/Utils/jsoncpp.cpp +4230 -0
  476. data/ext/common/agents/Base.cpp +1126 -0
  477. data/ext/common/{AgentBase.h → agents/Base.h} +5 -1
  478. data/ext/common/agents/EnvPrinter.c +16 -0
  479. data/ext/common/agents/HelperAgent/AgentOptions.h +81 -0
  480. data/ext/common/{HelperAgent → agents/HelperAgent}/BacktracesServer.h +3 -2
  481. data/ext/common/agents/HelperAgent/FileBackedPipe.h +732 -0
  482. data/ext/common/agents/HelperAgent/Main.cpp +497 -0
  483. data/ext/common/agents/HelperAgent/RequestHandler.cpp +283 -0
  484. data/ext/common/agents/HelperAgent/RequestHandler.h +2139 -0
  485. data/ext/common/agents/HelperAgent/ScgiRequestParser.h +451 -0
  486. data/ext/common/{LoggingAgent → agents/LoggingAgent}/DataStoreId.h +1 -1
  487. data/ext/common/{LoggingAgent → agents/LoggingAgent}/FilterSupport.cpp +1 -1
  488. data/ext/common/{LoggingAgent → agents/LoggingAgent}/FilterSupport.h +0 -0
  489. data/ext/common/{LoggingAgent → agents/LoggingAgent}/LoggingServer.h +18 -16
  490. data/ext/common/{LoggingAgent → agents/LoggingAgent}/Main.cpp +15 -13
  491. data/ext/common/{LoggingAgent → agents/LoggingAgent}/RemoteSender.h +6 -6
  492. data/ext/common/agents/SpawnPreparer.cpp +127 -0
  493. data/ext/common/{Watchdog.cpp → agents/Watchdog/Main.cpp} +63 -25
  494. data/ext/libeio/Changes +72 -0
  495. data/ext/{google/COPYING → libeio/LICENSE} +17 -9
  496. data/ext/libeio/Makefile.am +15 -0
  497. data/ext/libeio/Makefile.in +694 -0
  498. data/ext/libeio/aclocal.m4 +9418 -0
  499. data/ext/libeio/autogen.sh +3 -0
  500. data/ext/libeio/config.guess +1501 -0
  501. data/ext/libeio/config.h.in +136 -0
  502. data/ext/libeio/config.sub +1705 -0
  503. data/ext/libeio/configure +14822 -0
  504. data/ext/libeio/configure.ac +22 -0
  505. data/ext/libeio/demo.c +194 -0
  506. data/ext/libeio/ecb.h +457 -0
  507. data/ext/libeio/eio.c +2816 -0
  508. data/ext/libeio/eio.h +411 -0
  509. data/ext/libeio/install-sh +520 -0
  510. data/ext/libeio/libeio.m4 +211 -0
  511. data/ext/libeio/ltmain.sh +9636 -0
  512. data/ext/libeio/missing +376 -0
  513. data/ext/libeio/xthread.h +166 -0
  514. data/ext/libev/Changes +125 -7
  515. data/ext/libev/Makefile.am +5 -3
  516. data/ext/libev/Makefile.in +209 -120
  517. data/ext/libev/aclocal.m4 +6027 -4619
  518. data/ext/libev/autogen.sh +1 -4
  519. data/ext/libev/config.h.in +11 -7
  520. data/ext/libev/configure +7312 -14993
  521. data/ext/libev/configure.ac +12 -5
  522. data/ext/libev/depcomp +630 -0
  523. data/ext/libev/ev++.h +48 -32
  524. data/ext/libev/ev.c +1173 -391
  525. data/ext/libev/ev.h +315 -181
  526. data/ext/libev/ev_epoll.c +66 -15
  527. data/ext/libev/ev_kqueue.c +20 -18
  528. data/ext/libev/ev_poll.c +27 -23
  529. data/ext/libev/ev_port.c +39 -19
  530. data/ext/libev/ev_select.c +23 -17
  531. data/ext/libev/ev_vars.h +25 -8
  532. data/ext/libev/ev_win32.c +6 -6
  533. data/ext/libev/ev_wrap.h +22 -2
  534. data/ext/libev/event.c +18 -17
  535. data/ext/libev/event.h +16 -4
  536. data/ext/libev/libev.m4 +10 -6
  537. data/ext/libev/ltmain.sh +7353 -5811
  538. data/ext/nginx/Configuration.c +74 -42
  539. data/ext/nginx/Configuration.h +3 -5
  540. data/ext/nginx/ContentHandler.c +26 -83
  541. data/ext/nginx/ContentHandler.h +1 -1
  542. data/ext/nginx/config +13 -9
  543. data/ext/nginx/ngx_http_passenger_module.c +3 -7
  544. data/ext/oxt/detail/backtrace_enabled.hpp +5 -102
  545. data/ext/oxt/detail/context.hpp +90 -0
  546. data/ext/oxt/detail/spin_lock_darwin.hpp +4 -0
  547. data/ext/oxt/detail/spin_lock_gcc_x86.hpp +4 -0
  548. data/ext/oxt/detail/spin_lock_pthreads.hpp +14 -0
  549. data/ext/oxt/detail/tracable_exception_enabled.hpp +2 -2
  550. data/ext/oxt/dynamic_thread_group.hpp +27 -1
  551. data/ext/oxt/implementation.cpp +415 -0
  552. data/ext/oxt/{thread.cpp → initialize.hpp} +13 -6
  553. data/ext/oxt/macros.hpp +32 -1
  554. data/ext/oxt/spin_lock.hpp +6 -11
  555. data/ext/oxt/system_calls.cpp +204 -16
  556. data/ext/oxt/system_calls.hpp +85 -45
  557. data/ext/oxt/thread.hpp +13 -117
  558. data/ext/ruby/passenger_native_support.c +82 -237
  559. data/helper-scripts/backtrace-sanitizer.rb +114 -0
  560. data/helper-scripts/classic-rails-loader.rb +135 -0
  561. data/helper-scripts/classic-rails-preloader.rb +161 -0
  562. data/helper-scripts/node-loader.js +314 -0
  563. data/helper-scripts/rack-loader.rb +104 -0
  564. data/helper-scripts/rack-preloader.rb +132 -0
  565. data/helper-scripts/wsgi-loader.py +231 -0
  566. data/helper-scripts/wsgi-preloader.py +1 -0
  567. data/lib/phusion_passenger.rb +159 -61
  568. data/lib/phusion_passenger/abstract_installer.rb +182 -87
  569. data/lib/phusion_passenger/admin_tools/server_instance.rb +25 -19
  570. data/lib/phusion_passenger/analytics_logger.rb +5 -4
  571. data/lib/phusion_passenger/classic_rails/{request_handler.rb → thread_handler_extension.rb} +4 -40
  572. data/lib/phusion_passenger/classic_rails_extensions/init.rb +5 -3
  573. data/lib/phusion_passenger/common_library.rb +441 -0
  574. data/lib/phusion_passenger/console_text_template.rb +4 -16
  575. data/lib/phusion_passenger/constants.rb +1 -8
  576. data/lib/phusion_passenger/debug_logging.rb +5 -2
  577. data/lib/phusion_passenger/dependencies.rb +51 -13
  578. data/lib/phusion_passenger/loader_shared_helpers.rb +318 -0
  579. data/lib/phusion_passenger/message_channel.rb +3 -47
  580. data/lib/phusion_passenger/message_client.rb +2 -2
  581. data/lib/phusion_passenger/native_support.rb +36 -15
  582. data/lib/phusion_passenger/packaging.rb +8 -11
  583. data/lib/phusion_passenger/platform_info.rb +25 -17
  584. data/lib/phusion_passenger/platform_info/apache.rb +10 -7
  585. data/lib/phusion_passenger/platform_info/binary_compatibility.rb +10 -30
  586. data/lib/phusion_passenger/platform_info/compiler.rb +93 -34
  587. data/lib/phusion_passenger/platform_info/ruby.rb +37 -97
  588. data/lib/phusion_passenger/preloader_shared_helpers.rb +121 -0
  589. data/lib/phusion_passenger/public_api.rb +1 -4
  590. data/lib/phusion_passenger/rack/{request_handler.rb → thread_handler_extension.rb} +14 -63
  591. data/lib/phusion_passenger/rails3_extensions/init.rb +9 -8
  592. data/lib/phusion_passenger/request_handler.rb +500 -0
  593. data/lib/phusion_passenger/request_handler/thread_handler.rb +360 -0
  594. data/lib/phusion_passenger/ruby_core_enhancements.rb +142 -0
  595. data/lib/phusion_passenger/standalone/command.rb +36 -15
  596. data/lib/phusion_passenger/standalone/package_runtime_command.rb +16 -8
  597. data/lib/phusion_passenger/standalone/runtime_installer.rb +169 -72
  598. data/lib/phusion_passenger/standalone/start_command.rb +44 -39
  599. data/lib/phusion_passenger/standalone/utils.rb +5 -5
  600. data/lib/phusion_passenger/utils.rb +35 -914
  601. data/lib/phusion_passenger/utils/ansi_colors.rb +59 -0
  602. data/lib/phusion_passenger/utils/file_system_watcher.rb +1 -1
  603. data/lib/phusion_passenger/utils/robust_interruption.rb +134 -0
  604. data/lib/phusion_passenger/utils/tee_input.rb +174 -0
  605. data/lib/phusion_passenger/utils/tmpio.rb +33 -0
  606. data/lib/phusion_passenger/utils/unseekable_socket.rb +6 -0
  607. data/resources/mime.types +5 -1
  608. data/{lib/phusion_passenger/templates → resources}/standalone_default_root/index.html +0 -0
  609. data/{lib/phusion_passenger → resources}/templates/apache2/apache_must_be_compiled_with_compatible_mpm.txt.erb +0 -0
  610. data/{lib/phusion_passenger → resources}/templates/apache2/config_snippets.txt.erb +0 -0
  611. data/{lib/phusion_passenger → resources}/templates/apache2/deployment_example.txt.erb +0 -0
  612. data/{lib/phusion_passenger → resources}/templates/apache2/no_write_permission_to_passenger_root.txt.erb +0 -0
  613. data/{lib/phusion_passenger → resources}/templates/apache2/possible_solutions_for_compilation_and_installation_problems.txt.erb +0 -0
  614. data/{lib/phusion_passenger → resources}/templates/apache2/run_installer_as_root.txt.erb +0 -0
  615. data/{lib/phusion_passenger → resources}/templates/apache2/welcome.txt.erb +0 -0
  616. data/{lib/phusion_passenger → resources}/templates/error_layout.css +6 -0
  617. data/resources/templates/error_layout.html.template +89 -0
  618. data/resources/templates/general_error.html.template +1 -0
  619. data/resources/templates/general_error_with_html.html.template +1 -0
  620. data/{lib/phusion_passenger → resources}/templates/nginx/ask_for_extra_configure_flags.txt.erb +0 -0
  621. data/{lib/phusion_passenger → resources}/templates/nginx/cannot_write_to_dir.txt.erb +0 -0
  622. data/{lib/phusion_passenger → resources}/templates/nginx/config_snippets.txt.erb +0 -0
  623. data/{lib/phusion_passenger → resources}/templates/nginx/config_snippets_inserted.txt.erb +0 -0
  624. data/{lib/phusion_passenger → resources}/templates/nginx/confirm_extra_configure_flags.txt.erb +0 -0
  625. data/{lib/phusion_passenger → resources}/templates/nginx/deployment_example.txt.erb +0 -0
  626. data/resources/templates/nginx/not_available_when_natively_packaged.txt.erb +8 -0
  627. data/{lib/phusion_passenger → resources}/templates/nginx/pcre_could_not_be_downloaded.txt.erb +0 -0
  628. data/{lib/phusion_passenger → resources}/templates/nginx/pcre_could_not_be_extracted.txt.erb +0 -0
  629. data/{lib/phusion_passenger → resources}/templates/nginx/possible_solutions_for_compilation_and_installation_problems.txt.erb +0 -0
  630. data/{lib/phusion_passenger → resources}/templates/nginx/possible_solutions_for_download_and_extraction_problems.txt.erb +0 -0
  631. data/{lib/phusion_passenger → resources}/templates/nginx/query_download_and_install.txt.erb +0 -0
  632. data/{lib/phusion_passenger → resources}/templates/nginx/run_installer_as_root.txt.erb +0 -0
  633. data/{lib/phusion_passenger → resources}/templates/nginx/welcome.txt.erb +0 -0
  634. data/{lib/phusion_passenger → resources}/templates/standalone/cannot_write_to_dir.txt.erb +0 -0
  635. data/{lib/phusion_passenger → resources}/templates/standalone/config.erb +26 -5
  636. data/{lib/phusion_passenger → resources}/templates/standalone/possible_solutions_for_download_and_extraction_problems.txt.erb +0 -0
  637. data/{lib/phusion_passenger → resources}/templates/standalone/run_installer_as_root.txt.erb +0 -0
  638. data/{lib/phusion_passenger → resources}/templates/standalone/welcome.txt.erb +0 -0
  639. data/resources/templates/undisclosed_error.html.template +25 -0
  640. data/test/config.json.example +42 -0
  641. data/test/cxx/ApplicationPool2/DirectSpawnerTest.cpp +86 -0
  642. data/test/cxx/ApplicationPool2/OptionsTest.cpp +44 -0
  643. data/test/cxx/ApplicationPool2/PoolTest.cpp +1234 -0
  644. data/test/cxx/ApplicationPool2/ProcessTest.cpp +131 -0
  645. data/test/cxx/ApplicationPool2/SmartSpawnerTest.cpp +229 -0
  646. data/test/cxx/ApplicationPool2/SpawnerTestCases.cpp +744 -0
  647. data/test/cxx/BufferedIOTest.cpp +7 -7
  648. data/test/cxx/CxxTestMain.cpp +65 -2
  649. data/test/cxx/FileBackedPipeTest.cpp +626 -0
  650. data/test/cxx/FileChangeCheckerTest.cpp +20 -18
  651. data/test/cxx/FilterSupportTest.cpp +5 -5
  652. data/test/cxx/IOUtilsTest.cpp +11 -4
  653. data/test/cxx/MessageReadersWritersTest.cpp +1 -1
  654. data/test/cxx/MessageServerTest.cpp +31 -30
  655. data/test/cxx/RequestHandlerTest.cpp +777 -0
  656. data/test/cxx/ScgiRequestParserTest.cpp +36 -16
  657. data/test/cxx/ServerInstanceDirTest.cpp +1 -1
  658. data/test/cxx/StringMapTest.cpp +61 -0
  659. data/test/cxx/TemplateTest.cpp +118 -0
  660. data/test/cxx/TestSupport.cpp +25 -68
  661. data/test/cxx/TestSupport.h +81 -41
  662. data/test/cxx/{LoggingTest.cpp → UnionStationTest.cpp} +79 -74
  663. data/test/cxx/UtilsTest.cpp +59 -5
  664. data/test/integration_tests/apache2_tests.rb +2 -2
  665. data/test/integration_tests/nginx_tests.rb +1 -1
  666. data/test/integration_tests/spec_helper.rb +7 -5
  667. data/test/oxt/oxt_test_main.cpp +2 -0
  668. data/test/oxt/syscall_interruption_test.cpp +1 -0
  669. data/test/ruby/classic_rails/loader_spec.rb +48 -0
  670. data/test/ruby/classic_rails/preloader_spec.rb +54 -0
  671. data/test/ruby/rack/loader_spec.rb +62 -0
  672. data/test/ruby/rack/preloader_spec.rb +74 -0
  673. data/test/ruby/{abstract_request_handler_spec.rb → request_handler_spec.rb} +31 -68
  674. data/test/ruby/shared/loader_spec.rb +241 -0
  675. data/test/ruby/shared/rails/analytics_logging_extensions_spec.rb +141 -182
  676. data/test/ruby/shared/ruby_loader_spec.rb +55 -0
  677. data/test/ruby/spec_helper.rb +8 -53
  678. data/test/ruby/utils/file_system_watcher_spec.rb +9 -1
  679. data/test/ruby/utils_spec.rb +10 -683
  680. data/test/stub/rack/config.ru +28 -3
  681. data/test/stub/rack/start.rb +47 -0
  682. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/Rakefile +0 -0
  683. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/app/controllers/application_controller.rb +0 -2
  684. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/app/controllers/bar_controller_1.rb +0 -0
  685. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/app/controllers/bar_controller_2.rb +0 -0
  686. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/app/controllers/foo_controller.rb +0 -0
  687. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/app/helpers/application_helper.rb +0 -0
  688. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/config/boot.rb +0 -0
  689. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/config/database.yml +3 -3
  690. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/config/environment.rb +5 -2
  691. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/config/environments/development.rb +0 -0
  692. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/config/environments/production.rb +0 -0
  693. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/config/environments/staging.rb +0 -0
  694. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/config/initializers/inflections.rb +0 -0
  695. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/config/initializers/mime_types.rb +0 -0
  696. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/config/routes.rb +1 -0
  697. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/script/about +0 -0
  698. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/script/console +0 -0
  699. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/script/dbconsole +0 -0
  700. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/script/destroy +0 -0
  701. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/script/generate +0 -0
  702. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/script/performance/benchmarker +0 -0
  703. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/script/performance/profiler +0 -0
  704. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/script/performance/request +0 -0
  705. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/script/plugin +0 -0
  706. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/script/process/inspector +0 -0
  707. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/script/process/reaper +0 -0
  708. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/script/process/spawner +0 -0
  709. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/script/runner +0 -0
  710. data/test/stub/{rails_apps/2.3/foobar → rails2.3}/script/server +0 -0
  711. data/test/stub/{rails_apps/3.0/empty → rails3.0}/Gemfile +0 -0
  712. data/test/stub/rails3.0/Gemfile.lock +80 -0
  713. data/test/stub/{rails_apps/3.0/empty → rails3.0}/Rakefile +0 -0
  714. data/test/stub/{rails_apps/3.0/empty → rails3.0}/app/controllers/application_controller.rb +0 -0
  715. data/test/stub/{rails_apps/3.0/empty → rails3.0}/app/helpers/application_helper.rb +0 -0
  716. data/test/stub/{rails_apps/3.0/empty → rails3.0}/app/views/layouts/application.html.erb +0 -0
  717. data/test/stub/{rails_apps/3.0/empty → rails3.0}/config.ru +0 -0
  718. data/test/stub/{rails_apps/3.0/empty → rails3.0}/config/application.rb +0 -0
  719. data/test/stub/{rails_apps/3.0/empty → rails3.0}/config/boot.rb +0 -0
  720. data/test/stub/{rails_apps/3.0/empty → rails3.0}/config/database.yml +0 -0
  721. data/test/stub/{rails_apps/3.0/empty → rails3.0}/config/environment.rb +0 -0
  722. data/test/stub/{rails_apps/3.0/empty → rails3.0}/config/environments/development.rb +0 -0
  723. data/test/stub/{rails_apps/3.0/empty → rails3.0}/config/environments/production.rb +0 -0
  724. data/test/stub/{rails_apps/3.0/empty → rails3.0}/config/environments/test.rb +0 -0
  725. data/test/stub/{rails_apps/3.0/empty → rails3.0}/config/initializers/backtrace_silencers.rb +0 -0
  726. data/test/stub/{rails_apps/3.0/empty → rails3.0}/config/initializers/inflections.rb +0 -0
  727. data/test/stub/{rails_apps/3.0/empty → rails3.0}/config/initializers/mime_types.rb +0 -0
  728. data/test/stub/{rails_apps/3.0/empty → rails3.0}/config/initializers/passenger.rb +0 -0
  729. data/test/stub/{rails_apps/3.0/empty → rails3.0}/config/initializers/secret_token.rb +0 -0
  730. data/test/stub/{rails_apps/3.0/empty → rails3.0}/config/initializers/session_store.rb +0 -0
  731. data/test/stub/{rails_apps/3.0/empty → rails3.0}/config/locales/en.yml +0 -0
  732. data/test/stub/{rails_apps/3.0/empty → rails3.0}/config/routes.rb +0 -0
  733. data/test/stub/{rails_apps/3.0/empty → rails3.0}/db/seeds.rb +0 -0
  734. data/test/stub/{rails_apps/3.0/empty → rails3.0}/doc/README_FOR_APP +0 -0
  735. data/test/stub/{rails_apps/3.0/empty → rails3.0}/public/404.html +0 -0
  736. data/test/stub/{rails_apps/3.0/empty → rails3.0}/public/422.html +0 -0
  737. data/test/stub/{rails_apps/3.0/empty → rails3.0}/public/500.html +0 -0
  738. data/test/stub/{rails_apps/3.0/empty → rails3.0}/public/favicon.ico +0 -0
  739. data/test/stub/{rails_apps/3.0/empty → rails3.0}/public/index.html +0 -0
  740. data/test/stub/{rails_apps/3.0/empty → rails3.0}/public/robots.txt +0 -0
  741. data/test/stub/{rails_apps/3.0/empty → rails3.0}/script/rails +0 -0
  742. data/test/stub/{rails_apps/3.0/empty → rails3.0}/test/performance/browsing_test.rb +0 -0
  743. data/test/stub/{rails_apps/3.0/empty → rails3.0}/test/test_helper.rb +0 -0
  744. data/test/stub/start_error.pl +24 -0
  745. data/test/stub/wsgi/passenger_wsgi.py +71 -3
  746. data/test/support/apache2_controller.rb +2 -2
  747. data/test/support/placebo-preloader.rb +88 -0
  748. data/test/support/test_helper.rb +1 -14
  749. data/test/tut/tut.h +11 -4
  750. metadata +590 -326
  751. data.tar.gz.asc +0 -12
  752. data/PACKAGING.TXT +0 -25
  753. data/build/config.rb +0 -46
  754. data/ext/apache2/HelperAgent.cpp +0 -364
  755. data/ext/boost/call_traits.hpp +0 -24
  756. data/ext/boost/detail/call_traits.hpp +0 -164
  757. data/ext/common/AbstractSpawnManager.h +0 -110
  758. data/ext/common/AgentBase.cpp +0 -432
  759. data/ext/common/ApplicationPool/Client.h +0 -788
  760. data/ext/common/ApplicationPool/Interface.h +0 -295
  761. data/ext/common/ApplicationPool/Pool.h +0 -1327
  762. data/ext/common/ApplicationPool/Server.h +0 -479
  763. data/ext/common/MessageChannel.h +0 -494
  764. data/ext/common/PoolOptions.h +0 -518
  765. data/ext/common/Process.h +0 -253
  766. data/ext/common/Session.h +0 -436
  767. data/ext/common/SpawnManager.h +0 -611
  768. data/ext/google/ChangeLog +0 -167
  769. data/ext/google/dense_hash_map +0 -310
  770. data/ext/google/dense_hash_set +0 -287
  771. data/ext/google/sparse_hash_map +0 -294
  772. data/ext/google/sparse_hash_set +0 -275
  773. data/ext/google/sparsehash/densehashtable.h +0 -1062
  774. data/ext/google/sparsehash/sparseconfig.h +0 -55
  775. data/ext/google/sparsehash/sparsehashtable.h +0 -1015
  776. data/ext/google/sparsetable +0 -1468
  777. data/ext/google/type_traits.h +0 -250
  778. data/ext/nginx/HelperAgent.cpp +0 -1355
  779. data/ext/nginx/ScgiRequestParser.h +0 -375
  780. data/ext/oxt/backtrace.cpp +0 -185
  781. data/ext/oxt/tracable_exception.cpp +0 -89
  782. data/helper-scripts/passenger-spawn-server +0 -106
  783. data/lib/phusion_passenger/abstract_request_handler.rb +0 -766
  784. data/lib/phusion_passenger/abstract_server.rb +0 -372
  785. data/lib/phusion_passenger/abstract_server_collection.rb +0 -335
  786. data/lib/phusion_passenger/app_process.rb +0 -174
  787. data/lib/phusion_passenger/classic_rails/application_spawner.rb +0 -344
  788. data/lib/phusion_passenger/classic_rails/framework_spawner.rb +0 -311
  789. data/lib/phusion_passenger/exceptions.rb +0 -103
  790. data/lib/phusion_passenger/html_template.rb +0 -107
  791. data/lib/phusion_passenger/rack/application_spawner.rb +0 -231
  792. data/lib/phusion_passenger/spawn_manager.rb +0 -359
  793. data/lib/phusion_passenger/templates/app_exited_during_initialization.html.erb +0 -38
  794. data/lib/phusion_passenger/templates/app_init_error.html.erb +0 -64
  795. data/lib/phusion_passenger/templates/database_error.html.erb +0 -66
  796. data/lib/phusion_passenger/templates/error_layout.html.erb +0 -39
  797. data/lib/phusion_passenger/templates/framework_init_error.html.erb +0 -39
  798. data/lib/phusion_passenger/templates/general_error.html.erb +0 -22
  799. data/lib/phusion_passenger/templates/load_error.html.erb +0 -46
  800. data/lib/phusion_passenger/templates/version_not_found.html.erb +0 -34
  801. data/lib/phusion_passenger/utils/rewindable_input.rb +0 -125
  802. data/lib/phusion_passenger/wsgi/application_spawner.rb +0 -108
  803. data/test/config.yml.example +0 -41
  804. data/test/cxx/ApplicationPool_PoolTest.cpp +0 -33
  805. data/test/cxx/ApplicationPool_PoolTestCases.cpp +0 -1029
  806. data/test/cxx/ApplicationPool_ServerTest.cpp +0 -308
  807. data/test/cxx/ApplicationPool_Server_PoolTest.cpp +0 -80
  808. data/test/cxx/MessageChannelTest.cpp +0 -557
  809. data/test/cxx/PoolOptionsTest.cpp +0 -116
  810. data/test/cxx/SpawnManagerTest.cpp +0 -161
  811. data/test/ruby/abstract_server_collection_spec.rb +0 -247
  812. data/test/ruby/abstract_server_spec.rb +0 -61
  813. data/test/ruby/app_process_spec.rb +0 -43
  814. data/test/ruby/classic_rails/application_spawner_spec.rb +0 -89
  815. data/test/ruby/classic_rails/framework_spawner_spec.rb +0 -92
  816. data/test/ruby/rack/application_spawner_spec.rb +0 -116
  817. data/test/ruby/shared/abstract_server_spec.rb +0 -23
  818. data/test/ruby/shared/spawners/classic_rails/framework_spawner_spec.rb +0 -38
  819. data/test/ruby/shared/spawners/classic_rails/lack_of_rails_gem_version_spec.rb +0 -19
  820. data/test/ruby/shared/spawners/classic_rails/spawner_spec.rb +0 -15
  821. data/test/ruby/shared/spawners/non_preloading_spawner_spec.rb +0 -27
  822. data/test/ruby/shared/spawners/preloading_spawner_spec.rb +0 -29
  823. data/test/ruby/shared/spawners/reload_all_spec.rb +0 -36
  824. data/test/ruby/shared/spawners/reload_single_spec.rb +0 -52
  825. data/test/ruby/shared/spawners/spawn_server_spec.rb +0 -28
  826. data/test/ruby/shared/spawners/spawner_spec.rb +0 -273
  827. data/test/ruby/shared/utils/pseudo_io_spec.rb +0 -60
  828. data/test/ruby/spawn_manager_spec.rb +0 -134
  829. data/test/ruby/wsgi/application_spawner_spec.rb +0 -50
  830. data/test/stub/message_channel.rb +0 -11
  831. data/test/stub/message_channel_2.rb +0 -12
  832. data/test/stub/message_channel_3.rb +0 -19
  833. data/test/stub/rails_apps/3.0/empty/Gemfile.lock +0 -73
  834. data/test/stub/spawn_server.rb +0 -22
  835. metadata.gz.asc +0 -12
@@ -1,9 +1,9 @@
1
1
  <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
- <meta name="generator" content="AsciiDoc 8.6.7">
6
- <title>Phusion Passenger users guide</title>
2
+ <html lang="en">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <meta name="generator" content="AsciiDoc 8.6.7">
6
+ <title>Phusion Passenger users guide, Apache version</title>
7
7
  <style type="text/css">
8
8
  /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
9
9
 
@@ -603,7 +603,7 @@ div.exampleblock > div.content, div.sidebarblock > div.content, div.listingblock
603
603
  div.verseblock { border-left-width: 0; margin-left: 3em; }
604
604
  div.quoteblock { border-left-width: 3px; margin-left: 0; margin-right: 0;}
605
605
  div.admonitionblock td.content { border-left: 3px solid #E8E8E8; }
606
- </style>
606
+ </style>
607
607
  <script type="text/javascript">
608
608
  /*<![CDATA[*/
609
609
  var asciidoc = { // Namespace.
@@ -795,14 +795,11 @@ install: function(toclevels) {
795
795
  }
796
796
 
797
797
  }
798
- asciidoc.install();
798
+ asciidoc.install(3);
799
799
  /*]]>*/
800
- </script>
801
- <style type="text/css">
800
+ </script><style type="text/css">
802
801
  body {
803
- margin: 1em auto 1em auto;
804
- padding: 0 1em 0 1em;
805
- max-width: 800px;
802
+ margin: 1em 10% 1em 10%;
806
803
  }
807
804
 
808
805
  a.image {
@@ -881,10 +878,6 @@ a.image {
881
878
  margin: 2em;
882
879
  }
883
880
 
884
- pre {
885
- overflow: auto;
886
- }
887
-
888
881
  @media print {
889
882
  body {
890
883
  font-size: 18pt;
@@ -1045,40 +1038,27 @@ pre {
1045
1038
  border-bottom-right-radius: 0;
1046
1039
  }
1047
1040
 
1048
- /* http://nicolasgallagher.com/jump-links-and-viewport-positioning/ */
1049
- .anchor_helper {
1050
- position: relative;
1051
- display: block;
1052
- top: -50px;
1053
- width: 1px;
1054
- height: 1px;
1055
- }
1056
-
1057
1041
  </style>
1058
- </head>
1042
+ </head>
1059
1043
  <body class="article">
1060
1044
  <div id="topbar" style="display: none">
1061
1045
  <div class="title">
1062
- <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAKCAYAAAEV95QVAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sGCRMSACDxkZwAAAAidEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVAgb24gYSBNYWOHqHdDAAAAZUlEQVQY032PSxbAIAjEIlfygL6ePF3UUvpzNjgSYWwqAMEhUQnANnsC7TQPeJpsVWzMuh2sog4vDTUbqP081zECrW4dtdaQGSIKlWluPyjK+VXxAz5XfcKufCzA130AfQHWB30HZxlPaP080xsAAAAASUVORK5CYII=" width="11" height="10" alt="">
1063
- <a href="javascript:void(Mizuho.smoothlyScrollToToc())">Phusion Passenger users guide</a>
1046
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAKCAYAAAEV95QVAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sGCRMSACDxkZwAAAAidEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVAgb24gYSBNYWOHqHdDAAAAZUlEQVQY032PSxbAIAjEIlfygL6ePF3UUvpzNjgSYWwqAMEhUQnANnsC7TQPeJpsVWzMuh2sog4vDTUbqP081zECrW4dtdaQGSIKlWluPyjK+VXxAz5XfcKufCzA130AfQHWB30HZxlPaP080xsAAAAASUVORK5CYII=" width="11" height="10" alt=""><a href="javascript:void(Mizuho.smoothlyScrollToToc())">Phusion Passenger users guide, Apache version</a>
1064
1047
  </div>
1065
1048
  <a href="javascript:void(0)" id="current_section"></a>
1066
1049
  </div>
1067
1050
  <div id="header">
1068
- <h1>Phusion Passenger users guide</h1>
1051
+ <h1>Phusion Passenger users guide, Apache version</h1>
1069
1052
  <div id="preamble">
1070
1053
  <div class="sectionbody">
1071
1054
  <div class="paragraph"><p><span class="image">
1072
1055
  <a class="image" href="http://www.phusion.nl/">
1073
- <img src="images/phusion_banner.png" alt="images/phusion_banner.png">
1074
- </a>
1056
+ <img src="images/phusion_banner.png" alt="images/phusion_banner.png"></a>
1075
1057
  </span></p></div>
1076
- <div class="paragraph"><p>Phusion Passenger is an Apache module, which makes deploying Ruby and Ruby on
1077
- Rails applications on Apache a breeze. It follows the usual Ruby on Rails
1078
- conventions, such as "Don’t-Repeat-Yourself" and ease of setup, while at the
1079
- same time providing enough flexibility.</p></div>
1058
+ <div class="paragraph"><p>Phusion Passenger is an application server which can directly integrate into Apache. It is designed to be easy to use, fast, stable and reliable and is used by <a href="http://trends.builtwith.com/Web-Server/Phusion-Passenger">hundreds of thousands of websites</a> all over the world.</p></div>
1059
+ <div class="paragraph"><p>Phusion Passenger is a so-called polyglot application server because it supports applications written in multiple programming languages. At this time, Ruby and Python are supported.</p></div>
1080
1060
  <div class="paragraph"><p>This users guide will teach you:</p></div>
1081
- <div class="ulist"><ul>
1061
+ <div class="ulist"><ul>
1082
1062
  <li>
1083
1063
  <p>
1084
1064
  How to install Phusion Passenger.
@@ -1091,12 +1071,7 @@ How to configure Phusion Passenger.
1091
1071
  </li>
1092
1072
  <li>
1093
1073
  <p>
1094
- How to deploy a Ruby on Rails application.
1095
- </p>
1096
- </li>
1097
- <li>
1098
- <p>
1099
- How to deploy a <a href="http://rack.rubyforge.org/">Rack</a>-based Ruby application.
1074
+ How to deploy Ruby and Python applications.
1100
1075
  </p>
1101
1076
  </li>
1102
1077
  <li>
@@ -1106,177 +1081,33 @@ How to solve common problems.
1106
1081
  </li>
1107
1082
  </ul></div>
1108
1083
  <div class="paragraph"><p>This guide assumes that the reader is somewhat familiar with Apache and with
1109
- using the commandline.</p></div>
1084
+ using the command line.</p></div>
1085
+ </div>
1110
1086
  </div>
1111
- </div>
1112
1087
  <div id="toc">
1113
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><div id="toctitle">Table of Contents</div>
1114
- <div class="foo toclevel2"><a href="#_support_information">1. Support information</a></div>
1115
- <div class="foo toclevel3"><a href="#_supported_operating_systems">1.1. Supported operating systems</a></div>
1116
- <div class="foo toclevel3"><a href="#_where_to_get_support">1.2. Where to get support</a></div>
1117
- <div class="foo toclevel2"><a href="#_installing_upgrading_and_uninstalling_phusion_passenger">2. Installing, upgrading and uninstalling Phusion Passenger</a></div>
1118
- <div class="foo toclevel3"><a href="#_generic_installation_instructions">2.1. Generic installation instructions</a></div>
1119
- <div class="foo toclevel4"><a href="#install_passenger">2.1.1. Overview of installation methods</a></div>
1120
- <div class="foo toclevel4"><a href="#_preparation_gem_and_source_tarball_only">2.1.2. Preparation (gem and source tarball only)</a></div>
1121
- <div class="foo toclevel4"><a href="#_installing_via_the_gem">2.1.3. Installing via the gem</a></div>
1122
- <div class="foo toclevel4"><a href="#_installing_via_the_source_tarball">2.1.4. Installing via the source tarball</a></div>
1123
- <div class="foo toclevel4"><a href="#_installing_via_a_native_linux_package">2.1.5. Installing via a native Linux package</a></div>
1124
- <div class="foo toclevel4"><a href="#_what_does_the_installer_do">2.1.6. What does the installer do?</a></div>
1125
- <div class="foo toclevel3"><a href="#_operating_system_specific_instructions_and_information">2.2. Operating system-specific instructions and information</a></div>
1126
- <div class="foo toclevel4"><a href="#_macos_x">2.2.1. MacOS X</a></div>
1127
- <div class="foo toclevel4"><a href="#_ubuntu_linux">2.2.2. Ubuntu Linux</a></div>
1128
- <div class="foo toclevel4"><a href="#_opensolaris">2.2.3. OpenSolaris</a></div>
1129
- <div class="foo toclevel3"><a href="#_upgrading_or_downgrading_phusion_passenger">2.3. Upgrading or downgrading Phusion Passenger</a></div>
1130
- <div class="foo toclevel3"><a href="#_unloading_disabling_phusion_passenger_from_apache_without_uninstalling_it">2.4. Unloading (disabling) Phusion Passenger from Apache without uninstalling it</a></div>
1131
- <div class="foo toclevel3"><a href="#_uninstalling_phusion_passenger">2.5. Uninstalling Phusion Passenger</a></div>
1132
- <div class="foo toclevel2"><a href="#_deploying_a_ruby_on_rails_1_x_or_2_x_but_not_rails_gt_3_x_application">3. Deploying a Ruby on Rails 1.x or 2.x (but NOT Rails &gt;= 3.x) application</a></div>
1133
- <div class="foo toclevel3"><a href="#_deploying_to_a_virtual_host_8217_s_root">3.1. Deploying to a virtual host’s root</a></div>
1134
- <div class="foo toclevel3"><a href="#deploying_rails_to_sub_uri">3.2. Deploying to a sub URI</a></div>
1135
- <div class="foo toclevel3"><a href="#_redeploying_restarting_the_ruby_on_rails_application">3.3. Redeploying (restarting the Ruby on Rails application)</a></div>
1136
- <div class="foo toclevel3"><a href="#_migrations">3.4. Migrations</a></div>
1137
- <div class="foo toclevel3"><a href="#_capistrano_integration">3.5. Capistrano integration</a></div>
1138
- <div class="foo toclevel2"><a href="#_deploying_a_rack_based_ruby_application_including_rails_gt_3">4. Deploying a Rack-based Ruby application (including Rails &gt;= 3)</a></div>
1139
- <div class="foo toclevel3"><a href="#_tutorial_example_writing_and_deploying_a_hello_world_rack_application">4.1. Tutorial/example: writing and deploying a Hello World Rack application</a></div>
1140
- <div class="foo toclevel3"><a href="#_deploying_to_a_virtual_host_8217_s_root_2">4.2. Deploying to a virtual host’s root</a></div>
1141
- <div class="foo toclevel3"><a href="#deploying_rack_to_sub_uri">4.3. Deploying to a sub URI</a></div>
1142
- <div class="foo toclevel3"><a href="#_redeploying_restarting_the_rack_application">4.4. Redeploying (restarting the Rack application)</a></div>
1143
- <div class="foo toclevel3"><a href="#_rackup_specifications_for_various_web_frameworks">4.5. Rackup specifications for various web frameworks</a></div>
1144
- <div class="foo toclevel4"><a href="#_camping">4.5.1. Camping</a></div>
1145
- <div class="foo toclevel4"><a href="#_halcyon">4.5.2. Halcyon</a></div>
1146
- <div class="foo toclevel4"><a href="#_mack">4.5.3. Mack</a></div>
1147
- <div class="foo toclevel4"><a href="#_merb">4.5.4. Merb</a></div>
1148
- <div class="foo toclevel4"><a href="#_ramaze">4.5.5. Ramaze</a></div>
1149
- <div class="foo toclevel4"><a href="#_sinatra">4.5.6. Sinatra</a></div>
1150
- <div class="foo toclevel2"><a href="#_configuring_phusion_passenger">5. Configuring Phusion Passenger</a></div>
1151
- <div class="foo toclevel3"><a href="#_passengerroot_lt_directory_gt">5.1. PassengerRoot &lt;directory&gt;</a></div>
1152
- <div class="foo toclevel3"><a href="#PassengerRuby">5.2. PassengerRuby &lt;filename&gt;</a></div>
1153
- <div class="foo toclevel3"><a href="#PassengerAppRoot">5.3. PassengerAppRoot &lt;path/to/root&gt;</a></div>
1154
- <div class="foo toclevel3"><a href="#PassengerSpawnMethod">5.4. PassengerSpawnMethod &lt;string&gt;</a></div>
1155
- <div class="foo toclevel3"><a href="#PassengerUseGlobalQueue">5.5. PassengerUseGlobalQueue &lt;on|off&gt;</a></div>
1156
- <div class="foo toclevel3"><a href="#_passengerenabled_lt_on_off_gt">5.6. PassengerEnabled &lt;on|off&gt;</a></div>
1157
- <div class="foo toclevel3"><a href="#PassengerTempDir">5.7. PassengerTempDir &lt;directory&gt;</a></div>
1158
- <div class="foo toclevel3"><a href="#PassengerUploadBufferDir">5.8. PassengerUploadBufferDir &lt;directory&gt;</a></div>
1159
- <div class="foo toclevel3"><a href="#_passengerrestartdir_lt_directory_gt">5.9. PassengerRestartDir &lt;directory&gt;</a></div>
1160
- <div class="foo toclevel3"><a href="#PassengerBufferResponse">5.10. PassengerBufferResponse &lt;on|off&gt;</a></div>
1161
- <div class="foo toclevel3"><a href="#PassengerRollingRestarts">5.11. PassengerRollingRestarts &lt;on|off&gt;</a></div>
1162
- <div class="foo toclevel3"><a href="#_passengerresistdeploymenterrors_lt_on_off_gt">5.12. PassengerResistDeploymentErrors &lt;on|off&gt;</a></div>
1163
- <div class="foo toclevel3"><a href="#_security_options">5.13. Security options</a></div>
1164
- <div class="foo toclevel4"><a href="#PassengerUserSwitching">5.13.1. PassengerUserSwitching &lt;on|off&gt;</a></div>
1165
- <div class="foo toclevel4"><a href="#_passengeruser_lt_username_gt">5.13.2. PassengerUser &lt;username&gt;</a></div>
1166
- <div class="foo toclevel4"><a href="#_passengergroup_lt_group_name_gt">5.13.3. PassengerGroup &lt;group name&gt;</a></div>
1167
- <div class="foo toclevel4"><a href="#PassengerDefaultUser">5.13.4. PassengerDefaultUser &lt;username&gt;</a></div>
1168
- <div class="foo toclevel4"><a href="#PassengerDefaultGroup">5.13.5. PassengerDefaultGroup &lt;group name&gt;</a></div>
1169
- <div class="foo toclevel4"><a href="#_passengerfriendlyerrorpages_lt_on_off_gt">5.13.6. PassengerFriendlyErrorPages &lt;on|off&gt;</a></div>
1170
- <div class="foo toclevel3"><a href="#_resource_control_and_optimization_options">5.14. Resource control and optimization options</a></div>
1171
- <div class="foo toclevel4"><a href="#_passengermaxpoolsize_lt_integer_gt">5.14.1. PassengerMaxPoolSize &lt;integer&gt;</a></div>
1172
- <div class="foo toclevel4"><a href="#PassengerMinInstances">5.14.2. PassengerMinInstances &lt;integer&gt;</a></div>
1173
- <div class="foo toclevel4"><a href="#_passengermaxinstances_lt_integer_gt">5.14.3. PassengerMaxInstances &lt;integer&gt;</a></div>
1174
- <div class="foo toclevel4"><a href="#_passengermaxinstancesperapp_lt_integer_gt">5.14.4. PassengerMaxInstancesPerApp &lt;integer&gt;</a></div>
1175
- <div class="foo toclevel4"><a href="#PassengerPoolIdleTime">5.14.5. PassengerPoolIdleTime &lt;integer&gt;</a></div>
1176
- <div class="foo toclevel4"><a href="#PassengerMaxRequests">5.14.6. PassengerMaxRequests &lt;integer&gt;</a></div>
1177
- <div class="foo toclevel4"><a href="#PassengerMaxRequestTime">5.14.7. PassengerMaxRequestTime &lt;seconds&gt;</a></div>
1178
- <div class="foo toclevel4"><a href="#PassengerMemoryLimit">5.14.8. PassengerMemoryLimit &lt;integer&gt;</a></div>
1179
- <div class="foo toclevel4"><a href="#_passengerstatthrottlerate_lt_integer_gt">5.14.9. PassengerStatThrottleRate &lt;integer&gt;</a></div>
1180
- <div class="foo toclevel4"><a href="#PassengerPreStart">5.14.10. PassengerPreStart &lt;url&gt;</a></div>
1181
- <div class="foo toclevel4"><a href="#PassengerHighPerformance">5.14.11. PassengerHighPerformance &lt;on|off&gt;</a></div>
1182
- <div class="foo toclevel3"><a href="#_compatibility_options">5.15. Compatibility options</a></div>
1183
- <div class="foo toclevel4"><a href="#PassengerResolveSymlinksInDocumentRoot">5.15.1. PassengerResolveSymlinksInDocumentRoot &lt;on|off&gt;</a></div>
1184
- <div class="foo toclevel4"><a href="#_passengerallowencodedslashes_lt_on_off_gt">5.15.2. PassengerAllowEncodedSlashes &lt;on|off&gt;</a></div>
1185
- <div class="foo toclevel3"><a href="#_logging_and_debugging_options">5.16. Logging and debugging options</a></div>
1186
- <div class="foo toclevel4"><a href="#_passengerloglevel_lt_integer_gt">5.16.1. PassengerLogLevel &lt;integer&gt;</a></div>
1187
- <div class="foo toclevel4"><a href="#_passengerdebuglogfile_lt_filename_gt">5.16.2. PassengerDebugLogFile &lt;filename&gt;</a></div>
1188
- <div class="foo toclevel4"><a href="#_passengerdebugger_lt_on_off_gt">5.16.3. PassengerDebugger &lt;on|off&gt;</a></div>
1189
- <div class="foo toclevel3"><a href="#_ruby_on_rails_specific_options">5.17. Ruby on Rails-specific options</a></div>
1190
- <div class="foo toclevel4"><a href="#_railsautodetect_lt_on_off_gt">5.17.1. RailsAutoDetect &lt;on|off&gt;</a></div>
1191
- <div class="foo toclevel4"><a href="#RailsBaseURI">5.17.2. RailsBaseURI &lt;uri&gt;</a></div>
1192
- <div class="foo toclevel4"><a href="#rails_env">5.17.3. RailsEnv &lt;string&gt;</a></div>
1193
- <div class="foo toclevel4"><a href="#_railsframeworkspawneridletime_lt_integer_gt">5.17.4. RailsFrameworkSpawnerIdleTime &lt;integer&gt;</a></div>
1194
- <div class="foo toclevel4"><a href="#_railsappspawneridletime_lt_integer_gt">5.17.5. RailsAppSpawnerIdleTime &lt;integer&gt;</a></div>
1195
- <div class="foo toclevel3"><a href="#_rack_and_rails_gt_3_specific_options">5.18. Rack and Rails &gt;= 3 specific options</a></div>
1196
- <div class="foo toclevel4"><a href="#_rackautodetect_lt_on_off_gt">5.18.1. RackAutoDetect &lt;on|off&gt;</a></div>
1197
- <div class="foo toclevel4"><a href="#RackBaseURI">5.18.2. RackBaseURI &lt;uri&gt;</a></div>
1198
- <div class="foo toclevel4"><a href="#rack_env">5.18.3. RackEnv &lt;string&gt;</a></div>
1199
- <div class="foo toclevel3"><a href="#_deprecated_options">5.19. Deprecated options</a></div>
1200
- <div class="foo toclevel4"><a href="#_railsruby">5.19.1. RailsRuby</a></div>
1201
- <div class="foo toclevel4"><a href="#_railsuserswitching">5.19.2. RailsUserSwitching</a></div>
1202
- <div class="foo toclevel4"><a href="#_railsdefaultuser">5.19.3. RailsDefaultUser</a></div>
1203
- <div class="foo toclevel4"><a href="#_railsallowmodrewrite">5.19.4. RailsAllowModRewrite</a></div>
1204
- <div class="foo toclevel4"><a href="#_railsspawnmethod">5.19.5. RailsSpawnMethod</a></div>
1205
- <div class="foo toclevel2"><a href="#_troubleshooting">6. Troubleshooting</a></div>
1206
- <div class="foo toclevel3"><a href="#_operating_system_specific_problems">6.1. Operating system-specific problems</a></div>
1207
- <div class="foo toclevel4"><a href="#_macos_x_the_installer_cannot_locate_mamp_8217_s_apache">6.1.1. MacOS X: The installer cannot locate MAMP’s Apache</a></div>
1208
- <div class="foo toclevel3"><a href="#_problems_during_installation">6.2. Problems during installation</a></div>
1209
- <div class="foo toclevel4"><a href="#installing_ruby_dev">6.2.1. Ruby development headers aren’t installed</a></div>
1210
- <div class="foo toclevel4"><a href="#_apache_development_headers_aren_8217_t_installed">6.2.2. Apache development headers aren’t installed</a></div>
1211
- <div class="foo toclevel4"><a href="#_apr_development_headers_aren_8217_t_installed">6.2.3. APR development headers aren’t installed</a></div>
1212
- <div class="foo toclevel4"><a href="#_phusion_passenger_is_using_the_wrong_apache_during_installation">6.2.4. Phusion Passenger is using the wrong Apache during installation</a></div>
1213
- <div class="foo toclevel4"><a href="#_phusion_passenger_is_using_the_wrong_ruby_during_installation">6.2.5. Phusion Passenger is using the wrong Ruby during installation</a></div>
1214
- <div class="foo toclevel3"><a href="#_problems_after_installation">6.3. Problems after installation</a></div>
1215
- <div class="foo toclevel4"><a href="#_my_rails_application_works_on_mongrel_but_not_on_phusion_passenger">6.3.1. My Rails application works on Mongrel, but not on Phusion Passenger</a></div>
1216
- <div class="foo toclevel4"><a href="#_phusion_passenger_has_been_compiled_against_the_wrong_apache_installation">6.3.2. Phusion Passenger has been compiled against the wrong Apache installation</a></div>
1217
- <div class="foo toclevel4"><a href="#_i_get_a_403_forbidden_error">6.3.3. I get a "403 Forbidden" error</a></div>
1218
- <div class="foo toclevel4"><a href="#_static_assets_such_as_images_and_stylesheets_aren_8217_t_being_displayed">6.3.4. Static assets such as images and stylesheets aren’t being displayed</a></div>
1219
- <div class="foo toclevel4"><a href="#_the_apache_error_log_says_that_the_spawn_manager_script_does_not_exist_or_that_it_does_not_have_permission_to_execute_it">6.3.5. The Apache error log says that the spawn manager script does not exist, or that it does not have permission to execute it</a></div>
1220
- <div class="foo toclevel4"><a href="#_the_rails_application_reports_that_it_8217_s_unable_to_start_because_of_a_permission_error">6.3.6. The Rails application reports that it’s unable to start because of a permission error</a></div>
1221
- <div class="foo toclevel4"><a href="#_my_rails_application_8217_s_log_file_is_not_being_written_to">6.3.7. My Rails application’s log file is not being written to</a></div>
1222
- <div class="foo toclevel4"><a href="#_i_8217_ve_deployed_my_app_on_ssl_but_the_app_thinks_its_not_on_ssl">6.3.8. I’ve deployed my app on SSL, but the app thinks its not on SSL</a></div>
1223
- <div class="foo toclevel3"><a href="#conflicting_apache_modules">6.4. Conflicting Apache modules</a></div>
1224
- <div class="foo toclevel4"><a href="#_mod_userdir">6.4.1. mod_userdir</a></div>
1225
- <div class="foo toclevel4"><a href="#_multiviews_mod_negotiation">6.4.2. MultiViews (mod_negotiation)</a></div>
1226
- <div class="foo toclevel4"><a href="#_virtualdocumentroot">6.4.3. VirtualDocumentRoot</a></div>
1227
- <div class="foo toclevel2"><a href="#_analysis_and_system_maintenance">7. Analysis and system maintenance</a></div>
1228
- <div class="foo toclevel3"><a href="#_inspecting_memory_usage">7.1. Inspecting memory usage</a></div>
1229
- <div class="foo toclevel3"><a href="#_inspecting_phusion_passenger_8217_s_internal_status">7.2. Inspecting Phusion Passenger’s internal status</a></div>
1230
- <div class="foo toclevel3"><a href="#debugging_frozen">7.3. Debugging frozen applications</a></div>
1231
- <div class="foo toclevel3"><a href="#_accessing_individual_application_processes">7.4. Accessing individual application processes</a></div>
1232
- <div class="foo toclevel3"><a href="#_attaching_an_irb_console_to_an_application_process">7.5. Attaching an IRB console to an application process</a></div>
1233
- <div class="foo toclevel2"><a href="#_tips">8. Tips</a></div>
1234
- <div class="foo toclevel3"><a href="#user_switching">8.1. User switching (security)</a></div>
1235
- <div class="foo toclevel3"><a href="#reducing_memory_usage">8.2. Reducing memory consumption of Ruby on Rails applications by 33%</a></div>
1236
- <div class="foo toclevel3"><a href="#capistrano">8.3. Capistrano recipe</a></div>
1237
- <div class="foo toclevel3"><a href="#bundler_support">8.4. Bundler support</a></div>
1238
- <div class="foo toclevel3"><a href="#moving_phusion_passenger">8.5. Moving Phusion Passenger to a different directory</a></div>
1239
- <div class="foo toclevel3"><a href="#_installing_multiple_ruby_on_rails_versions">8.6. Installing multiple Ruby on Rails versions</a></div>
1240
- <div class="foo toclevel3"><a href="#_making_the_application_restart_after_each_request">8.7. Making the application restart after each request</a></div>
1241
- <div class="foo toclevel3"><a href="#sub_uri_deployment_uri_fix">8.8. How to fix broken images/CSS/JavaScript URIs in sub-URI deployments</a></div>
1242
- <div class="foo toclevel3"><a href="#_x_sendfile_support">8.9. X-Sendfile support</a></div>
1243
- <div class="foo toclevel3"><a href="#_upload_progress">8.10. Upload progress</a></div>
1244
- <div class="foo toclevel2"><a href="#_under_the_hood">9. Under the hood</a></div>
1245
- <div class="foo toclevel3"><a href="#_static_assets_serving">9.1. Static assets serving</a></div>
1246
- <div class="foo toclevel3"><a href="#_page_caching_support">9.2. Page caching support</a></div>
1247
- <div class="foo toclevel3"><a href="#application_detection">9.3. How Phusion Passenger detects whether a virtual host is a web application</a></div>
1248
- <div class="foo toclevel2"><a href="#_appendix_a_about_this_document">10. Appendix A: About this document</a></div>
1249
- <div class="foo toclevel2"><a href="#_appendix_b_terminology">11. Appendix B: Terminology</a></div>
1250
- <div class="foo toclevel3"><a href="#application_root">11.1. Application root</a></div>
1251
- <div class="foo toclevel3"><a href="#idle_process">11.2. Idle process</a></div>
1252
- <div class="foo toclevel3"><a href="#inactive_process">11.3. Inactive process</a></div>
1253
- <div class="foo toclevel2"><a href="#spawning_methods_explained">12. Appendix C: Spawning methods explained</a></div>
1254
- <div class="foo toclevel3"><a href="#_the_most_straightforward_and_traditional_way_conservative_spawning">12.1. The most straightforward and traditional way: conservative spawning</a></div>
1255
- <div class="foo toclevel3"><a href="#_the_smart_spawning_method">12.2. The smart spawning method</a></div>
1256
- <div class="foo toclevel4"><a href="#_how_it_works">12.2.1. How it works</a></div>
1257
- <div class="foo toclevel4"><a href="#_summary_of_benefits">12.2.2. Summary of benefits</a></div>
1258
- <div class="foo toclevel3"><a href="#_smart_spawning_gotcha_1_unintentional_file_descriptor_sharing">12.3. Smart spawning gotcha #1: unintentional file descriptor sharing</a></div>
1259
- <div class="foo toclevel4"><a href="#_example_1_memcached_connection_sharing_harmful">12.3.1. Example 1: Memcached connection sharing (harmful)</a></div>
1260
- <div class="foo toclevel4"><a href="#_example_2_log_file_sharing_not_harmful">12.3.2. Example 2: Log file sharing (not harmful)</a></div>
1261
- <div class="foo toclevel3"><a href="#_smart_spawning_gotcha_2_the_need_to_revive_threads">12.4. Smart spawning gotcha #2: the need to revive threads</a></div>
1262
- <div class="foo toclevel3"><a href="#_smart_spawning_gotcha_3_code_load_order">12.5. Smart spawning gotcha #3: code load order</a></div>
1263
- </div>
1088
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><div id="toctitle">Table of Contents</div>
1089
+ <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
1090
+ </div>
1264
1091
  </div>
1265
1092
  <div id="content">
1266
1093
 
1267
1094
  <div class="sect1">
1268
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_support_information"></span><h2 data-comment-topic="support-information-zkewk3" data-anchor="_support_information">1. Support information</h2>
1095
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h2 id="_support_information" data-comment-topic="support-information-zkewk3">1. Support information</h2>
1269
1096
  <div class="sectionbody">
1270
1097
  <div class="sect2">
1271
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_supported_operating_systems"></span><h3 data-comment-topic="supported-operating-systems-rhbg35" data-anchor="_supported_operating_systems">1.1. Supported operating systems</h3>
1098
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_supported_operating_systems" data-comment-topic="supported-operating-systems-rhbg35">1.1. Supported operating systems</h3>
1272
1099
  <div class="paragraph"><p>Phusion Passenger works on any POSIX-compliant operating system. In other
1273
1100
  words: practically any operating system on earth, except Microsoft Windows.</p></div>
1274
1101
  <div class="paragraph"><p>Phusion Passenger is confirmed on a large number of operating systems and Linux
1275
1102
  distributions, including, but not limited to, Ubuntu, Debian, CentOS/Fedora/RHEL,
1276
1103
  Gentoo, Mac OS X, FreeBSD and Solaris. Both 32-bit and 64-bit platforms are supported.</p></div>
1277
- <div class="paragraph"><p>The only POSIX-compliant operating system on which Phusion Passenger for Apache is
1104
+ <div class="literalblock">
1105
+ <div class="content monospaced">
1106
+ <pre>The only POSIX-compliant operating system on which Phusion Passenger for Apache is
1278
1107
  known not to work at this time, is OpenBSD. Please use Phusion Passenger for Nginx
1279
- instead.</p></div>
1108
+ or Phusion Passenger Standalone instead.</pre>
1109
+ </div>
1110
+ </div>
1280
1111
  <div class="paragraph"><p>Please
1281
1112
  <a href="http://code.google.com/p/phusion-passenger/issues/list">report a bug</a>
1282
1113
  or
@@ -1284,8 +1115,8 @@ or
1284
1115
  if it doesn’t work on your POSIX-compliant operating system.</p></div>
1285
1116
  </div>
1286
1117
  <div class="sect2">
1287
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_where_to_get_support"></span><h3 data-comment-topic="where-to-get-support-f3pbrb" data-anchor="_where_to_get_support">1.2. Where to get support</h3>
1288
- <div class="ulist"><ul>
1118
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_where_to_get_support" data-comment-topic="where-to-get-support-f3pbrb">1.2. Where to get support</h3>
1119
+ <div class="ulist"><ul>
1289
1120
  <li>
1290
1121
  <p>
1291
1122
  <a href="http://code.google.com/p/phusion-passenger/issues/list">Issue tracker</a> - report
@@ -1298,23 +1129,29 @@ if it doesn’t work on your POSIX-compliant operating system.</p></div>
1298
1129
  message here if you’re experiencing problems.
1299
1130
  </p>
1300
1131
  </li>
1132
+ <li>
1133
+ <p>
1134
+ <a href="https://www.phusionpassenger.com/commercial_support">Commercial support contracts</a> are also available.
1135
+ </p>
1136
+ </li>
1301
1137
  </ul></div>
1138
+ <div class="paragraph"><p>Please consult <a href="https://www.phusionpassenger.com/support">the Phusion Passenger website</a> for a full list of support resources.</p></div>
1302
1139
  </div>
1303
1140
  </div>
1304
1141
  </div>
1305
1142
  <div class="sect1">
1306
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_installing_upgrading_and_uninstalling_phusion_passenger"></span><h2 data-comment-topic="installing-upgrading-and-uninstalling-phusion-passenger-laryvs" data-anchor="_installing_upgrading_and_uninstalling_phusion_passenger">2. Installing, upgrading and uninstalling Phusion Passenger</h2>
1143
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h2 id="_installing_upgrading_and_uninstalling_phusion_passenger" data-comment-topic="installing-upgrading-and-uninstalling-phusion-passenger-laryvs">2. Installing, upgrading and uninstalling Phusion Passenger</h2>
1307
1144
  <div class="sectionbody">
1308
1145
  <div class="sect2">
1309
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_generic_installation_instructions"></span><h3 data-comment-topic="generic-installation-instructions-17jo43j" data-anchor="_generic_installation_instructions">2.1. Generic installation instructions</h3>
1146
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_generic_installation_instructions" data-comment-topic="generic-installation-instructions-17jo43j">2.1. Generic installation instructions</h3>
1310
1147
  <div class="sect3">
1311
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="install_passenger"></span><h4 data-comment-topic="overview-of-installation-methods-12vnjyb" data-anchor="install_passenger">2.1.1. Overview of installation methods</h4>
1148
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="install_passenger" data-comment-topic="overview-of-installation-methods-12vnjyb">2.1.1. Overview of installation methods</h4>
1312
1149
  <div class="paragraph"><p>There are three ways to install Phusion Passenger:</p></div>
1313
- <div class="olist arabic"><ol class="arabic">
1150
+ <div class="olist arabic"><ol class="arabic">
1314
1151
  <li>
1315
1152
  <p>
1316
- By installing the Phusion Passenger gem, as instructed on the
1317
- <a href="http://www.modrails.com/install.html">“Install” page on the Phusion
1153
+ By installing the Phusion Passenger Ruby gem, as instructed on the
1154
+ <a href="https://www.phusionpassenger.com/download">“Download” page on the Phusion
1318
1155
  Passenger website</a>.
1319
1156
  </p>
1320
1157
  </li>
@@ -1336,7 +1173,7 @@ the gem or the native package is easiest. For these two installation methods,
1336
1173
  Phusion Passenger provides an easy-to-use installer.</p></div>
1337
1174
  </div>
1338
1175
  <div class="sect3">
1339
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_preparation_gem_and_source_tarball_only"></span><h4 data-comment-topic="preparation-gem-and-source-tarball-only--1sxhbgg" data-anchor="_preparation_gem_and_source_tarball_only">2.1.2. Preparation (gem and source tarball only)</h4>
1176
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_preparation_gem_and_source_tarball_only" data-comment-topic="preparation-gem-and-source-tarball-only--1sxhbgg">2.1.2. Preparation (gem and source tarball only)</h4>
1340
1177
  <div class="paragraph"><p>If you want to install Phusion Passenger via the gem or the source tarball,
1341
1178
  then some preparations might be required. You can skip this subsection if
1342
1179
  you’re installing Phusion Passenger via a native Linux package, because no
@@ -1395,18 +1232,18 @@ installation in <em>/opt/apache2</em>. Then, assuming that the corresponding
1395
1232
  </div>
1396
1233
  </div>
1397
1234
  <div class="admonitionblock">
1398
- <table><tr>
1235
+ <table><tr>
1399
1236
  <td class="icon">
1400
- <img src="./images/icons/note.png" alt="Note">
1237
+ <img src="./images/icons/note.png" alt="Note">
1401
1238
  </td>
1402
1239
  <td class="content">On some systems, the <span class="monospaced">apxs</span> program might be called <span class="monospaced">apxs2</span>, and it might
1403
1240
  be located in the <span class="monospaced">sbin</span> folder instead of the <span class="monospaced">bin</span> folder.</td>
1404
- </tr></table>
1241
+ </tr></table>
1405
1242
  </div>
1406
1243
  <div class="admonitionblock">
1407
- <table><tr>
1244
+ <table><tr>
1408
1245
  <td class="icon">
1409
- <img src="./images/icons/note.png" alt="Note">
1246
+ <img src="./images/icons/note.png" alt="Note">
1410
1247
  </td>
1411
1248
  <td class="content">
1412
1249
  <div class="title">Environment variables and <em>sudo</em>
@@ -1416,7 +1253,7 @@ normal user, then run <span class="monospaced">sudo passenger-install-apache2-mo
1416
1253
  for the Phusion Passenger installer), then the installer will not receive the
1417
1254
  environment variable value that you set. To solve this problem, please become root
1418
1255
  prior to setting any environment variables, as described in the previous subsection.</td>
1419
- </tr></table>
1256
+ </tr></table>
1420
1257
  </div>
1421
1258
  </div>
1422
1259
  <div class="sect4">
@@ -1431,7 +1268,7 @@ Passenger will automatically detect it.</p></div>
1431
1268
  <div class="paragraph"><p>To specify a Ruby installation, prepend your Ruby installation’s <span class="monospaced">bin</span>
1432
1269
  directory to the <span class="monospaced">PATH</span> environment variable. For example, if you have the
1433
1270
  following Ruby installations:</p></div>
1434
- <div class="ulist"><ul>
1271
+ <div class="ulist"><ul>
1435
1272
  <li>
1436
1273
  <p>
1437
1274
  /usr/bin/ruby
@@ -1452,7 +1289,7 @@ following Ruby installations:</p></div>
1452
1289
  </div>
1453
1290
  </div>
1454
1291
  <div class="sect3">
1455
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_installing_via_the_gem"></span><h4 data-comment-topic="installing-via-the-gem-39jw1u" data-anchor="_installing_via_the_gem">2.1.3. Installing via the gem</h4>
1292
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_installing_via_the_gem" data-comment-topic="installing-via-the-gem-39jw1u">2.1.3. Installing via the gem</h4>
1456
1293
  <div class="paragraph"><p>Please install the gem and then run the Phusion Passenger installer, by typing the
1457
1294
  following commands:</p></div>
1458
1295
  <div class="listingblock">
@@ -1464,7 +1301,7 @@ passenger-install-apache2-module</pre>
1464
1301
  <div class="paragraph"><p>Please follow the instructions given by the installer.</p></div>
1465
1302
  </div>
1466
1303
  <div class="sect3">
1467
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_installing_via_the_source_tarball"></span><h4 data-comment-topic="installing-via-the-source-tarball-1cgxrqc" data-anchor="_installing_via_the_source_tarball">2.1.4. Installing via the source tarball</h4>
1304
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_installing_via_the_source_tarball" data-comment-topic="installing-via-the-source-tarball-1cgxrqc">2.1.4. Installing via the source tarball</h4>
1468
1305
  <div class="paragraph"><p>Extract the tarball to whatever location you prefer. <strong>The Phusion Passenger files
1469
1306
  are to reside in that location permanently.</strong> For example, if you would like
1470
1307
  Phusion Passenger to reside in <span class="monospaced">/opt/passenger-x.x.x</span>:</p></div>
@@ -1482,21 +1319,21 @@ tar xzvf ~/YourDownloadsFolder/passenger-x.x.x.tar.gz</pre>
1482
1319
  </div>
1483
1320
  <div class="paragraph"><p>Please follow the instructions given by the installer.</p></div>
1484
1321
  <div class="admonitionblock">
1485
- <table><tr>
1322
+ <table><tr>
1486
1323
  <td class="icon">
1487
- <img src="./images/icons/important.png" alt="Important">
1324
+ <img src="./images/icons/important.png" alt="Important">
1488
1325
  </td>
1489
1326
  <td class="content">Please do not remove the <em>passenger-x.x.x</em> folder after
1490
1327
  installation. Furthermore, the <em>passenger-x.x.x</em> folder must be accessible by Apache.</td>
1491
- </tr></table>
1328
+ </tr></table>
1492
1329
  </div>
1493
1330
  </div>
1494
1331
  <div class="sect3">
1495
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_installing_via_a_native_linux_package"></span><h4 data-comment-topic="installing-via-a-native-linux-package-i1tmhg" data-anchor="_installing_via_a_native_linux_package">2.1.5. Installing via a native Linux package</h4>
1332
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_installing_via_a_native_linux_package" data-comment-topic="installing-via-a-native-linux-package-i1tmhg">2.1.5. Installing via a native Linux package</h4>
1496
1333
  <div class="paragraph"><p>John Leach from Brightbox has kindly provided a Ubuntu packages for Phusion Passenger. The package is available from the <a href="http://wiki.brightbox.co.uk/docs:phusion-passenger">Brightbox repository</a>.</p></div>
1497
1334
  </div>
1498
1335
  <div class="sect3">
1499
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_what_does_the_installer_do"></span><h4 data-comment-topic="what-does-the-installer-do--3a7z1w" data-anchor="_what_does_the_installer_do">2.1.6. What does the installer do?</h4>
1336
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_what_does_the_installer_do" data-comment-topic="what-does-the-installer-do--3a7z1w">2.1.6. What does the installer do?</h4>
1500
1337
  <div class="paragraph"><p>Although we call it an “installer”, it doesn’t actually install anything.
1501
1338
  The installer checks whether all required dependencies are installed,
1502
1339
  compiles Phusion Passenger for you, and tells you how to modify the Apache
@@ -1507,27 +1344,21 @@ Phusion Passenger.</p></div>
1507
1344
  </div>
1508
1345
  </div>
1509
1346
  <div class="sect2">
1510
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_operating_system_specific_instructions_and_information"></span><h3 data-comment-topic="operating-system-specific-instructions-and-information-1dfz365" data-anchor="_operating_system_specific_instructions_and_information">2.2. Operating system-specific instructions and information</h3>
1511
- <div class="sect3">
1512
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_macos_x"></span><h4 data-comment-topic="macos-x-1lcpbz2" data-anchor="_macos_x">2.2.1. MacOS X</h4>
1513
- <div class="paragraph"><p>Ben Ruebenstein has written an excellent
1514
- <a href="http://benr75.com/articles/2008/04/12/setup-mod_rails-phusion-mac-os-x-leopard">tutorial
1515
- on installing Phusion Passenger on OS X</a>.</p></div>
1516
- </div>
1347
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_operating_system_specific_instructions_and_information" data-comment-topic="operating-system-specific-instructions-and-information-1dfz365">2.2. Operating system-specific instructions and information</h3>
1517
1348
  <div class="sect3">
1518
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_ubuntu_linux"></span><h4 data-comment-topic="ubuntu-linux-1xwc66" data-anchor="_ubuntu_linux">2.2.2. Ubuntu Linux</h4>
1349
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_ubuntu_linux" data-comment-topic="ubuntu-linux-1xwc66">2.2.1. Ubuntu Linux</h4>
1519
1350
  <div class="paragraph"><p>Ben Hughes has written an <a href="http://www.railsgarden.com/2008/04/12/configurating-passenger-mod_rails-on-slicehost-with-ubuntu-710/">article on installing Phusion Passenger on Ubuntu</a>.</p></div>
1520
1351
  </div>
1521
1352
  <div class="sect3">
1522
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_opensolaris"></span><h4 data-comment-topic="opensolaris-1e0dynj" data-anchor="_opensolaris">2.2.3. OpenSolaris</h4>
1353
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_opensolaris" data-comment-topic="opensolaris-1e0dynj">2.2.2. OpenSolaris</h4>
1523
1354
  <div class="paragraph"><p>J Aaron Farr has written a <a href="http://cubiclemuses.com/cm/articles/2009/04/09/rails-passenger-open-solaris-ec2/">guide</a>
1524
1355
  about setting up Ruby on Rails and Phusion Passenger on OpenSolaris and EC2.</p></div>
1525
1356
  </div>
1526
1357
  </div>
1527
1358
  <div class="sect2">
1528
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_upgrading_or_downgrading_phusion_passenger"></span><h3 data-comment-topic="upgrading-or-downgrading-phusion-passenger-1dl8km6" data-anchor="_upgrading_or_downgrading_phusion_passenger">2.3. Upgrading or downgrading Phusion Passenger</h3>
1359
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_upgrading_or_downgrading_phusion_passenger" data-comment-topic="upgrading-or-downgrading-phusion-passenger-1dl8km6">2.3. Upgrading or downgrading Phusion Passenger</h3>
1529
1360
  <div class="paragraph"><p>Upgrading or downgrading Phusion Passenger for Apache involves several steps.</p></div>
1530
- <div class="olist arabic"><ol class="arabic">
1361
+ <div class="olist arabic"><ol class="arabic">
1531
1362
  <li>
1532
1363
  <p>
1533
1364
  First, you have to obtain and install the files associated with the version that you want to upgrade or downgrade to. You can do this in three ways: by using <a href="#upgrade_or_downgrade_with_rubygems">RubyGems</a>, by downloading a <a href="#upgrade_or_downgrade_with_tarball">tarball</a>, or by installing a <a href="#upgrade_or_downgrade_with_linux_packages">native Linux package</a>. If you installed a native Linux package, then skip to the last step. If not, read on.
@@ -1565,7 +1396,7 @@ otherwise Phusion Passenger may malfunction.
1565
1396
  4. Restart Apache. You’re now done.</p></div>
1566
1397
  </li>
1567
1398
  </ol></div>
1568
- <span class="anchor_helper" id="upgrade_or_downgrade_with_rubygems"></span><h4 class="float" data-anchor="upgrade_or_downgrade_with_rubygems">Obtaining Phusion Passenger files with RubyGems</h4>
1399
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="upgrade_or_downgrade_with_rubygems" class="float" data-comment-topic="obtaining-phusion-passenger-files-with-rubygems-8fz7a8">Obtaining Phusion Passenger files with RubyGems</h4>
1569
1400
  <div class="paragraph">
1570
1401
  <div class="title">Open source</div>
1571
1402
  <p>You can obtain the files associated with the latest <em>open source</em> Phusion Passenger release by invoking the following command:</p>
@@ -1590,16 +1421,16 @@ otherwise Phusion Passenger may malfunction.
1590
1421
  <pre>sudo gem install passenger-enterprise-server-x.x.x.gem</pre>
1591
1422
  </div>
1592
1423
  </div>
1593
- <span class="anchor_helper" id="upgrade_or_downgrade_with_tarball"></span><h4 class="float" data-anchor="upgrade_or_downgrade_with_tarball">Obtaining Phusion Passenger files through a tarball</h4>
1424
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="upgrade_or_downgrade_with_tarball" class="float" data-comment-topic="obtaining-phusion-passenger-files-through-a-tarball-evcm0j">Obtaining Phusion Passenger files through a tarball</h4>
1594
1425
  <div class="paragraph"><p>You can obtain the files associated with the latest <em>open source</em> Phusion Passenger release by downloading the tarball linked from <a href="https://www.phusionpassenger.com/download">the Phusion Passenger download page</a>. If you want a specific version, please refer to the release archive on <a href="http://rubyforge.org/frs/?group_id=5873&amp;release_id=46919">RubyForge</a>.</p></div>
1595
1426
  <div class="paragraph"><p>If you’re using <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a> then you should obtain the tarball from the <a href="https://www.phusionpassenger.com/orders">Customer Area</a> instead. Login with your order reference and password. The Customer Area will show you a list of files. Download the tarball for the version you want (<span class="monospaced">passenger-enterprise-server-x.x.x.tar.gz</span>).</p></div>
1596
1427
  <div class="paragraph"><p>Once you’ve obtained the tarball, extract it somewhere:</p></div>
1597
- <span class="anchor_helper" id="upgrade_or_downgrade_with_linux_packages"></span><h4 class="float" data-anchor="upgrade_or_downgrade_with_linux_packages">Upgrading with native Linux packages</h4>
1428
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="upgrade_or_downgrade_with_linux_packages" class="float" data-comment-topic="upgrading-with-native-linux-packages-jievu8">Upgrading with native Linux packages</h4>
1598
1429
  <div class="paragraph"><p>When using native Linux packages, it is only possible to upgrade, not downgrade. Native Linux packages are only available for the open source Phusion Passenger, not for Phusion Passenger Enterprise.</p></div>
1599
1430
  <div class="paragraph"><p>Native Linux packages are contributed by third parties. Although they update pretty quickly, they lag behind gem and tarball releases, perhaps by a few days. Please learn more about native Linux packages <a href="https://www.phusionpassenger.com/native_packages">at the Phusion Passenger website</a>.</p></div>
1600
1431
  </div>
1601
1432
  <div class="sect2">
1602
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_unloading_disabling_phusion_passenger_from_apache_without_uninstalling_it"></span><h3 data-comment-topic="unloading-disabling-phusion-passenger-from-apache-without-uninstalling-it-s1axnx" data-anchor="_unloading_disabling_phusion_passenger_from_apache_without_uninstalling_it">2.4. Unloading (disabling) Phusion Passenger from Apache without uninstalling it</h3>
1433
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_unloading_disabling_phusion_passenger_from_apache_without_uninstalling_it" data-comment-topic="unloading-disabling-phusion-passenger-from-apache-without-uninstalling-it-s1axnx">2.4. Unloading (disabling) Phusion Passenger from Apache without uninstalling it</h3>
1603
1434
  <div class="paragraph"><p>You can temporarily unload (disable) Phusion Passenger from Apache, without
1604
1435
  uninstalling the Phusion Passenger files, so that Apache behaves as if Phusion
1605
1436
  Passenger was never installed in the first place. This might be useful to you if,
@@ -1610,7 +1441,7 @@ Phusion Passenger will not occupy any memory or CPU or otherwise interfere with
1610
1441
  Apache.</p></div>
1611
1442
  <div class="paragraph"><p>To unload Phusion Passenger from Apache, edit your Apache configuration file(s)
1612
1443
  and comment out:</p></div>
1613
- <div class="ulist"><ul>
1444
+ <div class="ulist"><ul>
1614
1445
  <li>
1615
1446
  <p>
1616
1447
  all Phusion Passenger configuration directives.
@@ -1665,11 +1496,11 @@ NameVirtualHosts *:80
1665
1496
  <div class="paragraph"><p>After you’ve done this, save the file and restart Apache.</p></div>
1666
1497
  </div>
1667
1498
  <div class="sect2">
1668
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_uninstalling_phusion_passenger"></span><h3 data-comment-topic="uninstalling-phusion-passenger-1qb4ssq" data-anchor="_uninstalling_phusion_passenger">2.5. Uninstalling Phusion Passenger</h3>
1499
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_uninstalling_phusion_passenger" data-comment-topic="uninstalling-phusion-passenger-1qb4ssq">2.5. Uninstalling Phusion Passenger</h3>
1669
1500
  <div class="paragraph"><p>To uninstall Phusion Passenger, please first remove all Phusion Passenger
1670
1501
  configuration directives from your Apache configuration file(s). After you’ve
1671
1502
  done this, you need to remove the Phusion Passenger files.</p></div>
1672
- <div class="ulist"><ul>
1503
+ <div class="ulist"><ul>
1673
1504
  <li>
1674
1505
  <p>
1675
1506
  If you installed Phusion Passenger via a gem, then type <span class="monospaced">gem uninstall passenger</span>.
@@ -1694,7 +1525,7 @@ If you installed Phusion Passenger via a Debian package, then remove type
1694
1525
  </div>
1695
1526
  </div>
1696
1527
  <div class="sect1">
1697
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_deploying_a_ruby_on_rails_1_x_or_2_x_but_not_rails_gt_3_x_application"></span><h2 data-comment-topic="deploying-a-ruby-on-rails-1-x-or-2-x-but-not-rails-3-x-application-9r92hi" data-anchor="_deploying_a_ruby_on_rails_1_x_or_2_x_but_not_rails_gt_3_x_application">3. Deploying a Ruby on Rails 1.x or 2.x (but NOT Rails &gt;= 3.x) application</h2>
1528
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h2 id="_deploying_a_ruby_on_rails_1_x_or_2_x_but_not_rails_gt_3_x_application" data-comment-topic="deploying-a-ruby-on-rails-1-x-or-2-x-but-not-rails-3-x-application-9r92hi">3. Deploying a Ruby on Rails 1.x or 2.x (but NOT Rails &gt;= 3.x) application</h2>
1698
1529
  <div class="sectionbody">
1699
1530
  <div class="paragraph"><p>Suppose you have a Ruby on Rails application in <em>/webapps/mycook</em>, and you own
1700
1531
  the domain <em>www.mycook.com</em>. You can either deploy your application to the
@@ -1702,20 +1533,20 @@ virtual host’s root (i.e. the application will be accessible from the root URL
1702
1533
  <em>http://www.mycook.com/</em>), or in a sub URI (i.e. the application will be
1703
1534
  accessible from a sub URL, such as <em>http://www.mycook.com/railsapplication</em>).</p></div>
1704
1535
  <div class="admonitionblock">
1705
- <table><tr>
1536
+ <table><tr>
1706
1537
  <td class="icon">
1707
- <img src="./images/icons/note.png" alt="Note">
1538
+ <img src="./images/icons/note.png" alt="Note">
1708
1539
  </td>
1709
1540
  <td class="content">The default <span class="monospaced">RAILS_ENV</span> environment in which deployed Rails applications
1710
1541
  are run, is “production”. You can change this by changing the
1711
1542
  <a href="#rails_env"><em>RailsEnv</em></a> configuration option.</td>
1712
- </tr></table>
1543
+ </tr></table>
1713
1544
  </div>
1714
1545
  <div class="sect2">
1715
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_deploying_to_a_virtual_host_8217_s_root"></span><h3 data-comment-topic="deploying-to-a-virtual-host-s-root-zzo4v7" data-anchor="_deploying_to_a_virtual_host_8217_s_root">3.1. Deploying to a virtual host’s root</h3>
1546
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_deploying_to_a_virtual_host_8217_s_root" data-comment-topic="deploying-to-a-virtual-host-s-root-zzo4v7">3.1. Deploying to a virtual host’s root</h3>
1716
1547
  <div class="paragraph"><p>Add a virtual host entry to your Apache configuration file. Make sure that the
1717
1548
  following conditions are met:</p></div>
1718
- <div class="ulist"><ul>
1549
+ <div class="ulist"><ul>
1719
1550
  <li>
1720
1551
  <p>
1721
1552
  The virtual host’s document root must point to your Ruby on Rails application’s
@@ -1748,7 +1579,7 @@ MultiViews must be disabled for this folder.
1748
1579
  </div>
1749
1580
  <div class="paragraph"><p>You may also need to tweak your file/folder permissions. Make sure that the
1750
1581
  following folders are readable and executable by Apache:</p></div>
1751
- <div class="ulist"><ul>
1582
+ <div class="ulist"><ul>
1752
1583
  <li>
1753
1584
  <p>
1754
1585
  this <em>public</em> folder.
@@ -1768,7 +1599,7 @@ all parent folders. That is, /webapps/mycook and /webapps must also be readable
1768
1599
  <div class="paragraph"><p>Then restart Apache. The application has now been deployed.</p></div>
1769
1600
  </div>
1770
1601
  <div class="sect2">
1771
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="deploying_rails_to_sub_uri"></span><h3 data-comment-topic="deploying-to-a-sub-uri-zekba6" data-anchor="deploying_rails_to_sub_uri">3.2. Deploying to a sub URI</h3>
1602
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="deploying_rails_to_sub_uri" data-comment-topic="deploying-to-a-sub-uri-zekba6">3.2. Deploying to a sub URI</h3>
1772
1603
  <div class="paragraph"><p>Suppose that you already have a virtual host:</p></div>
1773
1604
  <div class="listingblock">
1774
1605
  <div class="content monospaced">
@@ -1792,7 +1623,7 @@ point to your Ruby on Rails application’s <em>public</em> folder. For example:
1792
1623
  </div>
1793
1624
  <div class="paragraph"><p>Next, add a <a href="#RailsBaseURI">RailsBaseURI</a> option to the virtual host configuration,
1794
1625
  and also make sure that:</p></div>
1795
- <div class="ulist"><ul>
1626
+ <div class="ulist"><ul>
1796
1627
  <li>
1797
1628
  <p>
1798
1629
  The Apache per-directory permissions allow access to this folder.
@@ -1823,21 +1654,21 @@ MultiViews is disabled for this folder.
1823
1654
  </div>
1824
1655
  <div class="paragraph"><p>Then restart Apache. The application has now been deployed.</p></div>
1825
1656
  <div class="admonitionblock">
1826
- <table><tr>
1657
+ <table><tr>
1827
1658
  <td class="icon">
1828
- <img src="./images/icons/note.png" alt="Note">
1659
+ <img src="./images/icons/note.png" alt="Note">
1829
1660
  </td>
1830
1661
  <td class="content">If you’re deploying to a sub-URI then please make sure that your view
1831
1662
  templates correctly handles references to sub-URI static assets! Otherwise
1832
1663
  you may find broken links to images, CSS files, JavaScripts, etc. Please read
1833
1664
  <a href="#sub_uri_deployment_uri_fix">How to fix broken images/CSS/JavaScript URIs in sub-URI deployments</a>
1834
1665
  for more information.</td>
1835
- </tr></table>
1666
+ </tr></table>
1836
1667
  </div>
1837
1668
  <div class="admonitionblock">
1838
- <table><tr>
1669
+ <table><tr>
1839
1670
  <td class="icon">
1840
- <img src="./images/icons/tip.png" alt="Tip">
1671
+ <img src="./images/icons/tip.png" alt="Tip">
1841
1672
  </td>
1842
1673
  <td class="content">
1843
1674
  <div class="paragraph"><p>You can deploy multiple Rails applications under a virtual host, by specifying
@@ -1853,15 +1684,15 @@ for more information.</td>
1853
1684
  </div>
1854
1685
  </div>
1855
1686
  </td>
1856
- </tr></table>
1687
+ </tr></table>
1857
1688
  </div>
1858
1689
  </div>
1859
1690
  <div class="sect2">
1860
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_redeploying_restarting_the_ruby_on_rails_application"></span><h3 data-comment-topic="redeploying-restarting-the-ruby-on-rails-application--m5zqc6" data-anchor="_redeploying_restarting_the_ruby_on_rails_application">3.3. Redeploying (restarting the Ruby on Rails application)</h3>
1691
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_redeploying_restarting_the_ruby_on_rails_application" data-comment-topic="redeploying-restarting-the-ruby-on-rails-application--m5zqc6">3.3. Redeploying (restarting the Ruby on Rails application)</h3>
1861
1692
  <div class="paragraph"><p>Deploying a new version of a Ruby on Rails application is as simple as
1862
1693
  re-uploading the application files, and restarting the application.</p></div>
1863
1694
  <div class="paragraph"><p>There are two ways to restart the application:</p></div>
1864
- <div class="olist arabic"><ol class="arabic">
1695
+ <div class="olist arabic"><ol class="arabic">
1865
1696
  <li>
1866
1697
  <p>
1867
1698
  By restarting Apache.
@@ -1888,27 +1719,27 @@ of this file has changed in order to determine whether the application should
1888
1719
  be restarted.</p></div>
1889
1720
  </div>
1890
1721
  <div class="sect2">
1891
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_migrations"></span><h3 data-comment-topic="migrations-15238b4" data-anchor="_migrations">3.4. Migrations</h3>
1722
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_migrations" data-comment-topic="migrations-15238b4">3.4. Migrations</h3>
1892
1723
  <div class="paragraph"><p>Phusion Passenger is not related to Ruby on Rails migrations in any way. To
1893
1724
  run migrations on your deployment server, please login to your deployment
1894
1725
  server (e.g. with <em>ssh</em>) and type <span class="monospaced">rake db:migrate RAILS_ENV=production</span> in
1895
1726
  a shell console, just like one would normally run migrations.</p></div>
1896
1727
  </div>
1897
1728
  <div class="sect2">
1898
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_capistrano_integration"></span><h3 data-comment-topic="capistrano-integration-1o4cbyq" data-anchor="_capistrano_integration">3.5. Capistrano integration</h3>
1729
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_capistrano_integration" data-comment-topic="capistrano-integration-1o4cbyq">3.5. Capistrano integration</h3>
1899
1730
  <div class="paragraph"><p>See <a href="#capistrano">Capistrano recipe</a>.</p></div>
1900
1731
  </div>
1901
1732
  </div>
1902
1733
  </div>
1903
1734
  <div class="sect1">
1904
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_deploying_a_rack_based_ruby_application_including_rails_gt_3"></span><h2 data-comment-topic="deploying-a-rack-based-ruby-application-including-rails-3--hcs66f" data-anchor="_deploying_a_rack_based_ruby_application_including_rails_gt_3">4. Deploying a Rack-based Ruby application (including Rails &gt;= 3)</h2>
1735
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h2 id="_deploying_a_rack_based_ruby_application_including_rails_gt_3" data-comment-topic="deploying-a-rack-based-ruby-application-including-rails-3--hcs66f">4. Deploying a Rack-based Ruby application (including Rails &gt;= 3)</h2>
1905
1736
  <div class="sectionbody">
1906
1737
  <div class="paragraph"><p>Phusion Passenger supports arbitrary Ruby web applications that follow the
1907
1738
  <a href="http://rack.rubyforge.org/">Rack</a> interface.</p></div>
1908
1739
  <div class="paragraph"><p>Phusion Passenger assumes that Rack application directories have a certain layout.
1909
1740
  Suppose that you have a Rack application in <em>/webapps/rackapp</em>. Then that
1910
1741
  folder must contain at least three entries:</p></div>
1911
- <div class="ulist"><ul>
1742
+ <div class="ulist"><ul>
1912
1743
  <li>
1913
1744
  <p>
1914
1745
  <em>config.ru</em>, a Rackup file for starting the Rack application. This file must contain
@@ -1944,17 +1775,17 @@ to the virtual host’s root (i.e. the application will be accessible from the r
1944
1775
  <em>http://www.rackapp.com/</em>), or in a sub URI (i.e. the application will be
1945
1776
  accessible from a sub URL, such as <em>http://www.rackapp.com/rackapp</em>).</p></div>
1946
1777
  <div class="admonitionblock">
1947
- <table><tr>
1778
+ <table><tr>
1948
1779
  <td class="icon">
1949
- <img src="./images/icons/note.png" alt="Note">
1780
+ <img src="./images/icons/note.png" alt="Note">
1950
1781
  </td>
1951
1782
  <td class="content">The default <span class="monospaced">RACK_ENV</span> environment in which deployed Rack applications
1952
1783
  are run, is “production”. You can change this by changing the
1953
1784
  <a href="#rack_env"><em>RackEnv</em></a> configuration option.</td>
1954
- </tr></table>
1785
+ </tr></table>
1955
1786
  </div>
1956
1787
  <div class="sect2">
1957
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_tutorial_example_writing_and_deploying_a_hello_world_rack_application"></span><h3 data-comment-topic="tutorial-example-writing-and-deploying-a-hello-world-rack-application-axp5z5" data-anchor="_tutorial_example_writing_and_deploying_a_hello_world_rack_application">4.1. Tutorial/example: writing and deploying a Hello World Rack application</h3>
1788
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_tutorial_example_writing_and_deploying_a_hello_world_rack_application" data-comment-topic="tutorial-example-writing-and-deploying-a-hello-world-rack-application-axp5z5">4.1. Tutorial/example: writing and deploying a Hello World Rack application</h3>
1958
1789
  <div class="paragraph"><p>First we create a Phusion Passenger-compliant Rack directory structure:</p></div>
1959
1790
  <div class="listingblock">
1960
1791
  <div class="content monospaced">
@@ -1994,10 +1825,10 @@ the Apache configuration file:</p></div>
1994
1825
  under the URL <em>http://www.rackexample.com/</em>.</p></div>
1995
1826
  </div>
1996
1827
  <div class="sect2">
1997
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_deploying_to_a_virtual_host_8217_s_root_2"></span><h3 data-comment-topic="deploying-to-a-virtual-host-s-root-ab4zj6" data-anchor="_deploying_to_a_virtual_host_8217_s_root_2">4.2. Deploying to a virtual host’s root</h3>
1828
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_deploying_to_a_virtual_host_8217_s_root_2" data-comment-topic="deploying-to-a-virtual-host-s-root-ab4zj6">4.2. Deploying to a virtual host’s root</h3>
1998
1829
  <div class="paragraph"><p>Add a virtual host entry to your Apache configuration file. Make sure that the
1999
1830
  following conditions are met:</p></div>
2000
- <div class="ulist"><ul>
1831
+ <div class="ulist"><ul>
2001
1832
  <li>
2002
1833
  <p>
2003
1834
  The virtual host’s document root must point to your Rack application’s
@@ -2030,7 +1861,7 @@ MultiViews must be disabled for this folder.
2030
1861
  </div>
2031
1862
  <div class="paragraph"><p>You may also need to tweak your file/folder permissions. Make sure that the
2032
1863
  following folders are readable and executable by Apache:</p></div>
2033
- <div class="ulist"><ul>
1864
+ <div class="ulist"><ul>
2034
1865
  <li>
2035
1866
  <p>
2036
1867
  this <em>public</em> folder.
@@ -2050,7 +1881,7 @@ all parent folders. That is, /webapps/rackapp and /webapps must also be readable
2050
1881
  <div class="paragraph"><p>Then restart Apache. The application has now been deployed.</p></div>
2051
1882
  </div>
2052
1883
  <div class="sect2">
2053
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="deploying_rack_to_sub_uri"></span><h3 data-comment-topic="deploying-to-a-sub-uri-13rfygg" data-anchor="deploying_rack_to_sub_uri">4.3. Deploying to a sub URI</h3>
1884
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="deploying_rack_to_sub_uri" data-comment-topic="deploying-to-a-sub-uri-13rfygg">4.3. Deploying to a sub URI</h3>
2054
1885
  <div class="paragraph"><p>Suppose that you already have a virtual host:</p></div>
2055
1886
  <div class="listingblock">
2056
1887
  <div class="content monospaced">
@@ -2074,7 +1905,7 @@ point to your Rack application’s <em>public</em> folder. For example:</p></div
2074
1905
  </div>
2075
1906
  <div class="paragraph"><p>Next, add a <a href="#RackBaseURI">RackBaseURI</a> option to the virtual host configuration,
2076
1907
  and also make sure that:</p></div>
2077
- <div class="ulist"><ul>
1908
+ <div class="ulist"><ul>
2078
1909
  <li>
2079
1910
  <p>
2080
1911
  The Apache per-directory permissions allow access to this folder.
@@ -2105,9 +1936,9 @@ MultiViews is disabled for this folder.
2105
1936
  </div>
2106
1937
  <div class="paragraph"><p>Then restart Apache. The application has now been deployed.</p></div>
2107
1938
  <div class="admonitionblock">
2108
- <table><tr>
1939
+ <table><tr>
2109
1940
  <td class="icon">
2110
- <img src="./images/icons/tip.png" alt="Tip">
1941
+ <img src="./images/icons/tip.png" alt="Tip">
2111
1942
  </td>
2112
1943
  <td class="content">
2113
1944
  <div class="paragraph"><p>You can deploy multiple Rack applications under a virtual host, by specifying
@@ -2123,15 +1954,15 @@ MultiViews is disabled for this folder.
2123
1954
  </div>
2124
1955
  </div>
2125
1956
  </td>
2126
- </tr></table>
1957
+ </tr></table>
2127
1958
  </div>
2128
1959
  </div>
2129
1960
  <div class="sect2">
2130
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_redeploying_restarting_the_rack_application"></span><h3 data-comment-topic="redeploying-restarting-the-rack-application--18m41m1" data-anchor="_redeploying_restarting_the_rack_application">4.4. Redeploying (restarting the Rack application)</h3>
1961
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_redeploying_restarting_the_rack_application" data-comment-topic="redeploying-restarting-the-rack-application--18m41m1">4.4. Redeploying (restarting the Rack application)</h3>
2131
1962
  <div class="paragraph"><p>Deploying a new version of a Rack application is as simple as
2132
1963
  re-uploading the application files, and restarting the application.</p></div>
2133
1964
  <div class="paragraph"><p>There are two ways to restart the application:</p></div>
2134
- <div class="olist arabic"><ol class="arabic">
1965
+ <div class="olist arabic"><ol class="arabic">
2135
1966
  <li>
2136
1967
  <p>
2137
1968
  By restarting Apache.
@@ -2154,10 +1985,10 @@ command line:</p></div>
2154
1985
  </div>
2155
1986
  </div>
2156
1987
  <div class="sect2">
2157
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_rackup_specifications_for_various_web_frameworks"></span><h3 data-comment-topic="rackup-specifications-for-various-web-frameworks-ndsqc2" data-anchor="_rackup_specifications_for_various_web_frameworks">4.5. Rackup specifications for various web frameworks</h3>
1988
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_rackup_specifications_for_various_web_frameworks" data-comment-topic="rackup-specifications-for-various-web-frameworks-ndsqc2">4.5. Rackup specifications for various web frameworks</h3>
2158
1989
  <div class="paragraph"><p>This subsection shows example <em>config.ru</em> files for various web frameworks.</p></div>
2159
1990
  <div class="sect3">
2160
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_camping"></span><h4 data-comment-topic="camping-1kxexk0" data-anchor="_camping">4.5.1. Camping</h4>
1991
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_camping" data-comment-topic="camping-1kxexk0">4.5.1. Camping</h4>
2161
1992
  <div class="listingblock">
2162
1993
  <div class="content monospaced">
2163
1994
  <pre>require 'rubygems'
@@ -2176,7 +2007,7 @@ run Rack::Adapter::Camping.new(Blog)</pre>
2176
2007
  <div class="paragraph"><p>For Camping versions 2.0 and up, using <span class="monospaced">run Blog</span> as the final line will do.</p></div>
2177
2008
  </div>
2178
2009
  <div class="sect3">
2179
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_halcyon"></span><h4 data-comment-topic="halcyon-1ghnpmz" data-anchor="_halcyon">4.5.2. Halcyon</h4>
2010
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_halcyon" data-comment-topic="halcyon-1ghnpmz">4.5.2. Halcyon</h4>
2180
2011
  <div class="listingblock">
2181
2012
  <div class="content monospaced">
2182
2013
  <pre>require 'rubygems'
@@ -2188,7 +2019,7 @@ run Halcyon::Runner.new</pre>
2188
2019
  </div>
2189
2020
  </div>
2190
2021
  <div class="sect3">
2191
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_mack"></span><h4 data-comment-topic="mack-miht6b" data-anchor="_mack">4.5.3. Mack</h4>
2022
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_mack" data-comment-topic="mack-miht6b">4.5.3. Mack</h4>
2192
2023
  <div class="listingblock">
2193
2024
  <div class="content monospaced">
2194
2025
  <pre>ENV["MACK_ENV"] = ENV["RACK_ENV"]
@@ -2200,7 +2031,7 @@ run Mack::Utils::Server.build_app</pre>
2200
2031
  </div>
2201
2032
  </div>
2202
2033
  <div class="sect3">
2203
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_merb"></span><h4 data-comment-topic="merb-iyj7qy" data-anchor="_merb">4.5.4. Merb</h4>
2034
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_merb" data-comment-topic="merb-iyj7qy">4.5.4. Merb</h4>
2204
2035
  <div class="listingblock">
2205
2036
  <div class="content monospaced">
2206
2037
  <pre>require 'rubygems'
@@ -2219,7 +2050,7 @@ run Merb::Rack::Application.new</pre>
2219
2050
  </div>
2220
2051
  </div>
2221
2052
  <div class="sect3">
2222
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_ramaze"></span><h4 data-comment-topic="ramaze-boddtj" data-anchor="_ramaze">4.5.5. Ramaze</h4>
2053
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_ramaze" data-comment-topic="ramaze-boddtj">4.5.5. Ramaze</h4>
2223
2054
  <div class="listingblock">
2224
2055
  <div class="content monospaced">
2225
2056
  <pre>require "rubygems"
@@ -2232,7 +2063,7 @@ run Ramaze::Adapter::Base</pre>
2232
2063
  </div>
2233
2064
  </div>
2234
2065
  <div class="sect3">
2235
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_sinatra"></span><h4 data-comment-topic="sinatra-1hubto4" data-anchor="_sinatra">4.5.6. Sinatra</h4>
2066
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_sinatra" data-comment-topic="sinatra-1hubto4">4.5.6. Sinatra</h4>
2236
2067
  <div class="listingblock">
2237
2068
  <div class="content monospaced">
2238
2069
  <pre>require 'rubygems'
@@ -2247,14 +2078,171 @@ run Sinatra::Application</pre>
2247
2078
  </div>
2248
2079
  </div>
2249
2080
  <div class="sect1">
2250
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_configuring_phusion_passenger"></span><h2 data-comment-topic="configuring-phusion-passenger-11oztoe" data-anchor="_configuring_phusion_passenger">5. Configuring Phusion Passenger</h2>
2081
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h2 id="_deploying_a_wsgi_python_application" data-comment-topic="deploying-a-wsgi-python-application-7aygdl">5. Deploying a WSGI (Python) application</h2>
2082
+ <div class="sectionbody">
2083
+ <div class="paragraph"><p>Phusion Passenger supports all WSGI-compliant Python web applications. Suppose that you have a WSGI application in <em>/webapps/wsgiapp</em>. Then that folder must contain at least three entries:</p></div>
2084
+ <div class="ulist"><ul>
2085
+ <li>
2086
+ <p>
2087
+ <em>passenger_wsgi.py</em>, which Phusion Passenger will use as the main entry point for your application. This file must export a WSGI object called <span class="monospaced">application</span>.
2088
+ </p>
2089
+ </li>
2090
+ <li>
2091
+ <p>
2092
+ <em>public/</em>, a folder containing public static web assets, like images and stylesheets.
2093
+ </p>
2094
+ </li>
2095
+ <li>
2096
+ <p>
2097
+ <em>tmp/</em>, used for <em>restart.txt</em> (our application restart mechanism). This will be explained in a following subsection.
2098
+ </p>
2099
+ </li>
2100
+ </ul></div>
2101
+ <div class="paragraph"><p>So <em>/webapps/wsgiapp</em> must, at minimum, look like this:</p></div>
2102
+ <div class="listingblock">
2103
+ <div class="content monospaced">
2104
+ <pre>/webapps/wsgiapp
2105
+ |
2106
+ +-- config.ru
2107
+ |
2108
+ +-- public/
2109
+ |
2110
+ +-- tmp/</pre>
2111
+ </div>
2112
+ </div>
2113
+ <div class="sect2">
2114
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_tutorial_example_writing_and_deploying_a_hello_world_wsgi_application" data-comment-topic="tutorial-example-writing-and-deploying-a-hello-world-wsgi-application-9ziqy8">5.1. Tutorial/example: writing and deploying a Hello World WSGI application</h3>
2115
+ <div class="paragraph"><p>First we create a Phusion Passenger-compliant WSGI directory structure:</p></div>
2116
+ <div class="listingblock">
2117
+ <div class="content monospaced">
2118
+ <pre>$ mkdir /webapps/wsgi_example
2119
+ $ mkdir /webapps/wsgi_example/public
2120
+ $ mkdir /webapps/wsgi_example/tmp</pre>
2121
+ </div>
2122
+ </div>
2123
+ <div class="paragraph"><p>Next, we write a minimal "hello world" WSGI application:</p></div>
2124
+ <div class="listingblock">
2125
+ <div class="content monospaced">
2126
+ <pre>$ cd /webapps/wsgi_example
2127
+ $ some_awesome_editor passenger_wsgi.py
2128
+ ...type in some source code...
2129
+ $ cat passenger_wsgi.py
2130
+ def application(environ, start_response):
2131
+ start_response(200, [('Content-Type', 'text/plain')])
2132
+ return ["hello world!\n"]</pre>
2133
+ </div>
2134
+ </div>
2135
+ <div class="paragraph"><p>Finally, we deploy it by adding the following configuration options to
2136
+ the Apache configuration file:</p></div>
2137
+ <div class="listingblock">
2138
+ <div class="content monospaced">
2139
+ <pre>&lt;VirtualHost *:80&gt;
2140
+ ServerName www.wsgiexample.com
2141
+ DocumentRoot /webapps/wsgi_example/public
2142
+ &lt;Directory /webapps/wsgi_example/public&gt;
2143
+ Allow from all
2144
+ Options -MultiViews
2145
+ &lt;/Directory&gt;
2146
+ &lt;/VirtualHost&gt;</pre>
2147
+ </div>
2148
+ </div>
2149
+ <div class="paragraph"><p>And we’re done! After an Apache restart, the above WSGI application will be available
2150
+ under the URL <em>http://www.wsgiexample.com/</em>.</p></div>
2151
+ </div>
2152
+ <div class="sect2">
2153
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_deploying_to_a_virtual_host_8217_s_root_3" data-comment-topic="deploying-to-a-virtual-host-s-root-u9bfax">5.2. Deploying to a virtual host’s root</h3>
2154
+ <div class="paragraph"><p>Add a virtual host entry to your Apache configuration file. Make sure that the
2155
+ following conditions are met:</p></div>
2156
+ <div class="ulist"><ul>
2157
+ <li>
2158
+ <p>
2159
+ The virtual host’s document root must point to your WSGI application’s
2160
+ <em>public</em> folder.
2161
+ </p>
2162
+ </li>
2163
+ <li>
2164
+ <p>
2165
+ The WSGI per-directory permissions must allow access to this folder.
2166
+ </p>
2167
+ </li>
2168
+ <li>
2169
+ <p>
2170
+ MultiViews must be disabled for this folder.
2171
+ </p>
2172
+ </li>
2173
+ </ul></div>
2174
+ <div class="paragraph"><p>For example:</p></div>
2175
+ <div class="listingblock">
2176
+ <div class="content monospaced">
2177
+ <pre>&lt;VirtualHost *:80&gt;
2178
+ ServerName www.wsgiapp.com
2179
+ DocumentRoot /webapps/wsgiapp/public
2180
+ &lt;Directory /webapps/wsgiapp/public&gt;
2181
+ Allow from all
2182
+ Options -MultiViews
2183
+ &lt;/Directory&gt;
2184
+ &lt;/VirtualHost&gt;</pre>
2185
+ </div>
2186
+ </div>
2187
+ <div class="paragraph"><p>You may also need to tweak your file/folder permissions. Make sure that the
2188
+ following folders are readable and executable by Apache:</p></div>
2189
+ <div class="ulist"><ul>
2190
+ <li>
2191
+ <p>
2192
+ this <em>public</em> folder.
2193
+ </p>
2194
+ </li>
2195
+ <li>
2196
+ <p>
2197
+ the application’s <em>config</em> folder.
2198
+ </p>
2199
+ </li>
2200
+ <li>
2201
+ <p>
2202
+ all parent folders. That is, /webapps/wsgiapp and /webapps must also be readable and executable by Apache.
2203
+ </p>
2204
+ </li>
2205
+ </ul></div>
2206
+ <div class="paragraph"><p>Then restart Apache. The application has now been deployed.</p></div>
2207
+ </div>
2208
+ <div class="sect2">
2209
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_redeploying_restarting_the_wsgi_application" data-comment-topic="redeploying-restarting-the-wsgi-application--na7pmf">5.3. Redeploying (restarting the WSGI application)</h3>
2210
+ <div class="paragraph"><p>Deploying a new version of a WSGI application is as simple as
2211
+ re-uploading the application files, and restarting the application.</p></div>
2212
+ <div class="paragraph"><p>There are two ways to restart the application:</p></div>
2213
+ <div class="olist arabic"><ol class="arabic">
2214
+ <li>
2215
+ <p>
2216
+ By restarting Apache.
2217
+ </p>
2218
+ </li>
2219
+ <li>
2220
+ <p>
2221
+ By creating or modifying the file <em>tmp/restart.txt</em> in the WSGI
2222
+ application’s <a href="#application_root">root folder</a>. Phusion Passenger will
2223
+ automatically restart the application.
2224
+ </p>
2225
+ </li>
2226
+ </ol></div>
2227
+ <div class="paragraph"><p>For example, to restart our example application, we type this in the
2228
+ command line:</p></div>
2229
+ <div class="listingblock">
2230
+ <div class="content monospaced">
2231
+ <pre>touch /webapps/wsgiapp/tmp/restart.txt</pre>
2232
+ </div>
2233
+ </div>
2234
+ </div>
2235
+ </div>
2236
+ </div>
2237
+ <div class="sect1">
2238
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h2 id="_configuring_phusion_passenger" data-comment-topic="configuring-phusion-passenger-11oztoe">6. Configuring Phusion Passenger</h2>
2251
2239
  <div class="sectionbody">
2252
2240
  <div class="paragraph"><p>After installation, Phusion Passenger does not need any further configurations.
2253
2241
  Nevertheless, the system administrator may be interested in changing
2254
2242
  Phusion Passenger’s behavior. Phusion Passenger’s Apache module supports the
2255
2243
  following configuration options:</p></div>
2256
2244
  <div class="sect2">
2257
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_passengerroot_lt_directory_gt"></span><h3 data-comment-topic="passengerroot-directory--sere8l" data-anchor="_passengerroot_lt_directory_gt">5.1. PassengerRoot &lt;directory&gt;</h3>
2245
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_passengerroot_lt_directory_gt" data-comment-topic="passengerroot-directory--sere8l">6.1. PassengerRoot &lt;directory&gt;</h3>
2258
2246
  <div class="paragraph"><p>The location to the Phusion Passenger root directory. This configuration option
2259
2247
  is essential to Phusion Passenger, and allows Phusion Passenger to locate its own
2260
2248
  data files. The correct value is given by the installer.</p></div>
@@ -2264,19 +2252,41 @@ this option as well. Please read
2264
2252
  <div class="paragraph"><p>This required option may only occur once, in the global server configuration.</p></div>
2265
2253
  </div>
2266
2254
  <div class="sect2">
2267
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerRuby"></span><h3 data-comment-topic="passengerruby-filename--1r3fv73" data-anchor="PassengerRuby">5.2. PassengerRuby &lt;filename&gt;</h3>
2255
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="PassengerRuby" data-comment-topic="passengerruby-filename--1r3fv73">6.2. PassengerRuby &lt;filename&gt;</h3>
2268
2256
  <div class="paragraph"><p>This option allows one to specify the Ruby interpreter to use.</p></div>
2269
- <div class="paragraph"><p>This option may only occur once, in the global server configuration.
2270
- The default is <em>ruby</em>.</p></div>
2257
+ <div class="paragraph"><p>This option may occur in the following places:</p></div>
2258
+ <div class="ulist"><ul>
2259
+ <li>
2260
+ <p>
2261
+ In the global server configuration.
2262
+ </p>
2263
+ </li>
2264
+ <li>
2265
+ <p>
2266
+ In a virtual host configuration block.
2267
+ </p>
2268
+ </li>
2269
+ <li>
2270
+ <p>
2271
+ In a <span class="monospaced">&lt;Directory&gt;</span> or <span class="monospaced">&lt;Location&gt;</span> block.
2272
+ </p>
2273
+ </li>
2274
+ <li>
2275
+ <p>
2276
+ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span> is on.
2277
+ </p>
2278
+ </li>
2279
+ </ul></div>
2280
+ <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>ruby</em>, meaning that the Ruby interpreter will be looked up according to the <span class="monospaced">PATH</span> environment variable.</p></div>
2271
2281
  </div>
2272
2282
  <div class="sect2">
2273
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerAppRoot"></span><h3 data-comment-topic="passengerapproot-path-to-root--uf24yd" data-anchor="PassengerAppRoot">5.3. PassengerAppRoot &lt;path/to/root&gt;</h3>
2283
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="PassengerAppRoot" data-comment-topic="passengerapproot-path-to-root--uf24yd">6.3. PassengerAppRoot &lt;path/to/root&gt;</h3>
2274
2284
  <div class="paragraph"><p>By default, Phusion Passenger assumes that the application’s root directory
2275
2285
  is the parent directory of the <em>public</em> directory. This option allows one to
2276
2286
  specify the application’s root independently from the DocumentRoot, which
2277
2287
  is useful if the <em>public</em> directory lives in a non-standard place.</p></div>
2278
2288
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
2279
- <div class="ulist"><ul>
2289
+ <div class="ulist"><ul>
2280
2290
  <li>
2281
2291
  <p>
2282
2292
  In the global server configuration.
@@ -2312,11 +2322,11 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
2312
2322
  </div>
2313
2323
  </div>
2314
2324
  <div class="sect2">
2315
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerSpawnMethod"></span><h3 data-comment-topic="passengerspawnmethod-string--sodg2y" data-anchor="PassengerSpawnMethod">5.4. PassengerSpawnMethod &lt;string&gt;</h3>
2325
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="PassengerSpawnMethod" data-comment-topic="passengerspawnmethod-string--sodg2y">6.4. PassengerSpawnMethod &lt;string&gt;</h3>
2316
2326
  <div class="admonitionblock">
2317
- <table><tr>
2327
+ <table><tr>
2318
2328
  <td class="icon">
2319
- <img src="./images/icons/tip.png" alt="Tip">
2329
+ <img src="./images/icons/tip.png" alt="Tip">
2320
2330
  </td>
2321
2331
  <td class="content">
2322
2332
  <div class="title">"What spawn method should I use?"</div>
@@ -2331,88 +2341,56 @@ understand it, as it’s mostly a technical detail. You can basically follow thi
2331
2341
  <div class="paragraph"><p>However, we do recommend you to try to understand it. The <em>smart</em> and <em>smart-lv2</em> spawn
2332
2342
  methods bring many benefits.</p></div>
2333
2343
  </td>
2334
- </tr></table>
2344
+ </tr></table>
2335
2345
  </div>
2336
2346
  <div class="paragraph"><p>Internally, Phusion Passenger spawns multiple Ruby application processes in order to handle
2337
2347
  requests. But there are multiple ways with which processes can be spawned, each having
2338
2348
  its own set of pros and cons. Supported spawn methods are:</p></div>
2339
- <div class="dlist"><dl>
2349
+ <div class="dlist"><dl>
2340
2350
  <dt class="hdlist1">
2341
2351
  <em>smart</em>
2342
2352
  </dt>
2343
2353
  <dd>
2344
2354
  <p>
2345
- When this spawn method is used, Phusion Passenger will attempt to cache any
2346
- framework code (e.g. Ruby on Rails itself) and application code for a limited
2347
- period of time. Please read <a href="#spawning_methods_explained">Spawning methods explained</a>
2348
- for a more detailed explanation of what smart spawning exactly does.
2349
- </p>
2350
- <div class="paragraph"><p><strong>Pros:</strong>
2351
- This can significantly decrease spawn time (by as much as 90%). And, when Ruby Enterprise
2352
- Edition is used, <a href="#reducing_memory_usage">memory usage can be reduced by 33% on average</a>.</p></div>
2353
- <div class="paragraph"><p><strong>Cons:</strong>
2354
- Some applications and libraries are not compatible with smart spawning.
2355
- If that’s the case for your application, then you should use <em>conservative</em> as
2356
- spawning method. Please read <a href="#spawning_methods_explained">Spawning methods explained</a>
2357
- for possible compatibility issues.</p></div>
2358
- </dd>
2359
- <dt class="hdlist1">
2360
- <em>smart-lv2</em>
2361
- </dt>
2362
- <dd>
2363
- <p>
2364
- This spawning method is similar to <em>smart</em> but it skips the framework spawner
2365
- and uses the application spawner directly. This means the framework code is not
2366
- cached between multiple applications, although it is still cached within
2355
+ This spawning method caches code using the app preloader. Framework code is not
2356
+ cached between multiple applications, although it is cached within
2367
2357
  instances of the same application. Please read
2368
2358
  <a href="#spawning_methods_explained">Spawning methods explained</a> for a more detailed
2369
- explanation of what smart-lv2 spawning exactly does.
2359
+ explanation of what smart spawning exactly does.
2370
2360
  </p>
2371
- <div class="paragraph"><p><strong>Pros:</strong> It is compatible with a larger number of applications when compared to
2372
- the <em>smart</em> method, and still performs some caching.</p></div>
2373
- <div class="paragraph"><p><strong>Cons:</strong> It is slower than smart spawning if you have many applications which
2374
- use the same framework version. It is therefore advised that shared hosts use the
2375
- <em>smart</em> method instead.</p></div>
2361
+ <div class="paragraph"><p><strong>Pros:</strong>
2362
+ Smart spawning caches code where possible to speed up the respawn process
2363
+ and is compatible with most applications</p></div>
2364
+ <div class="paragraph"><p><strong>Cons:</strong>
2365
+ It is possible that it may be incompatible with some applications</p></div>
2376
2366
  </dd>
2377
2367
  <dt class="hdlist1">
2378
- <em>conservative</em>
2368
+ <em>direct</em>
2379
2369
  </dt>
2380
2370
  <dd>
2381
2371
  <p>
2382
2372
  This spawning method is similar to the one used in Mongrel Cluster. It does not
2383
2373
  perform any code caching at all. Please read
2384
2374
  <a href="#spawning_methods_explained">Spawning methods explained</a> for a more detailed
2385
- explanation of what conservative spawning exactly does.
2375
+ explanation of what direct spawning exactly does.
2386
2376
  </p>
2387
2377
  <div class="paragraph"><p><strong>Pros:</strong>
2388
- Conservative spawning is guaranteed to be compatible with all applications
2378
+ Direct spawning is guaranteed to be compatible with all applications
2389
2379
  and libraries.</p></div>
2390
2380
  <div class="paragraph"><p><strong>Cons:</strong>
2391
2381
  Much slower than smart spawning. Every spawn action will be equally slow, though no slower than
2392
- the startup time of a single server in Mongrel Cluster. Conservative spawning will also
2382
+ the startup time of a single server in Mongrel Cluster. Direct spawning will also
2393
2383
  render <a href="#reducing_memory_usage">Ruby Enterprise Edition’s memory reduction technology</a> useless.</p></div>
2394
2384
  </dd>
2395
2385
  </dl></div>
2396
- <div class="paragraph"><p>This option may occur in the following places:</p></div>
2397
- <div class="ulist"><ul>
2398
- <li>
2399
- <p>
2400
- In the global server configuration.
2401
- </p>
2402
- </li>
2403
- <li>
2404
- <p>
2405
- In a virtual host configuration block.
2406
- </p>
2407
- </li>
2408
- </ul></div>
2409
- <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>smart-lv2</em>.</p></div>
2386
+ <div class="sidebarblock">
2387
+ <div class="content">
2388
+ <div class="paragraph"><p>As of Passenger 3.2, <em>conservative</em> spawning was renamed to <em>direct</em> and <em>smart-lv2</em> was renamed
2389
+ to <em>smart</em>. The old <em>smart</em> spawning has been removed in favor of the new version.</p></div>
2390
+ </div>
2410
2391
  </div>
2411
- <div class="sect2">
2412
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerUseGlobalQueue"></span><h3 data-comment-topic="passengeruseglobalqueue-on-off--1ki369" data-anchor="PassengerUseGlobalQueue">5.5. PassengerUseGlobalQueue &lt;on|off&gt;</h3>
2413
- <div class="paragraph"><p>Turns the use of global queuing on or off.</p></div>
2414
2392
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
2415
- <div class="ulist"><ul>
2393
+ <div class="ulist"><ul>
2416
2394
  <li>
2417
2395
  <p>
2418
2396
  In the global server configuration.
@@ -2424,89 +2402,10 @@ In a virtual host configuration block.
2424
2402
  </p>
2425
2403
  </li>
2426
2404
  </ul></div>
2427
- <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>on</em>.</p></div>
2428
- <div class="paragraph"><p><em>This feature is sponsored by <a href="http://www.37signals.com/">37signals</a>.</em></p></div>
2429
- <div class="paragraph">
2430
- <div class="title">What does this option do?</div>
2431
- <p>Recall that Phusion Passenger spawns multiple backend processes (e.g. multiple
2432
- Ruby on Rails processes), each which processes HTTP requests serially. One of
2433
- Phusion Passenger’s jobs is to forward HTTP requests to a suitable backend
2434
- process. A backend process may take an arbitrary amount of time to process a
2435
- specific HTTP request. If the websites are (temporarily) under high load, and
2436
- the backend processes cannot process the requests fast enough, then some
2437
- requests may have to be queued.</p>
2438
- </div>
2439
- <div class="paragraph"><p>If global queuing is turned off, then Phusion Passenger will use <em>fair load
2440
- balancing</em>. This means that each backend process will have its own private
2441
- queue. Phusion Passenger will forward an HTTP request to the backend process
2442
- that has the least amount of requests in its queue.</p></div>
2443
- <div class="paragraph"><p>If global queuing is turned on, then Phusion Passenger will use a global queue
2444
- that’s shared between all backend processes. If an HTTP request comes in, and
2445
- all the backend processes are still busy, then Phusion Passenger will wait until
2446
- at least one backend process is done, and will then forward the request to that
2447
- process.</p></div>
2448
- <div class="paragraph">
2449
- <div class="title">When to turn on global queuing?</div>
2450
- <p>You should turn on global queuing if one of your web applications may have
2451
- long-running requests.</p>
2452
- </div>
2453
- <div class="paragraph"><p>For example suppose that:</p></div>
2454
- <div class="ulist"><ul>
2455
- <li>
2456
- <p>
2457
- global queuing is turned off.
2458
- </p>
2459
- </li>
2460
- <li>
2461
- <p>
2462
- we’re currently in a state where all backend processes have 3 requests in
2463
- their queue, except for a single backend process, which has 1 request in its
2464
- queue.
2465
- </p>
2466
- </li>
2467
- </ul></div>
2468
- <div class="paragraph"><p>The situation looks like this:</p></div>
2469
- <div class="listingblock">
2470
- <div class="content monospaced">
2471
- <pre>Backend process A: [* ] (1 request in queue)
2472
- Backend process B: [*** ] (3 requests in queue)
2473
- Backend process C: [*** ] (3 requests in queue)
2474
- Backend process D: [*** ] (3 requests in queue)</pre>
2475
- </div>
2476
- </div>
2477
- <div class="paragraph"><p>Each process is currently serving short-running requests.</p></div>
2478
- <div class="paragraph"><p>Phusion Passenger will forward the next request to backend process A. A will
2479
- now have 2 items in its queue. We’ll mark this new request with an X:</p></div>
2480
- <div class="listingblock">
2481
- <div class="content monospaced">
2482
- <pre>Backend process A: [*X ] (2 request in queue)
2483
- Backend process B: [*** ] (3 requests in queue)
2484
- Backend process C: [*** ] (3 requests in queue)
2485
- Backend process D: [*** ] (3 requests in queue)</pre>
2486
- </div>
2487
- </div>
2488
- <div class="paragraph"><p>Assuming that B, C and D still aren’t done with their current request, the next
2489
- HTTP request - let’s call this Y - will be forwarded to backend process A as
2490
- well, because it has the least number of items in its queue:</p></div>
2491
- <div class="listingblock">
2492
- <div class="content monospaced">
2493
- <pre>Backend process A: [*XY ] (3 requests in queue)
2494
- Backend process B: [*** ] (3 requests in queue)
2495
- Backend process C: [*** ] (3 requests in queue)
2496
- Backend process D: [*** ] (3 requests in queue)</pre>
2497
- </div>
2498
- </div>
2499
- <div class="paragraph"><p>But if request X happens to be a long-running request that needs 60 seconds to
2500
- complete, then we’ll have a problem. Y won’t be processed for at least 60
2501
- seconds. It would have been a better idea if Y was forward to processes B, C or
2502
- D instead, because they only have short-living requests in their queues.</p></div>
2503
- <div class="paragraph"><p>This problem will be avoided entirely if you turn global queuing on. With global
2504
- queuing, all backend processes will share the same queue. The first backend
2505
- process that becomes available will take from the queue, and so this
2506
- “queuing-behind-long-running-request” problem will never occur.</p></div>
2405
+ <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>smart-lv2</em>.</p></div>
2507
2406
  </div>
2508
2407
  <div class="sect2">
2509
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_passengerenabled_lt_on_off_gt"></span><h3 data-comment-topic="passengerenabled-on-off--74rzth" data-anchor="_passengerenabled_lt_on_off_gt">5.6. PassengerEnabled &lt;on|off&gt;</h3>
2408
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_passengerenabled_lt_on_off_gt" data-comment-topic="passengerenabled-on-off--74rzth">6.5. PassengerEnabled &lt;on|off&gt;</h3>
2510
2409
  <div class="paragraph"><p>You can set this option to <em>off</em> to completely disable Phusion Passenger for
2511
2410
  a certain location. This is useful if, for example, you want to integrate a PHP
2512
2411
  application into the same virtual host as a Rails application.</p></div>
@@ -2528,7 +2427,7 @@ follows:</p></div>
2528
2427
  </div>
2529
2428
  <div class="paragraph"><p>This way, Phusion Passenger will not interfere with Wordpress.</p></div>
2530
2429
  <div class="paragraph"><p><em>PassengerEnabled</em> may occur in the following places:</p></div>
2531
- <div class="ulist"><ul>
2430
+ <div class="ulist"><ul>
2532
2431
  <li>
2533
2432
  <p>
2534
2433
  In the global server configuration.
@@ -2553,7 +2452,7 @@ In <em>.htaccess</em>.
2553
2452
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>on</em>.</p></div>
2554
2453
  </div>
2555
2454
  <div class="sect2">
2556
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerTempDir"></span><h3 data-comment-topic="passengertempdir-directory--68h2ng" data-anchor="PassengerTempDir">5.7. PassengerTempDir &lt;directory&gt;</h3>
2455
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="PassengerTempDir" data-comment-topic="passengertempdir-directory--68h2ng">6.6. PassengerTempDir &lt;directory&gt;</h3>
2557
2456
  <div class="paragraph"><p>Specifies the directory that Phusion Passenger should use for storing temporary
2558
2457
  files. This includes things such as Unix socket files, buffered file uploads
2559
2458
  (see also <a href="#PassengerUploadBufferDir">PassengerUploadBufferDir</a>), etc.</p></div>
@@ -2582,7 +2481,7 @@ sudo -E passenger-status
2582
2481
  </div>
2583
2482
  </div>
2584
2483
  <div class="sect2">
2585
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerUploadBufferDir"></span><h3 data-comment-topic="passengeruploadbufferdir-directory--kdr8at" data-anchor="PassengerUploadBufferDir">5.8. PassengerUploadBufferDir &lt;directory&gt;</h3>
2484
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="PassengerUploadBufferDir" data-comment-topic="passengeruploadbufferdir-directory--kdr8at">6.7. PassengerUploadBufferDir &lt;directory&gt;</h3>
2586
2485
  <div class="paragraph"><p>Phusion Passenger buffers large file uploads to disk in order prevent slow file
2587
2486
  uploads from blocking web applications. By default, a subdirectory in the
2588
2487
  system’s temporary files directory (or a subdirectory in the directory specified
@@ -2600,7 +2499,7 @@ Apache worker processes as different users. So if you’re using apace2-mpm-itk,
2600
2499
  you should set this option to a directory that is writable by all Apache worker
2601
2500
  processes, such as <em>/tmp</em>.</p></div>
2602
2501
  <div class="paragraph"><p>You may specify <em>PassengerUploadBufferDir</em> in the following places:</p></div>
2603
- <div class="ulist"><ul>
2502
+ <div class="ulist"><ul>
2604
2503
  <li>
2605
2504
  <p>
2606
2505
  In the global server configuration.
@@ -2625,7 +2524,7 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverrides Options</span>
2625
2524
  <div class="paragraph"><p>In each place, it may be specified at most once.</p></div>
2626
2525
  </div>
2627
2526
  <div class="sect2">
2628
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_passengerrestartdir_lt_directory_gt"></span><h3 data-comment-topic="passengerrestartdir-directory--1fmhmv0" data-anchor="_passengerrestartdir_lt_directory_gt">5.9. PassengerRestartDir &lt;directory&gt;</h3>
2527
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_passengerrestartdir_lt_directory_gt" data-comment-topic="passengerrestartdir-directory--1fmhmv0">6.8. PassengerRestartDir &lt;directory&gt;</h3>
2629
2528
  <div class="paragraph"><p>As described in the deployment chapters of this document, Phusion Passenger
2630
2529
  checks the file <em>tmp/restart.txt</em> in the applications'
2631
2530
  <a href="#application_root">root directory</a> for restarting applications. Sometimes it
@@ -2633,7 +2532,7 @@ may be desirable for Phusion Passenger to look in a different directory instead,
2633
2532
  for example for security reasons (see below). This option allows you to
2634
2533
  customize the directory in which <em>restart.txt</em> is searched for.</p></div>
2635
2534
  <div class="paragraph"><p>You may specify <em>PassengerRestartDir</em> in the following places:</p></div>
2636
- <div class="ulist"><ul>
2535
+ <div class="ulist"><ul>
2637
2536
  <li>
2638
2537
  <p>
2639
2538
  In the global server configuration.
@@ -2699,7 +2598,7 @@ allow the attacker to cause a Denial-of-Service.</p>
2699
2598
  directory that’s readable by Apache, but only writable by administrators.</p></div>
2700
2599
  </div>
2701
2600
  <div class="sect2">
2702
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerBufferResponse"></span><h3 data-comment-topic="passengerbufferresponse-on-off--1y7ilka" data-anchor="PassengerBufferResponse">5.10. PassengerBufferResponse &lt;on|off&gt;</h3>
2601
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="PassengerBufferResponse" data-comment-topic="passengerbufferresponse-on-off--1y7ilka">6.9. PassengerBufferResponse &lt;on|off&gt;</h3>
2703
2602
  <div class="paragraph"><p>When turned on, application-generated responses are buffered in memory. By buffering
2704
2603
  responses, protection is provided against slow HTTP clients that can not read your
2705
2604
  response immediately.</p></div>
@@ -2746,7 +2645,7 @@ after which it receives the entire response at once.
2746
2645
  When response buffering is turned off, it works as expected: the client
2747
2646
  receives an "entry X" message every second for 10 seconds.</p></div>
2748
2647
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
2749
- <div class="ulist"><ul>
2648
+ <div class="ulist"><ul>
2750
2649
  <li>
2751
2650
  <p>
2752
2651
  In the global server configuration.
@@ -2770,19 +2669,19 @@ In <em>.htaccess</em>.
2770
2669
  </ul></div>
2771
2670
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>on</em>.</p></div>
2772
2671
  <div class="admonitionblock">
2773
- <table><tr>
2672
+ <table><tr>
2774
2673
  <td class="icon">
2775
- <img src="./images/icons/note.png" alt="Note">
2674
+ <img src="./images/icons/note.png" alt="Note">
2776
2675
  </td>
2777
2676
  <td class="content">
2778
2677
  <div class="paragraph"><p>The <a href="#PassengerBufferResponse">PassengerBufferResponse</a> directive should be turned off
2779
2678
  if responses can be huge. Because entire responses are buffered in memory when turned on.</p></div>
2780
2679
  </td>
2781
- </tr></table>
2680
+ </tr></table>
2782
2681
  </div>
2783
2682
  </div>
2784
2683
  <div class="sect2">
2785
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerRollingRestarts"></span><h3 data-comment-topic="passengerrollingrestarts" data-anchor="PassengerRollingRestarts">5.11. PassengerRollingRestarts &lt;on|off&gt;</h3>
2684
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="PassengerRollingRestarts" data-comment-topic="passengerrollingrestarts">6.10. PassengerRollingRestarts &lt;on|off&gt;</h3>
2786
2685
  <div class="paragraph"><p><strong>This feature is only available in <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a>. It was introduced in version 3.0.0. <a href="https://www.phusionpassenger.com/download">Buy Phusion Passenger Enterprise here.</a></strong></p></div>
2787
2686
  <div class="paragraph"><p>Enables or disables support for rolling restarts. Normally when you
2788
2687
  restart an application (by touching restart.txt), Phusion Passenger would
@@ -2791,7 +2690,7 @@ of a new application process could take a while, and any requests that
2791
2690
  come in during this time will be blocked until this first application
2792
2691
  process has spawned.</p></div>
2793
2692
  <div class="paragraph"><p>But when rolling restarts are enabled, Phusion Passenger Enterprise will:</p></div>
2794
- <div class="olist arabic"><ol class="arabic">
2693
+ <div class="olist arabic"><ol class="arabic">
2795
2694
  <li>
2796
2695
  <p>
2797
2696
  Spawn a new process in the background.
@@ -2810,7 +2709,7 @@ Step 1 and 2 are repeated until all processes have been replaced.
2810
2709
  </ol></div>
2811
2710
  <div class="paragraph"><p>This way, visitors will not experience any delays when you are restarting your application. This allows you to, for example, upgrade your application often without degrading user experience.</p></div>
2812
2711
  <div class="paragraph"><p>Rolling restarts have a few caveat however that you should be aware of:</p></div>
2813
- <div class="ulist"><ul>
2712
+ <div class="ulist"><ul>
2814
2713
  <li>
2815
2714
  <p>
2816
2715
  Upgrading an application sometimes involves upgrading the database schema.
@@ -2830,7 +2729,7 @@ Because there’s no telling which process will serve a request, users may
2830
2729
  </li>
2831
2730
  </ul></div>
2832
2731
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
2833
- <div class="ulist"><ul>
2732
+ <div class="ulist"><ul>
2834
2733
  <li>
2835
2734
  <p>
2836
2735
  In the global server configuration.
@@ -2855,12 +2754,12 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
2855
2754
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>off</em>.</p></div>
2856
2755
  </div>
2857
2756
  <div class="sect2">
2858
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_passengerresistdeploymenterrors_lt_on_off_gt"></span><h3 data-comment-topic="passengerresistdeploymenterrors" data-anchor="_passengerresistdeploymenterrors_lt_on_off_gt">5.12. PassengerResistDeploymentErrors &lt;on|off&gt;</h3>
2757
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_passengerresistdeploymenterrors_lt_on_off_gt" data-comment-topic="passengerresistdeploymenterrors">6.11. PassengerResistDeploymentErrors &lt;on|off&gt;</h3>
2859
2758
  <div class="paragraph"><p><strong>This feature is only available in <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a>. It was introduced in version 3.0.0. <a href="https://www.phusionpassenger.com/download">Buy Phusion Passenger Enterprise here.</a></strong></p></div>
2860
2759
  <div class="paragraph"><p>Enables or disables resistance against deployment errors.</p></div>
2861
2760
  <div class="paragraph"><p>Suppose you’ve upgraded your application and you’ve issues a command to restart it (by touching restart.txt), but the application code contains an error that prevents Phusion Passenger from successfully spawning a process (e.g. a syntax error). Phusion Passenger would normally display an error message in response to this.</p></div>
2862
2761
  <div class="paragraph"><p>By enabling deployment error resistance, Phusion Passenger Enterprise would instead do this:</p></div>
2863
- <div class="ulist"><ul>
2762
+ <div class="ulist"><ul>
2864
2763
  <li>
2865
2764
  <p>
2866
2765
  It passes the request to one of the existing application processes (that belong to the previous version of the application). The visitor will not see a Phusion Passenger process spawning error message.
@@ -2880,7 +2779,7 @@ It sets an internal flag so that no processes for this application will be spawn
2880
2779
  <div class="paragraph"><p>This way, visitors will suffer minimally from deployment errors. Phusion Passenger will attempt to restart the application again next time restart.txt is touched.</p></div>
2881
2780
  <div class="paragraph"><p>Enabling deployment error resistance only works if <a href="#PassengerRollingRestarts">rolling restart</a> is also enabled.</p></div>
2882
2781
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
2883
- <div class="ulist"><ul>
2782
+ <div class="ulist"><ul>
2884
2783
  <li>
2885
2784
  <p>
2886
2785
  In the global server configuration.
@@ -2905,22 +2804,22 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
2905
2804
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>off</em>.</p></div>
2906
2805
  </div>
2907
2806
  <div class="sect2">
2908
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_security_options"></span><h3 data-comment-topic="security-options-1pb75ho" data-anchor="_security_options">5.13. Security options</h3>
2807
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_security_options" data-comment-topic="security-options-1pb75ho">6.12. Security options</h3>
2909
2808
  <div class="sect3">
2910
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerUserSwitching"></span><h4 data-comment-topic="passengeruserswitching" data-anchor="PassengerUserSwitching">5.13.1. PassengerUserSwitching &lt;on|off&gt;</h4>
2809
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="PassengerUserSwitching" data-comment-topic="passengeruserswitching">6.12.1. PassengerUserSwitching &lt;on|off&gt;</h4>
2911
2810
  <div class="paragraph"><p>Whether to enable <a href="#user_switching">user switching support</a>.</p></div>
2912
2811
  <div class="paragraph"><p>This option may only occur once, in the global server configuration.
2913
2812
  The default value is <em>on</em>.</p></div>
2914
2813
  </div>
2915
2814
  <div class="sect3">
2916
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_passengeruser_lt_username_gt"></span><h4 data-comment-topic="passengeruser" data-anchor="_passengeruser_lt_username_gt">5.13.2. PassengerUser &lt;username&gt;</h4>
2815
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_passengeruser_lt_username_gt" data-comment-topic="passengeruser">6.12.2. PassengerUser &lt;username&gt;</h4>
2917
2816
  <div class="paragraph"><p>If <a href="#user_switching">user switching support</a> is enabled, then Phusion Passenger will
2918
2817
  by default run the web application as the owner of the file <em>config/environment.rb</em>
2919
2818
  (for Rails apps) or <em>config.ru</em> (for Rack apps). This option allows you to override
2920
2819
  that behavior and explicitly set a user to run the web application as, regardless
2921
2820
  of the ownership of <em>environment.rb</em>/<em>config.ru</em>.</p></div>
2922
2821
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
2923
- <div class="ulist"><ul>
2822
+ <div class="ulist"><ul>
2924
2823
  <li>
2925
2824
  <p>
2926
2825
  In the global server configuration.
@@ -2940,7 +2839,7 @@ In a <span class="monospaced">&lt;Directory&gt;</span> or <span class="monospace
2940
2839
  <div class="paragraph"><p>In each place, it may be specified at most once.</p></div>
2941
2840
  </div>
2942
2841
  <div class="sect3">
2943
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_passengergroup_lt_group_name_gt"></span><h4 data-comment-topic="passengergroup" data-anchor="_passengergroup_lt_group_name_gt">5.13.3. PassengerGroup &lt;group name&gt;</h4>
2842
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_passengergroup_lt_group_name_gt" data-comment-topic="passengergroup">6.12.3. PassengerGroup &lt;group name&gt;</h4>
2944
2843
  <div class="paragraph"><p>If <a href="#user_switching">user switching support</a> is enabled, then Phusion Passenger will
2945
2844
  by default run the web application as the primary group of the owner of the file
2946
2845
  <em>config/environment.rb</em> (for Rails apps) or <em>config.ru</em> (for Rack apps). This option
@@ -2949,7 +2848,7 @@ as, regardless of the ownership of <em>environment.rb</em>/<em>config.ru</em>.</
2949
2848
  <div class="paragraph"><p><em>&lt;group name&gt;</em> may also be set to the special value <em>!STARTUP_FILE!</em>, in which case
2950
2849
  the web application’s group will be set to <em>environment.rb</em>/<em>config.ru</em>'s group.</p></div>
2951
2850
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
2952
- <div class="ulist"><ul>
2851
+ <div class="ulist"><ul>
2953
2852
  <li>
2954
2853
  <p>
2955
2854
  In the global server configuration.
@@ -2969,7 +2868,7 @@ In a <span class="monospaced">&lt;Directory&gt;</span> or <span class="monospace
2969
2868
  <div class="paragraph"><p>In each place, it may be specified at most once.</p></div>
2970
2869
  </div>
2971
2870
  <div class="sect3">
2972
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerDefaultUser"></span><h4 data-comment-topic="passengerdefaultuser" data-anchor="PassengerDefaultUser">5.13.4. PassengerDefaultUser &lt;username&gt;</h4>
2871
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="PassengerDefaultUser" data-comment-topic="passengerdefaultuser">6.12.4. PassengerDefaultUser &lt;username&gt;</h4>
2973
2872
  <div class="paragraph"><p>Phusion Passenger enables <a href="#user_switching">user switching support</a> by default.
2974
2873
  This configuration option allows one to specify the user that applications must
2975
2874
  run as, if user switching fails or is disabled.</p></div>
@@ -2977,7 +2876,7 @@ run as, if user switching fails or is disabled.</p></div>
2977
2876
  The default value is <em>nobody</em>.</p></div>
2978
2877
  </div>
2979
2878
  <div class="sect3">
2980
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerDefaultGroup"></span><h4 data-comment-topic="passengerdefaultgroup" data-anchor="PassengerDefaultGroup">5.13.5. PassengerDefaultGroup &lt;group name&gt;</h4>
2879
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="PassengerDefaultGroup" data-comment-topic="passengerdefaultgroup">6.12.5. PassengerDefaultGroup &lt;group name&gt;</h4>
2981
2880
  <div class="paragraph"><p>Phusion Passenger enables <a href="#user_switching">user switching support</a> by default.
2982
2881
  This configuration option allows one to specify the group that applications must
2983
2882
  run as, if user switching fails or is disabled.</p></div>
@@ -2986,7 +2885,7 @@ The default value is the primary group of the user specifified by
2986
2885
  <a href="#PassengerDefaultUser">PassengerDefaultUser</a>.</p></div>
2987
2886
  </div>
2988
2887
  <div class="sect3">
2989
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_passengerfriendlyerrorpages_lt_on_off_gt"></span><h4 data-comment-topic="passengerfriendlyerrorpages" data-anchor="_passengerfriendlyerrorpages_lt_on_off_gt">5.13.6. PassengerFriendlyErrorPages &lt;on|off&gt;</h4>
2888
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_passengerfriendlyerrorpages_lt_on_off_gt" data-comment-topic="passengerfriendlyerrorpages">6.12.6. PassengerFriendlyErrorPages &lt;on|off&gt;</h4>
2990
2889
  <div class="paragraph"><p>Phusion Passenger can display friendly error pages whenever an application fails
2991
2890
  to start. This friendly error page presents the startup error message, some
2992
2891
  suggestions for solving the problem, and a backtrace. This feature is very useful
@@ -2995,7 +2894,7 @@ but the page might reveal potentially sensitive information, depending on the
2995
2894
  application. Experienced system administrators who are using Phusion Passenger
2996
2895
  on serious production servers should consider turning this feature off.</p></div>
2997
2896
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
2998
- <div class="ulist"><ul>
2897
+ <div class="ulist"><ul>
2999
2898
  <li>
3000
2899
  <p>
3001
2900
  In the global server configuration.
@@ -3021,9 +2920,9 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
3021
2920
  </div>
3022
2921
  </div>
3023
2922
  <div class="sect2">
3024
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_resource_control_and_optimization_options"></span><h3 data-comment-topic="resource-control-and-optimization-options-zu2f7u" data-anchor="_resource_control_and_optimization_options">5.14. Resource control and optimization options</h3>
2923
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_resource_control_and_optimization_options" data-comment-topic="resource-control-and-optimization-options-zu2f7u">6.13. Resource control and optimization options</h3>
3025
2924
  <div class="sect3">
3026
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_passengermaxpoolsize_lt_integer_gt"></span><h4 data-comment-topic="passengermaxpoolsize-integer--am64q8" data-anchor="_passengermaxpoolsize_lt_integer_gt">5.14.1. PassengerMaxPoolSize &lt;integer&gt;</h4>
2925
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_passengermaxpoolsize_lt_integer_gt" data-comment-topic="passengermaxpoolsize-integer--am64q8">6.13.1. PassengerMaxPoolSize &lt;integer&gt;</h4>
3027
2926
  <div class="paragraph"><p>The maximum number of <a href="#application_process">application processes</a> that may
3028
2927
  simultaneously exist. A larger number results in higher memory usage,
3029
2928
  but improved ability to handle concurrent HTTP clients.</p></div>
@@ -3040,24 +2939,24 @@ hardware or getting more servers.)</p></div>
3040
2939
  <div class="paragraph"><p>This option may only occur once, in the global server configuration.
3041
2940
  The default value is <em>6</em>.</p></div>
3042
2941
  <div class="admonitionblock">
3043
- <table><tr>
2942
+ <table><tr>
3044
2943
  <td class="icon">
3045
- <img src="./images/icons/tip.png" alt="Tip">
2944
+ <img src="./images/icons/tip.png" alt="Tip">
3046
2945
  </td>
3047
2946
  <td class="content">We strongly recommend you to <a href="#reducing_memory_usage">use Ruby Enterprise Edition</a>. This allows you to reduce the memory usage of your Ruby on Rails applications
3048
2947
  by about 33%, and it’s not hard to install.</td>
3049
- </tr></table>
2948
+ </tr></table>
3050
2949
  </div>
3051
2950
  </div>
3052
2951
  <div class="sect3">
3053
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerMinInstances"></span><h4 data-comment-topic="passengermininstances-integer--wegq6b" data-anchor="PassengerMinInstances">5.14.2. PassengerMinInstances &lt;integer&gt;</h4>
2952
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="PassengerMinInstances" data-comment-topic="passengermininstances-integer--wegq6b">6.13.2. PassengerMinInstances &lt;integer&gt;</h4>
3054
2953
  <div class="paragraph"><p>This specifies the minimum number of application processes that should exist for a
3055
2954
  given application. You should set this option to a
3056
2955
  non-zero value if you want to avoid potentially long startup times after a website
3057
2956
  has been <a href="#idle_process">idle</a> for an extended period.</p></div>
3058
2957
  <div class="paragraph"><p>Please note that this option does <strong>not</strong> pre-start application processes during Apache
3059
2958
  startup. It just makes sure that when the application is first accessed:</p></div>
3060
- <div class="olist arabic"><ol class="arabic">
2959
+ <div class="olist arabic"><ol class="arabic">
3061
2960
  <li>
3062
2961
  <p>
3063
2962
  at least the given number of processes will be spawned.
@@ -3096,7 +2995,7 @@ simultanously. Phusion Passenger will start 12 more application processes. After
3096
2995
  timeout of 10 seconds have passed, Phusion Passenger will clean up 12 application
3097
2996
  processes, keeping 3 processes around.</p></div>
3098
2997
  <div class="paragraph"><p>The PassengerMinInstances option may occur in the following places:</p></div>
3099
- <div class="ulist"><ul>
2998
+ <div class="ulist"><ul>
3100
2999
  <li>
3101
3000
  <p>
3102
3001
  In the global server configuration.
@@ -3121,7 +3020,7 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Limits</span> i
3121
3020
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>1</em>.</p></div>
3122
3021
  </div>
3123
3022
  <div class="sect3">
3124
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_passengermaxinstances_lt_integer_gt"></span><h4 data-comment-topic="passengermaxinstances" data-anchor="_passengermaxinstances_lt_integer_gt">5.14.3. PassengerMaxInstances &lt;integer&gt;</h4>
3023
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_passengermaxinstances_lt_integer_gt" data-comment-topic="passengermaxinstances">6.13.3. PassengerMaxInstances &lt;integer&gt;</h4>
3125
3024
  <div class="paragraph"><p><strong>This feature is only available in <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a>. It was introduced in version 3.0.0. <a href="https://www.phusionpassenger.com/download">Buy Phusion Passenger Enterprise here.</a></strong></p></div>
3126
3025
  <div class="paragraph"><p>The maximum number of application processes that may simultaneously exist
3127
3026
  for an application. This helps to make sure that a single application
@@ -3131,7 +3030,7 @@ means that there is no limit placed on the number of processes a single applicat
3131
3030
  may spawn, i.e. only the global limit of <a href="#PassengerMaxPoolSize">PassengerMaxPoolSize</a>
3132
3031
  will be enforced.</p></div>
3133
3032
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3134
- <div class="ulist"><ul>
3033
+ <div class="ulist"><ul>
3135
3034
  <li>
3136
3035
  <p>
3137
3036
  In the global server configuration.
@@ -3145,9 +3044,9 @@ In a virtual host configuration block.
3145
3044
  </ul></div>
3146
3045
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>0</em>.</p></div>
3147
3046
  <div class="admonitionblock">
3148
- <table><tr>
3047
+ <table><tr>
3149
3048
  <td class="icon">
3150
- <img src="./images/icons/tip.png" alt="Tip">
3049
+ <img src="./images/icons/tip.png" alt="Tip">
3151
3050
  </td>
3152
3051
  <td class="content">
3153
3052
  <div class="title">Practical usage example</div>
@@ -3158,11 +3057,11 @@ to 10. The e-commerce website is more important to you. You can then set
3158
3057
  than 3 processes, even if it suddenly gets a lot of traffic. Your e-commerce website
3159
3058
  on the other hand will be free to spawn up to 10 processes if it gets a lot of traffic.</p></div>
3160
3059
  </td>
3161
- </tr></table>
3060
+ </tr></table>
3162
3061
  </div>
3163
3062
  </div>
3164
3063
  <div class="sect3">
3165
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_passengermaxinstancesperapp_lt_integer_gt"></span><h4 data-comment-topic="passengermaxinstancesperapp" data-anchor="_passengermaxinstancesperapp_lt_integer_gt">5.14.4. PassengerMaxInstancesPerApp &lt;integer&gt;</h4>
3064
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_passengermaxinstancesperapp_lt_integer_gt" data-comment-topic="passengermaxinstancesperapp">6.13.4. PassengerMaxInstancesPerApp &lt;integer&gt;</h4>
3166
3065
  <div class="paragraph"><p>The maximum number of application processes that may simultaneously exist
3167
3066
  for a single application. This helps to make sure that a single application
3168
3067
  will not occupy all available slots in the application pool.</p></div>
@@ -3173,9 +3072,9 @@ will be enforced.</p></div>
3173
3072
  <div class="paragraph"><p>This option may only occur once, in the global server configuration.
3174
3073
  The default value is <em>0</em>.</p></div>
3175
3074
  <div class="admonitionblock">
3176
- <table><tr>
3075
+ <table><tr>
3177
3076
  <td class="icon">
3178
- <img src="./images/icons/tip.png" alt="Tip">
3077
+ <img src="./images/icons/tip.png" alt="Tip">
3179
3078
  </td>
3180
3079
  <td class="content">
3181
3080
  <div class="title">Practical usage example</div>
@@ -3189,12 +3088,12 @@ settled down and it has released more pool slots.</p></div>
3189
3088
  <em>PassengerMaxInstancesPerApp</em> to 5. This way, both blogs will never use more
3190
3089
  than 5 pool slots.</p></div>
3191
3090
  </td>
3192
- </tr></table>
3091
+ </tr></table>
3193
3092
  </div>
3194
3093
  <div class="admonitionblock">
3195
- <table><tr>
3094
+ <table><tr>
3196
3095
  <td class="icon">
3197
- <img src="./images/icons/note.png" alt="Note">
3096
+ <img src="./images/icons/note.png" alt="Note">
3198
3097
  </td>
3199
3098
  <td class="content">
3200
3099
  <div class="title">Relation with PassengerMaxInstances</div>
@@ -3211,11 +3110,11 @@ on the other hand will be free to use up all 10 slots if it gets a lot of traffi
3211
3110
  different web applications, while <em>PassengerMaxInstances</em> allows one to divide
3212
3111
  the pool unequally, according to each web application’s relative importance.</p></div>
3213
3112
  </td>
3214
- </tr></table>
3113
+ </tr></table>
3215
3114
  </div>
3216
3115
  </div>
3217
3116
  <div class="sect3">
3218
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerPoolIdleTime"></span><h4 data-comment-topic="passengerpoolidletime-integer--a3gunq" data-anchor="PassengerPoolIdleTime">5.14.5. PassengerPoolIdleTime &lt;integer&gt;</h4>
3117
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="PassengerPoolIdleTime" data-comment-topic="passengerpoolidletime-integer--a3gunq">6.13.5. PassengerPoolIdleTime &lt;integer&gt;</h4>
3219
3118
  <div class="paragraph"><p>The maximum number of seconds that an application process may be idle. That is,
3220
3119
  if an application process hasn’t received any traffic after the given number of
3221
3120
  seconds, then it will be shutdown in order to conserve memory.</p></div>
@@ -3237,7 +3136,36 @@ applications, each which must be available at all times.</p></div>
3237
3136
  The default value is <em>300</em>.</p></div>
3238
3137
  </div>
3239
3138
  <div class="sect3">
3240
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerMaxRequests"></span><h4 data-comment-topic="passengermaxrequests" data-anchor="PassengerMaxRequests">5.14.6. PassengerMaxRequests &lt;integer&gt;</h4>
3139
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_passengermaxpreloaderidletime_lt_integer_gt" data-comment-topic="railsappspawneridletime-integer--1awgog1">6.13.6. PassengerMaxPreloaderIdleTime &lt;integer&gt;</h4>
3140
+ <div class="paragraph"><p>The ApplicationSpawner server (explained in <a href="#spawning_methods_explained">Spawning methods explained</a>) has an idle timeout, just like the backend processes spawned by
3141
+ Phusion Passenger do. That is, it will automatically shutdown if it hasn’t done
3142
+ anything for a given period.</p></div>
3143
+ <div class="paragraph"><p>This option allows you to set the ApplicationSpawner server’s idle timeout, in
3144
+ seconds. A value of <em>0</em> means that it should never idle timeout.</p></div>
3145
+ <div class="paragraph"><p>Setting a higher value will mean that the ApplicationSpawner server is kept around
3146
+ longer, which may slightly increase memory usage. But as long as the
3147
+ ApplicationSpawner server is running, the time to spawn a Ruby on Rails backend
3148
+ process only takes about 10% of the time that is normally needed, assuming that
3149
+ you’re using the <em>smart</em> or <em>smart-lv2</em> <a href="#PassengerSpawnMethod">spawning method</a>. So if your
3150
+ system has enough memory, is it recommended that you set this option to a high
3151
+ value or to <em>0</em>.</p></div>
3152
+ <div class="paragraph"><p>This option may occur in the following places:</p></div>
3153
+ <div class="ulist"><ul>
3154
+ <li>
3155
+ <p>
3156
+ In the global server configuration.
3157
+ </p>
3158
+ </li>
3159
+ <li>
3160
+ <p>
3161
+ In a virtual host configuration block.
3162
+ </p>
3163
+ </li>
3164
+ </ul></div>
3165
+ <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>300</em> (5 minutes).</p></div>
3166
+ </div>
3167
+ <div class="sect3">
3168
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="PassengerMaxRequests" data-comment-topic="passengermaxrequests">6.13.7. PassengerMaxRequests &lt;integer&gt;</h4>
3241
3169
  <div class="paragraph"><p>The maximum number of requests an application process will process. After
3242
3170
  serving that many requests, the application process will be shut down and
3243
3171
  Phusion Passenger will restart it. A value of 0 means that there is no maximum:
@@ -3247,7 +3175,7 @@ reached.</p></div>
3247
3175
  it down after a certain number of requests, all of its memory is guaranteed
3248
3176
  to be freed by the operating system.</p></div>
3249
3177
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3250
- <div class="ulist"><ul>
3178
+ <div class="ulist"><ul>
3251
3179
  <li>
3252
3180
  <p>
3253
3181
  In the global server configuration.
@@ -3271,9 +3199,9 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Limits</span> i
3271
3199
  </ul></div>
3272
3200
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>0</em>.</p></div>
3273
3201
  <div class="admonitionblock">
3274
- <table><tr>
3202
+ <table><tr>
3275
3203
  <td class="icon">
3276
- <img src="./images/icons/caution.png" alt="Caution">
3204
+ <img src="./images/icons/caution.png" alt="Caution">
3277
3205
  </td>
3278
3206
  <td class="content">
3279
3207
  <div class="paragraph"><p>The <a href="#PassengerMaxRequests">PassengerMaxRequests</a> directive should be considered
@@ -3281,11 +3209,11 @@ as a workaround for misbehaving applications. It is advised that you fix the
3281
3209
  problem in your application rather than relying on these directives as a
3282
3210
  measure to avoid memory leaks.</p></div>
3283
3211
  </td>
3284
- </tr></table>
3212
+ </tr></table>
3285
3213
  </div>
3286
3214
  </div>
3287
3215
  <div class="sect3">
3288
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerMaxRequestTime"></span><h4 data-comment-topic="passengermaxrequesttime-seconds--7qnz3x" data-anchor="PassengerMaxRequestTime">5.14.7. PassengerMaxRequestTime &lt;seconds&gt;</h4>
3216
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="PassengerMaxRequestTime" data-comment-topic="passengermaxrequesttime-seconds--aj9w45">6.13.8. PassengerMaxRequestTime &lt;seconds&gt;</h4>
3289
3217
  <div class="paragraph"><p><strong>This feature is only available in <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a>. It was introduced in version 3.0.0. <a href="https://www.phusionpassenger.com/download">Buy Phusion Passenger Enterprise here.</a></strong></p></div>
3290
3218
  <div class="paragraph"><p>The maximum amount of time, in seconds, that an application process may take
3291
3219
  to process a request. If the request takes longer than this amount of time,
@@ -3294,7 +3222,7 @@ restarted upon the next request. A value of 0 means that there is no time limit.
3294
3222
  <div class="paragraph"><p>This option is useful for preventing your application from freezing for an
3295
3223
  indefinite period of time.</p></div>
3296
3224
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3297
- <div class="ulist"><ul>
3225
+ <div class="ulist"><ul>
3298
3226
  <li>
3299
3227
  <p>
3300
3228
  In the global server configuration.
@@ -3340,9 +3268,9 @@ to 10 seconds. You can then configure Phusion Passenger as follows:</p>
3340
3268
  or if a request to any other URI takes more than 2 seconds,
3341
3269
  then the corresponding application process will be forced to shutdown.</p></div>
3342
3270
  <div class="admonitionblock">
3343
- <table><tr>
3271
+ <table><tr>
3344
3272
  <td class="icon">
3345
- <img src="./images/icons/caution.png" alt="Caution">
3273
+ <img src="./images/icons/caution.png" alt="Caution">
3346
3274
  </td>
3347
3275
  <td class="content">
3348
3276
  <div class="paragraph"><p>The <a href="#PassengerMaxRequestTime">PassengerMaxRequestTime</a> directive should be
@@ -3350,11 +3278,11 @@ considered as a workaround for misbehaving applications. It is advised that you
3350
3278
  fix the problem in your application rather than relying on these directives as a
3351
3279
  measure to avoid freezing applications.</p></div>
3352
3280
  </td>
3353
- </tr></table>
3281
+ </tr></table>
3354
3282
  </div>
3355
3283
  </div>
3356
3284
  <div class="sect3">
3357
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerMemoryLimit"></span><h4 data-comment-topic="passengermemorylimit" data-anchor="PassengerMemoryLimit">5.14.8. PassengerMemoryLimit &lt;integer&gt;</h4>
3285
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="PassengerMemoryLimit" data-comment-topic="passengermemorylimit">6.13.9. PassengerMemoryLimit &lt;integer&gt;</h4>
3358
3286
  <div class="paragraph"><p><strong>This feature is only available in <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a>. It was introduced in version 3.0.0. <a href="https://www.phusionpassenger.com/download">Buy Phusion Passenger Enterprise here.</a></strong></p></div>
3359
3287
  <div class="paragraph"><p>The maximum amount of memory that an application process may use, in megabytes.
3360
3288
  Once an application process has surpassed its memory limit, it will process
@@ -3364,7 +3292,7 @@ will not be checked.</p></div>
3364
3292
  <div class="paragraph"><p>This option is useful if your application is leaking memory. By shutting
3365
3293
  it down, all of its memory is guaranteed to be freed by the operating system.</p></div>
3366
3294
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3367
- <div class="ulist"><ul>
3295
+ <div class="ulist"><ul>
3368
3296
  <li>
3369
3297
  <p>
3370
3298
  In the global server configuration.
@@ -3388,9 +3316,9 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Limits</span> i
3388
3316
  </ul></div>
3389
3317
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>200</em>.</p></div>
3390
3318
  <div class="admonitionblock">
3391
- <table><tr>
3319
+ <table><tr>
3392
3320
  <td class="icon">
3393
- <img src="./images/icons/note.png" alt="Note">
3321
+ <img src="./images/icons/note.png" alt="Note">
3394
3322
  </td>
3395
3323
  <td class="content">
3396
3324
  <div class="title">A word about permissions</div>
@@ -3403,12 +3331,12 @@ tight permissions on <span class="monospaced">/proc</span>, this directive may n
3403
3331
  this directive and your <span class="monospaced">/proc</span> permissions are too tight, then please consider
3404
3332
  untightening the permissions.</p></div>
3405
3333
  </td>
3406
- </tr></table>
3334
+ </tr></table>
3407
3335
  </div>
3408
3336
  <div class="admonitionblock">
3409
- <table><tr>
3337
+ <table><tr>
3410
3338
  <td class="icon">
3411
- <img src="./images/icons/tip.png" alt="Tip">
3339
+ <img src="./images/icons/tip.png" alt="Tip">
3412
3340
  </td>
3413
3341
  <td class="content">
3414
3342
  <div class="title">FreeBSD and <span class="monospaced">/proc</span>
@@ -3422,12 +3350,12 @@ which is very fast. If you mount <span class="monospaced">/proc</span> with a di
3422
3350
  Phusion Passenger must resort to querying memory information from the <span class="monospaced">ps</span> command,
3423
3351
  which is a lot slower.</p></div>
3424
3352
  </td>
3425
- </tr></table>
3353
+ </tr></table>
3426
3354
  </div>
3427
3355
  <div class="admonitionblock">
3428
- <table><tr>
3356
+ <table><tr>
3429
3357
  <td class="icon">
3430
- <img src="./images/icons/caution.png" alt="Caution">
3358
+ <img src="./images/icons/caution.png" alt="Caution">
3431
3359
  </td>
3432
3360
  <td class="content">
3433
3361
  <div class="paragraph"><p>The <a href="#PassengerMaxRequests">PassengerMaxRequests</a> and
@@ -3436,14 +3364,14 @@ as workarounds for misbehaving applications. It is advised that you fix the
3436
3364
  problem in your application rather than relying on these directives as a
3437
3365
  measure to avoid memory leaks.</p></div>
3438
3366
  </td>
3439
- </tr></table>
3367
+ </tr></table>
3440
3368
  </div>
3441
3369
  </div>
3442
3370
  <div class="sect3">
3443
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_passengerstatthrottlerate_lt_integer_gt"></span><h4 data-comment-topic="passengerstatthrottlerate" data-anchor="_passengerstatthrottlerate_lt_integer_gt">5.14.9. PassengerStatThrottleRate &lt;integer&gt;</h4>
3371
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_passengerstatthrottlerate_lt_integer_gt" data-comment-topic="passengerstatthrottlerate">6.13.10. PassengerStatThrottleRate &lt;integer&gt;</h4>
3444
3372
  <div class="paragraph"><p>By default, Phusion Passenger performs several filesystem checks (or, in
3445
3373
  programmers jargon, <em>stat() calls</em>) each time a request is processed:</p></div>
3446
- <div class="ulist"><ul>
3374
+ <div class="ulist"><ul>
3447
3375
  <li>
3448
3376
  <p>
3449
3377
  It checks whether <em>config/environment.rb</em>, <em>config.ru</em> or <em>passenger_wsgi.py</em>
@@ -3467,7 +3395,7 @@ seconds. Setting it to a value of <em>0</em> means that no throttling will take
3467
3395
  or in other words, that the above list of filesystem checks will be performed on
3468
3396
  every request.</p></div>
3469
3397
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3470
- <div class="ulist"><ul>
3398
+ <div class="ulist"><ul>
3471
3399
  <li>
3472
3400
  <p>
3473
3401
  In the global server configuration.
@@ -3492,21 +3420,21 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Limits</span> i
3492
3420
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>0</em>.</p></div>
3493
3421
  </div>
3494
3422
  <div class="sect3">
3495
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerPreStart"></span><h4 data-comment-topic="passengerprestart-url--1dvgku9" data-anchor="PassengerPreStart">5.14.10. PassengerPreStart &lt;url&gt;</h4>
3423
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="PassengerPreStart" data-comment-topic="passengerprestart-url--1dvgku9">6.13.11. PassengerPreStart &lt;url&gt;</h4>
3496
3424
  <div class="paragraph"><p>By default, Phusion Passenger does not start any application processes until said
3497
3425
  web application is first accessed. The result is that the first visitor of said
3498
3426
  web application might experience a small delay as Phusion Passenger is starting
3499
3427
  the web application on demand. If that is undesirable, then this directive can be
3500
3428
  used to pre-started application processes during Apache startup.</p></div>
3501
3429
  <div class="paragraph"><p>A few things to be careful of:</p></div>
3502
- <div class="ulist"><ul>
3430
+ <div class="ulist"><ul>
3503
3431
  <li>
3504
3432
  <p>
3505
3433
  This directive accepts the <strong>URL</strong> of the web application you want to pre-start,
3506
3434
  not a on/off value! This might seem a bit weird, but read on for rationale. As
3507
3435
  for the specifics of the URL:
3508
3436
  </p>
3509
- <div class="ulist"><ul>
3437
+ <div class="ulist"><ul>
3510
3438
  <li>
3511
3439
  <p>
3512
3440
  The domain part of the URL must be equal to the value of the <em>ServerName</em>
@@ -3537,7 +3465,7 @@ You will probably want to combine this option with
3537
3465
  </li>
3538
3466
  </ul></div>
3539
3467
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3540
- <div class="ulist"><ul>
3468
+ <div class="ulist"><ul>
3541
3469
  <li>
3542
3470
  <p>
3543
3471
  In the global server configuration.
@@ -3655,7 +3583,7 @@ PassengerPreStart http://bar.com:3500/</pre>
3655
3583
  <div class="paragraph"><p>A directive that accepts a simple on/off flag is definitely more intuitive,
3656
3584
  but due technical difficulties w.r.t. the way Apache works, it’s very hard
3657
3585
  to implement it like that:</p></div>
3658
- <div class="ulist"><ul>
3586
+ <div class="ulist"><ul>
3659
3587
  <li>
3660
3588
  <p>
3661
3589
  It is very hard to obtain a full list of web applications defined in the
@@ -3730,7 +3658,7 @@ the request ending up at a different web server in the cluster.</p></div>
3730
3658
  </div>
3731
3659
  </div>
3732
3660
  <div class="sect3">
3733
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerHighPerformance"></span><h4 data-comment-topic="passengerhighperformance-on-off--zgc547" data-anchor="PassengerHighPerformance">5.14.11. PassengerHighPerformance &lt;on|off&gt;</h4>
3661
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="PassengerHighPerformance" data-comment-topic="passengerhighperformance-on-off--zgc547">6.13.12. PassengerHighPerformance &lt;on|off&gt;</h4>
3734
3662
  <div class="paragraph"><p>By default, Phusion Passenger is compatible with mod_rewrite and most other
3735
3663
  Apache modules. However, a lot of effort is required in order to be compatible.
3736
3664
  If you turn <em>PassengerHighPerformance</em> to <em>on</em>, then Phusion Passenger will be
@@ -3743,7 +3671,7 @@ performance mode via testing.</p></div>
3743
3671
  <div class="paragraph"><p>This option is <strong>not</strong> an all-or-nothing global option: you can enable high
3744
3672
  performance mode for certain virtual hosts or certain URLs only.
3745
3673
  The <em>PassengerHighPerformance</em> option may occur in the following places:</p></div>
3746
- <div class="ulist"><ul>
3674
+ <div class="ulist"><ul>
3747
3675
  <li>
3748
3676
  <p>
3749
3677
  In the global server configuration.
@@ -3814,13 +3742,13 @@ then you can enable high performance mode for a certain URL only. For example:</
3814
3742
  </div>
3815
3743
  </div>
3816
3744
  <div class="sect2">
3817
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_compatibility_options"></span><h3 data-comment-topic="compatibility-options-8jve5a" data-anchor="_compatibility_options">5.15. Compatibility options</h3>
3745
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_compatibility_options" data-comment-topic="compatibility-options-8jve5a">6.14. Compatibility options</h3>
3818
3746
  <div class="sect3">
3819
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerResolveSymlinksInDocumentRoot"></span><h4 data-comment-topic="passengerresolvesymlinksindocumentroot-on-off--1r0qcp8" data-anchor="PassengerResolveSymlinksInDocumentRoot">5.15.1. PassengerResolveSymlinksInDocumentRoot &lt;on|off&gt;</h4>
3747
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="PassengerResolveSymlinksInDocumentRoot" data-comment-topic="passengerresolvesymlinksindocumentroot-on-off--1r0qcp8">6.14.1. PassengerResolveSymlinksInDocumentRoot &lt;on|off&gt;</h4>
3820
3748
  <div class="paragraph"><p>Configures whether Phusion Passenger should resolve symlinks in the document root.
3821
3749
  Please refer to <a href="#application_detection">How Phusion Passenger detects whether a virtual host is a web application</a> for more information.</p></div>
3822
3750
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3823
- <div class="ulist"><ul>
3751
+ <div class="ulist"><ul>
3824
3752
  <li>
3825
3753
  <p>
3826
3754
  In the global server configuration.
@@ -3845,7 +3773,7 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
3845
3773
  <div class="paragraph"><p>In each place, it may be specified at most once. It is off by default.</p></div>
3846
3774
  </div>
3847
3775
  <div class="sect3">
3848
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_passengerallowencodedslashes_lt_on_off_gt"></span><h4 data-comment-topic="passengerallowencodedslashes-on-off--1y3s1ww" data-anchor="_passengerallowencodedslashes_lt_on_off_gt">5.15.2. PassengerAllowEncodedSlashes &lt;on|off&gt;</h4>
3776
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_passengerallowencodedslashes_lt_on_off_gt" data-comment-topic="passengerallowencodedslashes-on-off--1y3s1ww">6.14.2. PassengerAllowEncodedSlashes &lt;on|off&gt;</h4>
3849
3777
  <div class="paragraph"><p>By default, Apache doesn’t support URLs with encoded slashes (%2f), e.g. URLs like
3850
3778
  this: <span class="monospaced">/users/fujikura%2fyuu</span>. If you access such an URL then Apache will return a
3851
3779
  404 Not Found error. This can be solved by turning on PassengerAllowEncodedSlashes
@@ -3854,7 +3782,7 @@ as well as Apache’s
3854
3782
  <div class="paragraph"><p>Is it important that you turn on both AllowEncodedSlashes <strong>and</strong> PassengerAllowEncodedSlashes,
3855
3783
  otherwise this feature will not work properly.</p></div>
3856
3784
  <div class="paragraph"><p>PassengerAllowEncodedSlashes may occur in the following places:</p></div>
3857
- <div class="ulist"><ul>
3785
+ <div class="ulist"><ul>
3858
3786
  <li>
3859
3787
  <p>
3860
3788
  In the global server configuration.
@@ -3914,14 +3842,14 @@ displaying maintenance.html will work fine even for URLs starting with "/users".
3914
3842
  </div>
3915
3843
  </div>
3916
3844
  <div class="sect2">
3917
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_logging_and_debugging_options"></span><h3 data-comment-topic="logging-and-debugging-options-el2cuc" data-anchor="_logging_and_debugging_options">5.16. Logging and debugging options</h3>
3845
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_logging_and_debugging_options" data-comment-topic="logging-and-debugging-options-el2cuc">6.15. Logging and debugging options</h3>
3918
3846
  <div class="sect3">
3919
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_passengerloglevel_lt_integer_gt"></span><h4 data-comment-topic="passengerloglevel-integer--1v67p8l" data-anchor="_passengerloglevel_lt_integer_gt">5.16.1. PassengerLogLevel &lt;integer&gt;</h4>
3847
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_passengerloglevel_lt_integer_gt" data-comment-topic="passengerloglevel-integer--1v67p8l">6.15.1. PassengerLogLevel &lt;integer&gt;</h4>
3920
3848
  <div class="paragraph"><p>This option allows one to specify how much information Phusion Passenger should
3921
3849
  write to the Apache error log file. A higher log level value means that more
3922
3850
  information will be logged.</p></div>
3923
3851
  <div class="paragraph"><p>Possible values are:</p></div>
3924
- <div class="ulist"><ul>
3852
+ <div class="ulist"><ul>
3925
3853
  <li>
3926
3854
  <p>
3927
3855
  <em>0</em>: Show only errors and warnings.
@@ -3949,14 +3877,14 @@ information will be logged.</p></div>
3949
3877
  The default is <em>0</em>.</p></div>
3950
3878
  </div>
3951
3879
  <div class="sect3">
3952
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_passengerdebuglogfile_lt_filename_gt"></span><h4 data-comment-topic="passengerdebuglogfile-filename--1tfy4z9" data-anchor="_passengerdebuglogfile_lt_filename_gt">5.16.2. PassengerDebugLogFile &lt;filename&gt;</h4>
3880
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_passengerdebuglogfile_lt_filename_gt" data-comment-topic="passengerdebuglogfile-filename--1tfy4z9">6.15.2. PassengerDebugLogFile &lt;filename&gt;</h4>
3953
3881
  <div class="paragraph"><p>By default Phusion Passenger debugging and error messages are written to the global
3954
3882
  web server error log. This option allows one to specify the file that debugging and
3955
3883
  error messages should be written to instead.</p></div>
3956
3884
  <div class="paragraph"><p>This option may only occur once, in the global server configuration.</p></div>
3957
3885
  </div>
3958
3886
  <div class="sect3">
3959
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_passengerdebugger_lt_on_off_gt"></span><h4 data-comment-topic="passengerdebugger-on-off--1lgdk7g" data-anchor="_passengerdebugger_lt_on_off_gt">5.16.3. PassengerDebugger &lt;on|off&gt;</h4>
3887
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_passengerdebugger_lt_on_off_gt" data-comment-topic="passengerdebugger-on-off--1qk9j40">6.15.3. PassengerDebugger &lt;on|off&gt;</h4>
3960
3888
  <div class="paragraph"><p><strong>This feature is only available in <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a>. It was introduced in version 3.0.0. <a href="https://www.phusionpassenger.com/download">Buy Phusion Passenger Enterprise here.</a></strong></p></div>
3961
3889
  <div class="paragraph"><p>Turns support for application debugging on or off. In case of Ruby applications,
3962
3890
  turning this option on will cause them to load the <span class="monospaced">ruby-debug</span> gem (when on Ruby 1.8)
@@ -3970,7 +3898,7 @@ gem 'debugger', :platforms =&gt; :ruby_19</pre>
3970
3898
  </div>
3971
3899
  <div class="paragraph"><p>Once debugging is turned on, you can use the command <span class="monospaced">passenger-irb --debug &lt;PID&gt;</span> to attach an rdebug console to the application process with the given PID. Attaching will succeed once the application process executes a <span class="monospaced">debugger</span> command.</p></div>
3972
3900
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3973
- <div class="ulist"><ul>
3901
+ <div class="ulist"><ul>
3974
3902
  <li>
3975
3903
  <p>
3976
3904
  In the global server configuration.
@@ -3996,9 +3924,11 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
3996
3924
  </div>
3997
3925
  </div>
3998
3926
  <div class="sect2">
3999
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_ruby_on_rails_specific_options"></span><h3 data-comment-topic="ruby-on-rails-specific-options-1t10wfu" data-anchor="_ruby_on_rails_specific_options">5.17. Ruby on Rails-specific options</h3>
3927
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_classic_ruby_on_rails_8656_2_x_specific_options" data-comment-topic="ruby-on-rails-specific-options-1t10wfu">6.16. Classic Ruby on Rails (⇐ 2.x)-specific options</h3>
3928
+ <div class="paragraph"><p>These options only have effect on classic Ruby on Rails 1.x and 2.x applications.
3929
+ Ruby on Rails &gt;= 3.x applications are considered Rack applications.</p></div>
4000
3930
  <div class="sect3">
4001
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_railsautodetect_lt_on_off_gt"></span><h4 data-comment-topic="railsautodetect-on-off--tpigsd" data-anchor="_railsautodetect_lt_on_off_gt">5.17.1. RailsAutoDetect &lt;on|off&gt;</h4>
3931
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_railsautodetect_lt_on_off_gt" data-comment-topic="railsautodetect-on-off--tpigsd">6.16.1. RailsAutoDetect &lt;on|off&gt;</h4>
4002
3932
  <div class="paragraph"><p>Whether Phusion Passenger should automatically detect whether a virtual host’s
4003
3933
  document root is a Ruby on Rails application. The default is <em>on</em>.</p></div>
4004
3934
  <div class="paragraph"><p>This option may occur in the global server configuration or in a virtual host
@@ -4030,13 +3960,13 @@ application by using the <a href="#RailsBaseURI">RailsBaseURI</a> configuration
4030
3960
  </div>
4031
3961
  </div>
4032
3962
  <div class="sect3">
4033
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="RailsBaseURI"></span><h4 data-comment-topic="railsbaseuri-uri--1txrw3k" data-anchor="RailsBaseURI">5.17.2. RailsBaseURI &lt;uri&gt;</h4>
3963
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="RailsBaseURI" data-comment-topic="railsbaseuri-uri--1txrw3k">6.16.2. RailsBaseURI &lt;uri&gt;</h4>
4034
3964
  <div class="paragraph"><p>Used to specify that the given URI is a Rails application. See
4035
3965
  <a href="#deploying_rails_to_sub_uri">Deploying Rails to a sub URI</a> for an example.</p></div>
4036
3966
  <div class="paragraph"><p>It is allowed to specify this option multiple times. Do this to deploy multiple
4037
3967
  Rails applications in different sub-URIs under the same virtual host.</p></div>
4038
3968
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4039
- <div class="ulist"><ul>
3969
+ <div class="ulist"><ul>
4040
3970
  <li>
4041
3971
  <p>
4042
3972
  In the global server configuration.
@@ -4060,10 +3990,10 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
4060
3990
  </ul></div>
4061
3991
  </div>
4062
3992
  <div class="sect3">
4063
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="rails_env"></span><h4 data-comment-topic="railsenv-string--1b0xxvu" data-anchor="rails_env">5.17.3. RailsEnv &lt;string&gt;</h4>
3993
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="rails_env" data-comment-topic="railsenv-string--1b0xxvu">6.16.3. RailsEnv &lt;string&gt;</h4>
4064
3994
  <div class="paragraph"><p>This option allows one to specify the default <span class="monospaced">RAILS_ENV</span> value.</p></div>
4065
3995
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4066
- <div class="ulist"><ul>
3996
+ <div class="ulist"><ul>
4067
3997
  <li>
4068
3998
  <p>
4069
3999
  In the global server configuration.
@@ -4087,69 +4017,11 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
4087
4017
  </ul></div>
4088
4018
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>production</em>.</p></div>
4089
4019
  </div>
4090
- <div class="sect3">
4091
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_railsframeworkspawneridletime_lt_integer_gt"></span><h4 data-comment-topic="railsframeworkspawneridletime-integer--1ai8dgq" data-anchor="_railsframeworkspawneridletime_lt_integer_gt">5.17.4. RailsFrameworkSpawnerIdleTime &lt;integer&gt;</h4>
4092
- <div class="paragraph"><p>The FrameworkSpawner server (explained in <a href="#spawning_methods_explained">Spawning methods explained</a>) has an idle timeout, just like the backend processes spawned by
4093
- Phusion Passenger do. That is, it will automatically shutdown if it hasn’t done
4094
- anything for a given period.</p></div>
4095
- <div class="paragraph"><p>This option allows you to set the FrameworkSpawner server’s idle timeout, in
4096
- seconds. A value of <em>0</em> means that it should never idle timeout.</p></div>
4097
- <div class="paragraph"><p>Setting a higher value will mean that the FrameworkSpawner server is kept around
4098
- longer, which may slightly increase memory usage. But as long as the
4099
- FrameworkSpawner server is running, the time to spawn a Ruby on Rails backend
4100
- process only takes about 40% of the time that is normally needed, assuming that
4101
- you’re using the <em>smart</em> <a href="#PassengerSpawnMethod">spawning method</a>. So if your
4102
- system has enough memory, is it recommended that you set this option to a high
4103
- value or to <em>0</em>.</p></div>
4104
- <div class="paragraph"><p>This option may occur in the following places:</p></div>
4105
- <div class="ulist"><ul>
4106
- <li>
4107
- <p>
4108
- In the global server configuration.
4109
- </p>
4110
- </li>
4111
- <li>
4112
- <p>
4113
- In a virtual host configuration block.
4114
- </p>
4115
- </li>
4116
- </ul></div>
4117
- <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>1800</em> (30 minutes).</p></div>
4118
- </div>
4119
- <div class="sect3">
4120
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_railsappspawneridletime_lt_integer_gt"></span><h4 data-comment-topic="railsappspawneridletime-integer--1awgog1" data-anchor="_railsappspawneridletime_lt_integer_gt">5.17.5. RailsAppSpawnerIdleTime &lt;integer&gt;</h4>
4121
- <div class="paragraph"><p>The ApplicationSpawner server (explained in <a href="#spawning_methods_explained">Spawning methods explained</a>) has an idle timeout, just like the backend processes spawned by
4122
- Phusion Passenger do. That is, it will automatically shutdown if it hasn’t done
4123
- anything for a given period.</p></div>
4124
- <div class="paragraph"><p>This option allows you to set the ApplicationSpawner server’s idle timeout, in
4125
- seconds. A value of <em>0</em> means that it should never idle timeout.</p></div>
4126
- <div class="paragraph"><p>Setting a higher value will mean that the ApplicationSpawner server is kept around
4127
- longer, which may slightly increase memory usage. But as long as the
4128
- ApplicationSpawner server is running, the time to spawn a Ruby on Rails backend
4129
- process only takes about 10% of the time that is normally needed, assuming that
4130
- you’re using the <em>smart</em> or <em>smart-lv2</em> <a href="#PassengerSpawnMethod">spawning method</a>. So if your
4131
- system has enough memory, is it recommended that you set this option to a high
4132
- value or to <em>0</em>.</p></div>
4133
- <div class="paragraph"><p>This option may occur in the following places:</p></div>
4134
- <div class="ulist"><ul>
4135
- <li>
4136
- <p>
4137
- In the global server configuration.
4138
- </p>
4139
- </li>
4140
- <li>
4141
- <p>
4142
- In a virtual host configuration block.
4143
- </p>
4144
- </li>
4145
- </ul></div>
4146
- <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>600</em> (10 minutes).</p></div>
4147
- </div>
4148
4020
  </div>
4149
4021
  <div class="sect2">
4150
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_rack_and_rails_gt_3_specific_options"></span><h3 data-comment-topic="rack-specific-options-wk9qzt" data-anchor="_rack_and_rails_gt_3_specific_options">5.18. Rack and Rails &gt;= 3 specific options</h3>
4022
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_rack_and_rails_gt_3_specific_options" data-comment-topic="rack-specific-options-wk9qzt">6.17. Rack and Rails &gt;= 3 specific options</h3>
4151
4023
  <div class="sect3">
4152
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_rackautodetect_lt_on_off_gt"></span><h4 data-comment-topic="rackautodetect-on-off--vl1lxy" data-anchor="_rackautodetect_lt_on_off_gt">5.18.1. RackAutoDetect &lt;on|off&gt;</h4>
4024
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_rackautodetect_lt_on_off_gt" data-comment-topic="rackautodetect-on-off--vl1lxy">6.17.1. RackAutoDetect &lt;on|off&gt;</h4>
4153
4025
  <div class="paragraph"><p>Whether Phusion Passenger should automatically detect whether a virtual host’s
4154
4026
  document root is a Rack application. The default is <em>on</em>.</p></div>
4155
4027
  <div class="paragraph"><p>This option may occur in the global server configuration or in a virtual host
@@ -4181,13 +4053,13 @@ application by using the <a href="#RackBaseURI">RackBaseURI</a> configuration op
4181
4053
  </div>
4182
4054
  </div>
4183
4055
  <div class="sect3">
4184
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="RackBaseURI"></span><h4 data-comment-topic="rackbaseuri-uri--1to24pj" data-anchor="RackBaseURI">5.18.2. RackBaseURI &lt;uri&gt;</h4>
4056
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="RackBaseURI" data-comment-topic="rackbaseuri-uri--1to24pj">6.17.2. RackBaseURI &lt;uri&gt;</h4>
4185
4057
  <div class="paragraph"><p>Used to specify that the given URI is a Rack application. See
4186
4058
  <a href="#deploying_rack_to_sub_uri">Deploying Rack to a sub URI</a> for an example.</p></div>
4187
4059
  <div class="paragraph"><p>It is allowed to specify this option multiple times. Do this to deploy multiple
4188
4060
  Rack applications in different sub-URIs under the same virtual host.</p></div>
4189
4061
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4190
- <div class="ulist"><ul>
4062
+ <div class="ulist"><ul>
4191
4063
  <li>
4192
4064
  <p>
4193
4065
  In the global server configuration.
@@ -4211,12 +4083,12 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
4211
4083
  </ul></div>
4212
4084
  </div>
4213
4085
  <div class="sect3">
4214
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="rack_env"></span><h4 data-comment-topic="rackenv-string--vve9py" data-anchor="rack_env">5.18.3. RackEnv &lt;string&gt;</h4>
4086
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="rack_env" data-comment-topic="rackenv-string--vve9py">6.17.3. RackEnv &lt;string&gt;</h4>
4215
4087
  <div class="paragraph"><p>The given value will be accessible in Rack applications in the <span class="monospaced">RACK_ENV</span>
4216
4088
  environment variable. This allows one to define the environment in which
4217
4089
  Rack applications are run, very similar to <span class="monospaced">RAILS_ENV</span>.</p></div>
4218
4090
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4219
- <div class="ulist"><ul>
4091
+ <div class="ulist"><ul>
4220
4092
  <li>
4221
4093
  <p>
4222
4094
  In the global server configuration.
@@ -4242,39 +4114,39 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
4242
4114
  </div>
4243
4115
  </div>
4244
4116
  <div class="sect2">
4245
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_deprecated_options"></span><h3 data-comment-topic="deprecated-options-pm9m57" data-anchor="_deprecated_options">5.19. Deprecated options</h3>
4117
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_deprecated_options" data-comment-topic="deprecated-options-pm9m57">6.18. Deprecated options</h3>
4246
4118
  <div class="paragraph"><p>The following options have been deprecated, but are still supported for backwards
4247
4119
  compatibility reasons.</p></div>
4248
4120
  <div class="sect3">
4249
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_railsruby"></span><h4 data-comment-topic="railsruby-ht09ei" data-anchor="_railsruby">5.19.1. RailsRuby</h4>
4121
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_railsruby" data-comment-topic="railsruby-ht09ei">6.18.1. RailsRuby</h4>
4250
4122
  <div class="paragraph"><p>Deprecated in favor of <a href="#PassengerRuby">PassengerRuby</a>.</p></div>
4251
4123
  </div>
4252
4124
  <div class="sect3">
4253
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_railsuserswitching"></span><h4 data-comment-topic="railsuserswitching-1npx8y4" data-anchor="_railsuserswitching">5.19.2. RailsUserSwitching</h4>
4125
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_railsuserswitching" data-comment-topic="railsuserswitching-1npx8y4">6.18.2. RailsUserSwitching</h4>
4254
4126
  <div class="paragraph"><p>Deprecated in favor of <a href="#PassengerUserSwitching">PassengerUserSwitching</a>.</p></div>
4255
4127
  </div>
4256
4128
  <div class="sect3">
4257
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_railsdefaultuser"></span><h4 data-comment-topic="railsdefaultuser-19j7n3m" data-anchor="_railsdefaultuser">5.19.3. RailsDefaultUser</h4>
4129
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_railsdefaultuser" data-comment-topic="railsdefaultuser-19j7n3m">6.18.3. RailsDefaultUser</h4>
4258
4130
  <div class="paragraph"><p>Deprecated in favor of <a href="#PassengerDefaultUser">PassengerDefaultUser</a>.</p></div>
4259
4131
  </div>
4260
4132
  <div class="sect3">
4261
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_railsallowmodrewrite"></span><h4 data-comment-topic="railsallowmodrewrite-1vkziro" data-anchor="_railsallowmodrewrite">5.19.4. RailsAllowModRewrite</h4>
4133
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_railsallowmodrewrite" data-comment-topic="railsallowmodrewrite-1vkziro">6.18.4. RailsAllowModRewrite</h4>
4262
4134
  <div class="paragraph"><p>This option doesn’t do anything anymore in recent versions of Phusion Passenger.</p></div>
4263
4135
  </div>
4264
4136
  <div class="sect3">
4265
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_railsspawnmethod"></span><h4 data-comment-topic="railsspawnmethod-1aljgpa" data-anchor="_railsspawnmethod">5.19.5. RailsSpawnMethod</h4>
4137
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_railsspawnmethod" data-comment-topic="railsspawnmethod-1aljgpa">6.18.5. RailsSpawnMethod</h4>
4266
4138
  <div class="paragraph"><p>Deprecated in favor of <a href="#PassengerSpawnMethod">PassengerSpawnMethod</a>.</p></div>
4267
4139
  </div>
4268
4140
  </div>
4269
4141
  </div>
4270
4142
  </div>
4271
4143
  <div class="sect1">
4272
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_troubleshooting"></span><h2 data-comment-topic="troubleshooting-2ihihi" data-anchor="_troubleshooting">6. Troubleshooting</h2>
4144
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h2 id="_troubleshooting" data-comment-topic="troubleshooting-2ihihi">7. Troubleshooting</h2>
4273
4145
  <div class="sectionbody">
4274
4146
  <div class="sect2">
4275
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_operating_system_specific_problems"></span><h3 data-comment-topic="operating-system-specific-problems-327gbk" data-anchor="_operating_system_specific_problems">6.1. Operating system-specific problems</h3>
4147
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_operating_system_specific_problems" data-comment-topic="operating-system-specific-problems-327gbk">7.1. Operating system-specific problems</h3>
4276
4148
  <div class="sect3">
4277
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_macos_x_the_installer_cannot_locate_mamp_8217_s_apache"></span><h4 data-comment-topic="macos-x-the-installer-cannot-locate-mamp-s-apache-or908n" data-anchor="_macos_x_the_installer_cannot_locate_mamp_8217_s_apache">6.1.1. MacOS X: The installer cannot locate MAMP’s Apache</h4>
4149
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_macos_x_the_installer_cannot_locate_mamp_8217_s_apache" data-comment-topic="macos-x-the-installer-cannot-locate-mamp-s-apache-or908n">7.1.1. MacOS X: The installer cannot locate MAMP’s Apache</h4>
4278
4150
  <div class="sidebarblock">
4279
4151
  <div class="content">
4280
4152
  <div class="title">Symptoms</div>
@@ -4295,14 +4167,14 @@ to fix this problem.</p></div>
4295
4167
  </div>
4296
4168
  </div>
4297
4169
  <div class="sect2">
4298
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_problems_during_installation"></span><h3 data-comment-topic="problems-during-installation-q1vlsu" data-anchor="_problems_during_installation">6.2. Problems during installation</h3>
4170
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_problems_during_installation" data-comment-topic="problems-during-installation-q1vlsu">7.2. Problems during installation</h3>
4299
4171
  <div class="sect3">
4300
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="installing_ruby_dev"></span><h4 data-comment-topic="ruby-development-headers-aren-t-installed-1yqrom8" data-anchor="installing_ruby_dev">6.2.1. Ruby development headers aren’t installed</h4>
4172
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="installing_ruby_dev" data-comment-topic="ruby-development-headers-aren-t-installed-1yqrom8">7.2.1. Ruby development headers aren’t installed</h4>
4301
4173
  <div class="sidebarblock">
4302
4174
  <div class="content">
4303
4175
  <div class="title">Symptoms</div>
4304
4176
  <div class="paragraph"><p>Installing Phusion Passenger fails because of one of the following errors:</p></div>
4305
- <div class="ulist"><ul>
4177
+ <div class="ulist"><ul>
4306
4178
  <li>
4307
4179
  <p>
4308
4180
  The Phusion Passenger installer tells you that the Ruby development headers
@@ -4327,7 +4199,7 @@ must be installed. On most Linux systems, Ruby and the Ruby development headers
4327
4199
  are contained in separate packages, so having Ruby installed does not
4328
4200
  automatically imply having the development headers installed.</p></div>
4329
4201
  <div class="paragraph"><p>Here’s how you can install the development headers:</p></div>
4330
- <div class="dlist"><dl>
4202
+ <div class="dlist"><dl>
4331
4203
  <dt class="hdlist1">
4332
4204
  Ubuntu/Debian
4333
4205
  </dt>
@@ -4383,24 +4255,24 @@ Other operating systems
4383
4255
  </dd>
4384
4256
  </dl></div>
4385
4257
  <div class="admonitionblock">
4386
- <table><tr>
4258
+ <table><tr>
4387
4259
  <td class="icon">
4388
- <img src="./images/icons/note.png" alt="Note">
4260
+ <img src="./images/icons/note.png" alt="Note">
4389
4261
  </td>
4390
4262
  <td class="content">If you’ve installed a new Ruby version (i.e. your system now contains
4391
4263
  multiple Ruby installations), then you will need to tell Phusion Passenger
4392
4264
  which Ruby installation you want to use. Please read
4393
4265
  <a href="#specifying_ruby_installation">Specifying the correct Ruby installation</a>.</td>
4394
- </tr></table>
4266
+ </tr></table>
4395
4267
  </div>
4396
4268
  </div>
4397
4269
  <div class="sect3">
4398
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_apache_development_headers_aren_8217_t_installed"></span><h4 data-comment-topic="apache-development-headers-aren-t-installed-x2473y" data-anchor="_apache_development_headers_aren_8217_t_installed">6.2.2. Apache development headers aren’t installed</h4>
4270
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_apache_development_headers_aren_8217_t_installed" data-comment-topic="apache-development-headers-aren-t-installed-x2473y">7.2.2. Apache development headers aren’t installed</h4>
4399
4271
  <div class="sidebarblock">
4400
4272
  <div class="content">
4401
4273
  <div class="title">Symptoms</div>
4402
4274
  <div class="paragraph"><p>Installing Phusion Passenger fails because of one of the following errors:</p></div>
4403
- <div class="ulist"><ul>
4275
+ <div class="ulist"><ul>
4404
4276
  <li>
4405
4277
  <p>
4406
4278
  The installer says that the Apache development headers aren’t installed.
@@ -4416,7 +4288,7 @@ else similar to <em>http_*.h</em>.)</p></div>
4416
4288
  </ul></div>
4417
4289
  </div>
4418
4290
  </div>
4419
- <div class="dlist"><dl>
4291
+ <div class="dlist"><dl>
4420
4292
  <dt class="hdlist1">
4421
4293
  Ubuntu
4422
4294
  </dt>
@@ -4486,12 +4358,12 @@ Other operating systems
4486
4358
  </dl></div>
4487
4359
  </div>
4488
4360
  <div class="sect3">
4489
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_apr_development_headers_aren_8217_t_installed"></span><h4 data-comment-topic="apr-development-headers-aren-t-installed-13bk976" data-anchor="_apr_development_headers_aren_8217_t_installed">6.2.3. APR development headers aren’t installed</h4>
4361
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_apr_development_headers_aren_8217_t_installed" data-comment-topic="apr-development-headers-aren-t-installed-13bk976">7.2.3. APR development headers aren’t installed</h4>
4490
4362
  <div class="sidebarblock">
4491
4363
  <div class="content">
4492
4364
  <div class="title">Symptoms</div>
4493
4365
  <div class="paragraph"><p>Installing Phusion Passenger fails because one of the following errors:</p></div>
4494
- <div class="ulist"><ul>
4366
+ <div class="ulist"><ul>
4495
4367
  <li>
4496
4368
  <p>
4497
4369
  The installer tells you that APR development headers aren’t installed.
@@ -4510,7 +4382,7 @@ The error message “'apr_strings.h: No such file or directory”' occurs.
4510
4382
  </ul></div>
4511
4383
  </div>
4512
4384
  </div>
4513
- <div class="dlist"><dl>
4385
+ <div class="dlist"><dl>
4514
4386
  <dt class="hdlist1">
4515
4387
  Ubuntu
4516
4388
  </dt>
@@ -4572,20 +4444,20 @@ Other operating systems
4572
4444
  </dl></div>
4573
4445
  </div>
4574
4446
  <div class="sect3">
4575
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_phusion_passenger_is_using_the_wrong_apache_during_installation"></span><h4 data-comment-topic="phusion-passenger-is-using-the-wrong-apache-during-installation-82qnt4" data-anchor="_phusion_passenger_is_using_the_wrong_apache_during_installation">6.2.4. Phusion Passenger is using the wrong Apache during installation</h4>
4447
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_phusion_passenger_is_using_the_wrong_apache_during_installation" data-comment-topic="phusion-passenger-is-using-the-wrong-apache-during-installation-82qnt4">7.2.4. Phusion Passenger is using the wrong Apache during installation</h4>
4576
4448
  <div class="paragraph"><p>Please <a href="#specifying_correct_apache_install">Specifying the correct Apache installation</a>, and re-run the Phusion Passenger installer.</p></div>
4577
4449
  </div>
4578
4450
  <div class="sect3">
4579
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_phusion_passenger_is_using_the_wrong_ruby_during_installation"></span><h4 data-comment-topic="phusion-passenger-is-using-the-wrong-ruby-during-installation-1nh3zml" data-anchor="_phusion_passenger_is_using_the_wrong_ruby_during_installation">6.2.5. Phusion Passenger is using the wrong Ruby during installation</h4>
4451
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_phusion_passenger_is_using_the_wrong_ruby_during_installation" data-comment-topic="phusion-passenger-is-using-the-wrong-ruby-during-installation-1nh3zml">7.2.5. Phusion Passenger is using the wrong Ruby during installation</h4>
4580
4452
  <div class="paragraph"><p>Please <a href="#specifying_ruby_installation">Specifying the correct Ruby installation</a>, and re-run the Phusion Passenger installer.</p></div>
4581
4453
  </div>
4582
4454
  </div>
4583
4455
  <div class="sect2">
4584
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_problems_after_installation"></span><h3 data-comment-topic="problems-after-installation-fwd23q" data-anchor="_problems_after_installation">6.3. Problems after installation</h3>
4456
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_problems_after_installation" data-comment-topic="problems-after-installation-fwd23q">7.3. Problems after installation</h3>
4585
4457
  <div class="admonitionblock">
4586
- <table><tr>
4458
+ <table><tr>
4587
4459
  <td class="icon">
4588
- <img src="./images/icons/tip.png" alt="Tip">
4460
+ <img src="./images/icons/tip.png" alt="Tip">
4589
4461
  </td>
4590
4462
  <td class="content">
4591
4463
  <div class="title">The golden tip: read your Apache error logs!</div>
@@ -4593,14 +4465,14 @@ Other operating systems
4593
4465
  you’re experiencing post-installation problems, please look
4594
4466
  inside the Apache error logs. It will tell you what exactly went wrong.</p></div>
4595
4467
  </td>
4596
- </tr></table>
4468
+ </tr></table>
4597
4469
  </div>
4598
4470
  <div class="sect3">
4599
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_my_rails_application_works_on_mongrel_but_not_on_phusion_passenger"></span><h4 data-comment-topic="my-rails-application-works-on-mongrel-but-not-on-phusion-passenger-1f28drx" data-anchor="_my_rails_application_works_on_mongrel_but_not_on_phusion_passenger">6.3.1. My Rails application works on Mongrel, but not on Phusion Passenger</h4>
4471
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_my_rails_application_works_on_mongrel_but_not_on_phusion_passenger" data-comment-topic="my-rails-application-works-on-mongrel-but-not-on-phusion-passenger-1f28drx">7.3.1. My Rails application works on Mongrel, but not on Phusion Passenger</h4>
4600
4472
  <div class="paragraph"><p>Please try setting <a href="#PassengerSpawnMethod">PassengerSpawnMethod</a> to <em>conservative</em>.</p></div>
4601
4473
  </div>
4602
4474
  <div class="sect3">
4603
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_phusion_passenger_has_been_compiled_against_the_wrong_apache_installation"></span><h4 data-comment-topic="phusion-passenger-has-been-compiled-against-the-wrong-apache-installation-n74ce0" data-anchor="_phusion_passenger_has_been_compiled_against_the_wrong_apache_installation">6.3.2. Phusion Passenger has been compiled against the wrong Apache installation</h4>
4475
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_phusion_passenger_has_been_compiled_against_the_wrong_apache_installation" data-comment-topic="phusion-passenger-has-been-compiled-against-the-wrong-apache-installation-n74ce0">7.3.2. Phusion Passenger has been compiled against the wrong Apache installation</h4>
4604
4476
  <div class="sidebarblock">
4605
4477
  <div class="content">
4606
4478
  <div class="title">Symptoms</div>
@@ -4613,15 +4485,15 @@ Apache installations on their system.</p></div>
4613
4485
  <div class="paragraph"><p>To solve this problem, please <a href="#specifying_correct_apache_install">specify the correct Apache installation</a>, and <a href="#install_passenger">reinstall Phusion Passenger</a>.</p></div>
4614
4486
  </div>
4615
4487
  <div class="sect3">
4616
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_i_get_a_403_forbidden_error"></span><h4 data-comment-topic="i-get-a-403-forbidden-error-m0rlay" data-anchor="_i_get_a_403_forbidden_error">6.3.3. I get a "403 Forbidden" error</h4>
4488
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_i_get_a_403_forbidden_error" data-comment-topic="i-get-a-403-forbidden-error-m0rlay">7.3.3. I get a "403 Forbidden" error</h4>
4617
4489
  <div class="paragraph"><p>See next subsection.</p></div>
4618
4490
  </div>
4619
4491
  <div class="sect3">
4620
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_static_assets_such_as_images_and_stylesheets_aren_8217_t_being_displayed"></span><h4 data-comment-topic="static-assets-such-as-images-and-stylesheets-aren-t-being-displayed-uaptpi" data-anchor="_static_assets_such_as_images_and_stylesheets_aren_8217_t_being_displayed">6.3.4. Static assets such as images and stylesheets aren’t being displayed</h4>
4492
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_static_assets_such_as_images_and_stylesheets_aren_8217_t_being_displayed" data-comment-topic="static-assets-such-as-images-and-stylesheets-aren-t-being-displayed-uaptpi">7.3.4. Static assets such as images and stylesheets aren’t being displayed</h4>
4621
4493
  <div class="paragraph"><p>Static assets are accelerated, i.e. they are served directly by Apache and do not
4622
4494
  go through the Rails stack. There are two reasons why Apache doesn’t serve static
4623
4495
  assets correctly:</p></div>
4624
- <div class="olist arabic"><ol class="arabic">
4496
+ <div class="olist arabic"><ol class="arabic">
4625
4497
  <li>
4626
4498
  <p>
4627
4499
  Your Apache configuration is too strict, and does not allow HTTP clients to
@@ -4650,14 +4522,14 @@ The Apache process doesn’t have permission to access your Rails application’
4650
4522
  </ol></div>
4651
4523
  </div>
4652
4524
  <div class="sect3">
4653
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_the_apache_error_log_says_that_the_spawn_manager_script_does_not_exist_or_that_it_does_not_have_permission_to_execute_it"></span><h4 data-comment-topic="the-apache-error-log-says-that-the-spawn-manager-script-does-not-exist-or-that-it-does-not-have-permission-to-execute-it-1fmoozk" data-anchor="_the_apache_error_log_says_that_the_spawn_manager_script_does_not_exist_or_that_it_does_not_have_permission_to_execute_it">6.3.5. The Apache error log says that the spawn manager script does not exist, or that it does not have permission to execute it</h4>
4525
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_the_apache_error_log_says_that_the_spawn_manager_script_does_not_exist_or_that_it_does_not_have_permission_to_execute_it" data-comment-topic="the-apache-error-log-says-that-the-spawn-manager-script-does-not-exist-or-that-it-does-not-have-permission-to-execute-it-1fmoozk">7.3.5. The Apache error log says that the spawn manager script does not exist, or that it does not have permission to execute it</h4>
4654
4526
  <div class="paragraph"><p>If you are sure that the <em>PassengerRoot</em> configuration option is set correctly,
4655
4527
  then this problem is most likely caused by the fact that you’re running Apache
4656
4528
  with SELinux. On Fedora, CentOS and RedHat Enterprise Linux, Apache is locked
4657
4529
  down by SELinux policies.</p></div>
4658
4530
  <div class="paragraph"><p>To solve this problem, you must set some permissions on the Phusion Passenger files
4659
4531
  and folders, so that Apache can access them.</p></div>
4660
- <div class="ulist"><ul>
4532
+ <div class="ulist"><ul>
4661
4533
  <li>
4662
4534
  <p>
4663
4535
  If you’ve installed Phusion Passenger via a gem, then run this command to determine
@@ -4692,7 +4564,7 @@ If you’ve installed Phusion Passenger via the source tarball, then run the fol
4692
4564
  <div class="paragraph"><p>Once the permissions are fixed, restart Apache.</p></div>
4693
4565
  </div>
4694
4566
  <div class="sect3">
4695
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_the_rails_application_reports_that_it_8217_s_unable_to_start_because_of_a_permission_error"></span><h4 data-comment-topic="the-rails-application-reports-that-it-s-unable-to-start-because-of-a-permission-error-v53i6s" data-anchor="_the_rails_application_reports_that_it_8217_s_unable_to_start_because_of_a_permission_error">6.3.6. The Rails application reports that it’s unable to start because of a permission error</h4>
4567
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_the_rails_application_reports_that_it_8217_s_unable_to_start_because_of_a_permission_error" data-comment-topic="the-rails-application-reports-that-it-s-unable-to-start-because-of-a-permission-error-v53i6s">7.3.6. The Rails application reports that it’s unable to start because of a permission error</h4>
4696
4568
  <div class="paragraph"><p>Please check whether your Rails application’s folder has the correct
4697
4569
  permissions. By default, Rails applications are started as the owner of the
4698
4570
  file <em>config/environment.rb</em>, except if the file is owned by root. If the
@@ -4702,9 +4574,9 @@ specified).</p></div>
4702
4574
  <div class="paragraph"><p>Please read <a href="#user_switching">User switching (security)</a> for details.</p></div>
4703
4575
  </div>
4704
4576
  <div class="sect3">
4705
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_my_rails_application_8217_s_log_file_is_not_being_written_to"></span><h4 data-comment-topic="my-rails-application-s-log-file-is-not-being-written-to-3i747l" data-anchor="_my_rails_application_8217_s_log_file_is_not_being_written_to">6.3.7. My Rails application’s log file is not being written to</h4>
4577
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_my_rails_application_8217_s_log_file_is_not_being_written_to" data-comment-topic="my-rails-application-s-log-file-is-not-being-written-to-3i747l">7.3.7. My Rails application’s log file is not being written to</h4>
4706
4578
  <div class="paragraph"><p>There are a couple things that you should be aware of:</p></div>
4707
- <div class="ulist"><ul>
4579
+ <div class="ulist"><ul>
4708
4580
  <li>
4709
4581
  <p>
4710
4582
  By default, Phusion Passenger runs Rails applications in <em>production</em> mode,
@@ -4733,7 +4605,7 @@ following command to give your Rails application folder that context:</p></div>
4733
4605
  </div>
4734
4606
  </div>
4735
4607
  <div class="sect3">
4736
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_i_8217_ve_deployed_my_app_on_ssl_but_the_app_thinks_its_not_on_ssl"></span><h4 data-comment-topic="i-ve-deployed-my-app-on-ssl-but-the-app-thinks-its-not-on-ssl-10rvgnr" data-anchor="_i_8217_ve_deployed_my_app_on_ssl_but_the_app_thinks_its_not_on_ssl">6.3.8. I’ve deployed my app on SSL, but the app thinks its not on SSL</h4>
4608
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_i_8217_ve_deployed_my_app_on_ssl_but_the_app_thinks_its_not_on_ssl" data-comment-topic="i-ve-deployed-my-app-on-ssl-but-the-app-thinks-its-not-on-ssl-10rvgnr">7.3.8. I’ve deployed my app on SSL, but the app thinks its not on SSL</h4>
4737
4609
  <div class="paragraph"><p>Rails and many other frameworks infers whether it’s running on SSL through the CGI
4738
4610
  environment variable <span class="monospaced">HTTPS</span>. Apache always sets this variable when on SSL,
4739
4611
  except when SSL is incorrectly configured.</p></div>
@@ -4774,30 +4646,30 @@ the corrected example:</p></div>
4774
4646
  </div>
4775
4647
  </div>
4776
4648
  <div class="sect2">
4777
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="conflicting_apache_modules"></span><h3 data-comment-topic="conflicting-apache-modules-1uwpixk" data-anchor="conflicting_apache_modules">6.4. Conflicting Apache modules</h3>
4649
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="conflicting_apache_modules" data-comment-topic="conflicting-apache-modules-1uwpixk">7.4. Conflicting Apache modules</h3>
4778
4650
  <div class="sect3">
4779
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_mod_userdir"></span><h4 data-comment-topic="mod-userdir-x5e2te" data-anchor="_mod_userdir">6.4.1. mod_userdir</h4>
4651
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_mod_userdir" data-comment-topic="mod-userdir-x5e2te">7.4.1. mod_userdir</h4>
4780
4652
  <div class="paragraph"><p><em>mod_userdir</em> is not compatible with Phusion Passenger at the moment.</p></div>
4781
4653
  </div>
4782
4654
  <div class="sect3">
4783
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_multiviews_mod_negotiation"></span><h4 data-comment-topic="multiviews-mod-negotiation--zchfg0" data-anchor="_multiviews_mod_negotiation">6.4.2. MultiViews (mod_negotiation)</h4>
4655
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_multiviews_mod_negotiation" data-comment-topic="multiviews-mod-negotiation--zchfg0">7.4.2. MultiViews (mod_negotiation)</h4>
4784
4656
  <div class="paragraph"><p>MultiViews is not compatible with Phusion Passenger. You should disable MultiViews
4785
4657
  for all Phusion Passenger hosts.</p></div>
4786
4658
  </div>
4787
4659
  <div class="sect3">
4788
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_virtualdocumentroot"></span><h4 data-comment-topic="virtualdocumentroot-14cwd7l" data-anchor="_virtualdocumentroot">6.4.3. VirtualDocumentRoot</h4>
4660
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_virtualdocumentroot" data-comment-topic="virtualdocumentroot-14cwd7l">7.4.3. VirtualDocumentRoot</h4>
4789
4661
  <div class="paragraph"><p>VirtualDocumentRoot is not compatible with Phusion Passenger at the moment.</p></div>
4790
4662
  </div>
4791
4663
  </div>
4792
4664
  </div>
4793
4665
  </div>
4794
4666
  <div class="sect1">
4795
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_analysis_and_system_maintenance"></span><h2 data-comment-topic="analysis-and-system-maintenance-qvkwzr" data-anchor="_analysis_and_system_maintenance">7. Analysis and system maintenance</h2>
4667
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h2 id="_analysis_and_system_maintenance" data-comment-topic="analysis-and-system-maintenance-qvkwzr">8. Analysis and system maintenance</h2>
4796
4668
  <div class="sectionbody">
4797
4669
  <div class="paragraph"><p>Phusion Passenger provides a set of tools, which are useful for system analysis,
4798
4670
  maintenance and troubleshooting.</p></div>
4799
4671
  <div class="sect2">
4800
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_inspecting_memory_usage"></span><h3 data-comment-topic="inspecting-memory-usage-1bkis6i" data-anchor="_inspecting_memory_usage">7.1. Inspecting memory usage</h3>
4672
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_inspecting_memory_usage" data-comment-topic="inspecting-memory-usage-1bkis6i">8.1. Inspecting memory usage</h3>
4801
4673
  <div class="paragraph"><p>Process inspection tools such as <span class="monospaced">ps</span> and <span class="monospaced">top</span> are useful, but they
4802
4674
  <a href="http://groups.google.com/group/phusion-passenger/msg/1fd1c233456d3180">rarely show the correct memory usage</a>.
4803
4675
  The real memory usage is usually lower than what <span class="monospaced">ps</span> and <span class="monospaced">top</span> report.</p></div>
@@ -4839,18 +4711,18 @@ we see that all the Apache worker processes only take less than 1 MB memory each
4839
4711
  This is a lot less than the 50 MB-ish memory usage as shown in the <em>VMSize</em> column
4840
4712
  (which is what a lot of people think is the real memory usage, but is actually not).</p></div>
4841
4713
  <div class="admonitionblock">
4842
- <table><tr>
4714
+ <table><tr>
4843
4715
  <td class="icon">
4844
- <img src="./images/icons/note.png" alt="Note">
4716
+ <img src="./images/icons/note.png" alt="Note">
4845
4717
  </td>
4846
4718
  <td class="content">Private dirty RSS reporting only works on Linux. Unfortunately other operating systems
4847
4719
  don’t provide facilities for determining processes' private dirty RSS. On non-Linux systems,
4848
4720
  the Resident Set Size is reported instead.</td>
4849
- </tr></table>
4721
+ </tr></table>
4850
4722
  </div>
4851
4723
  </div>
4852
4724
  <div class="sect2">
4853
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_inspecting_phusion_passenger_8217_s_internal_status"></span><h3 data-comment-topic="inspecting-phusion-passenger-s-internal-status-ukekf7" data-anchor="_inspecting_phusion_passenger_8217_s_internal_status">7.2. Inspecting Phusion Passenger’s internal status</h3>
4725
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_inspecting_phusion_passenger_8217_s_internal_status" data-comment-topic="inspecting-phusion-passenger-s-internal-status-ukekf7">8.2. Inspecting Phusion Passenger’s internal status</h3>
4854
4726
  <div class="paragraph"><p>One can inspect Phusion Passenger’s internal status with the tool <span class="monospaced">passenger-status</span>.
4855
4727
  This tool must typically be run as root. For example:</p></div>
4856
4728
  <div class="listingblock">
@@ -4868,7 +4740,7 @@ inactive = 1
4868
4740
  </div>
4869
4741
  </div>
4870
4742
  <div class="paragraph"><p>The <em>general information</em> section shows the following information:</p></div>
4871
- <div class="dlist"><dl>
4743
+ <div class="dlist"><dl>
4872
4744
  <dt class="hdlist1">
4873
4745
  max
4874
4746
  </dt>
@@ -4912,7 +4784,7 @@ time). The value of <em>inactive</em> equals <span class="monospaced">count - ac
4912
4784
  </dl></div>
4913
4785
  <div class="paragraph"><p>The <em>domains</em> section shows, for each application directory, information about running
4914
4786
  application instances:</p></div>
4915
- <div class="dlist"><dl>
4787
+ <div class="dlist"><dl>
4916
4788
  <dt class="hdlist1">
4917
4789
  Sessions
4918
4790
  </dt>
@@ -4965,7 +4837,7 @@ sessions compared to the others, then there might be a problem:</p></div>
4965
4837
  </div>
4966
4838
  </div>
4967
4839
  <div class="paragraph"><p>Possible reasons why spikes can occur:</p></div>
4968
- <div class="olist arabic"><ol class="arabic">
4840
+ <div class="olist arabic"><ol class="arabic">
4969
4841
  <li>
4970
4842
  <p>
4971
4843
  Your application is busy processing a request that takes a very long time.
@@ -4982,7 +4854,7 @@ Your application is frozen, i.e. has stopped responding. See
4982
4854
  </ol></div>
4983
4855
  </div>
4984
4856
  <div class="sect2">
4985
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="debugging_frozen"></span><h3 data-comment-topic="debugging-frozen-applications-1qsjqq7" data-anchor="debugging_frozen">7.3. Debugging frozen applications</h3>
4857
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="debugging_frozen" data-comment-topic="debugging-frozen-applications-1qsjqq7">8.3. Debugging frozen applications</h3>
4986
4858
  <div class="paragraph"><p>If one of your application instances is frozen (stopped responding), then you
4987
4859
  can figure out where it is frozen by killing it with <em>SIGABRT</em>. This will cause the
4988
4860
  application to raise an exception, with a backtrace.</p></div>
@@ -4994,22 +4866,22 @@ This is the case with Ruby on Rails. So if you kill a Ruby on Rails application
4994
4866
  running it in a <em>production</em> environment). If you don’t see a backtrace there, check
4995
4867
  the Apache error log.</p></div>
4996
4868
  <div class="admonitionblock">
4997
- <table><tr>
4869
+ <table><tr>
4998
4870
  <td class="icon">
4999
- <img src="./images/icons/note.png" alt="Note">
4871
+ <img src="./images/icons/note.png" alt="Note">
5000
4872
  </td>
5001
4873
  <td class="content">It is safe to kill application instances, even in live environments. Phusion Passenger
5002
4874
  will restart killed application instances, as if nothing bad happened.</td>
5003
- </tr></table>
4875
+ </tr></table>
5004
4876
  </div>
5005
4877
  </div>
5006
4878
  <div class="sect2">
5007
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_accessing_individual_application_processes"></span><h3 data-comment-topic="accessing-individual-application-processes-1p0j4jb" data-anchor="_accessing_individual_application_processes">7.4. Accessing individual application processes</h3>
4879
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_accessing_individual_application_processes" data-comment-topic="accessing-individual-application-processes-1p0j4jb">8.4. Accessing individual application processes</h3>
5008
4880
  <div class="paragraph"><p>When a request is sent to the web server, Phusion Passenger will automatically forward
5009
4881
  the request to the most suitable application process, but sometimes it is desirable to
5010
4882
  be able to directly access the individual application processes. Use cases include, but
5011
4883
  are not limited to:</p></div>
5012
- <div class="ulist"><ul>
4884
+ <div class="ulist"><ul>
5013
4885
  <li>
5014
4886
  <p>
5015
4887
  One wants to debug a memory leak or memory bloat problem that only seems to appear on
@@ -5070,17 +4942,16 @@ through the <em>X-Passenger-Connect-Password</em> HTTP header, like this:</p></d
5070
4942
  </div>
5071
4943
  </div>
5072
4944
  <div class="sect2">
5073
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_attaching_an_irb_console_to_an_application_process"></span><h3 data-comment-topic="attaching-an-irb-console-to-an-application-process-1cma32j" data-anchor="_attaching_an_irb_console_to_an_application_process">7.5. Attaching an IRB console to an application process</h3>
5074
- <div class="paragraph"><p><strong>Available in Phusion Passenger Enterprise since version 3.0.0.</strong></p></div>
4945
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_attaching_an_irb_console_to_an_application_process" data-comment-topic="attaching-an-irb-console-to-an-application-process-1cma32j">8.5. Attaching an IRB console to an application process</h3>
5075
4946
  <div class="paragraph"><p>You can attach an IRB console to any application process and inspect its state by executing arbitrary Ruby code. Do this by invoking <span class="monospaced">passenger-irb &lt;PID&gt;</span> where <em>&lt;PID&gt;</em> is the PID of the application process you wish to inspect. Note that the IRB console is currently only available for Ruby apps, not for apps in any other languages.</p></div>
5076
4947
  </div>
5077
4948
  </div>
5078
4949
  </div>
5079
4950
  <div class="sect1">
5080
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_tips"></span><h2 data-comment-topic="tips-19cwwf7" data-anchor="_tips">8. Tips</h2>
4951
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h2 id="_tips" data-comment-topic="tips-19cwwf7">9. Tips</h2>
5081
4952
  <div class="sectionbody">
5082
4953
  <div class="sect2">
5083
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="user_switching"></span><h3 data-comment-topic="user-switching-security--8njx1x" data-anchor="user_switching">8.1. User switching (security)</h3>
4954
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="user_switching" data-comment-topic="user-switching-security--8njx1x">9.1. User switching (security)</h3>
5084
4955
  <div class="paragraph"><p>There is a problem that plagues most PHP web hosts, namely the fact that all PHP
5085
4956
  applications are run in the same user context as the web server. So for
5086
4957
  example, Joe’s PHP application will be able to read Jane’s PHP application’s
@@ -5092,7 +4963,7 @@ So if <em>/home/webapps/foo/config/environment.rb</em> is owned by <em>joe</em>,
5092
4963
  Passenger will launch the corresponding Rails application as <em>joe</em> as well.</p></div>
5093
4964
  <div class="paragraph"><p>This behavior is the default, and you don’t need to configure anything. But
5094
4965
  there are things that you should keep in mind:</p></div>
5095
- <div class="ulist"><ul>
4966
+ <div class="ulist"><ul>
5096
4967
  <li>
5097
4968
  <p>
5098
4969
  The owner of <em>environment.rb</em>/<em>config.ru</em> must have read access to the application’s
@@ -5120,14 +4991,14 @@ Under no circumstances will applications be run as <em>root</em>. If
5120
4991
  option.</p></div>
5121
4992
  </div>
5122
4993
  <div class="sect2">
5123
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="reducing_memory_usage"></span><h3 data-comment-topic="reducing-memory-consumption-of-ruby-on-rails-applications-by-33--1ubxnq0" data-anchor="reducing_memory_usage">8.2. Reducing memory consumption of Ruby on Rails applications by 33%</h3>
4994
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="reducing_memory_usage" data-comment-topic="reducing-memory-consumption-of-ruby-on-rails-applications-by-33--1ubxnq0">9.2. Reducing memory consumption of Ruby on Rails applications by 33%</h3>
5124
4995
  <div class="paragraph"><p>Is it possible to reduce memory consumption of your Rails applications by 33% on average,
5125
4996
  by using <a href="http://www.rubyenterpriseedition.com/">Ruby Enterprise Edition</a>.
5126
4997
  Please visit the website for details.</p></div>
5127
4998
  <div class="paragraph"><p>Note that this feature does not apply to Rack applications.</p></div>
5128
4999
  </div>
5129
5000
  <div class="sect2">
5130
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="capistrano"></span><h3 data-comment-topic="capistrano-recipe-syzgo7" data-anchor="capistrano">8.3. Capistrano recipe</h3>
5001
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="capistrano" data-comment-topic="capistrano-recipe-syzgo7">9.3. Capistrano recipe</h3>
5131
5002
  <div class="paragraph"><p>Phusion Passenger can be combined with <a href="http://capify.org/">Capistrano</a>.
5132
5003
  The following Capistrano recipe demonstrates Phusion Passenger support.
5133
5004
  It assumes that you’re using Git as version control system.</p></div>
@@ -5162,10 +5033,10 @@ end</pre>
5162
5033
  </div>
5163
5034
  </div>
5164
5035
  <div class="sect2">
5165
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="bundler_support"></span><h3 data-comment-topic="bundler-support-cf72ih" data-anchor="bundler_support">8.4. Bundler support</h3>
5036
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="bundler_support" data-comment-topic="bundler-support-cf72ih">9.4. Bundler support</h3>
5166
5037
  <div class="paragraph"><p>Phusion Passenger has automatic support for <a href="http://gembundler.com/git.html">Bundler</a>.
5167
5038
  It works as follows:</p></div>
5168
- <div class="ulist"><ul>
5039
+ <div class="ulist"><ul>
5169
5040
  <li>
5170
5041
  <p>
5171
5042
  If you have a <em>.bundle/environment.rb</em> in your application root, then Phusion
@@ -5195,10 +5066,10 @@ the application startup file. In this file you can do whatever you need to setup
5195
5066
  or a similar system.</p></div>
5196
5067
  </div>
5197
5068
  <div class="sect2">
5198
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="moving_phusion_passenger"></span><h3 data-comment-topic="moving-phusion-passenger-to-a-different-directory-16fapwo" data-anchor="moving_phusion_passenger">8.5. Moving Phusion Passenger to a different directory</h3>
5069
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="moving_phusion_passenger" data-comment-topic="moving-phusion-passenger-to-a-different-directory-16fapwo">9.5. Moving Phusion Passenger to a different directory</h3>
5199
5070
  <div class="paragraph"><p>It is possible to relocate the Phusion Passenger files to a different directory. It
5200
5071
  involves two steps:</p></div>
5201
- <div class="olist arabic"><ol class="arabic">
5072
+ <div class="olist arabic"><ol class="arabic">
5202
5073
  <li>
5203
5074
  <p>
5204
5075
  Moving the directory.
@@ -5212,7 +5083,7 @@ Updating the “PassengerRoot” configuration option in Apache.
5212
5083
  </ol></div>
5213
5084
  <div class="paragraph"><p>For example, if Phusion Passenger is located in <em>/opt/passenger/</em>, and you’d like to
5214
5085
  move it to <em>/usr/local/passenger/</em>, then do this:</p></div>
5215
- <div class="olist arabic"><ol class="arabic">
5086
+ <div class="olist arabic"><ol class="arabic">
5216
5087
  <li>
5217
5088
  <p>
5218
5089
  Run the following command:
@@ -5236,7 +5107,7 @@ Edit your Apache configuration file, and set:
5236
5107
  </ol></div>
5237
5108
  </div>
5238
5109
  <div class="sect2">
5239
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_installing_multiple_ruby_on_rails_versions"></span><h3 data-comment-topic="installing-multiple-ruby-on-rails-versions-mi5j14" data-anchor="_installing_multiple_ruby_on_rails_versions">8.6. Installing multiple Ruby on Rails versions</h3>
5110
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_installing_multiple_ruby_on_rails_versions" data-comment-topic="installing-multiple-ruby-on-rails-versions-mi5j14">9.6. Installing multiple Ruby on Rails versions</h3>
5240
5111
  <div class="paragraph"><p>Each Ruby on Rails applications that are going to be deployed may require a
5241
5112
  specific Ruby on Rails version. You can install a specific version with
5242
5113
  this command:</p></div>
@@ -5250,7 +5121,7 @@ this command:</p></div>
5250
5121
  other. Phusion Passenger will automatically make use of the correct version.</p></div>
5251
5122
  </div>
5252
5123
  <div class="sect2">
5253
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_making_the_application_restart_after_each_request"></span><h3 data-comment-topic="making-the-application-restart-after-each-request-183bezx" data-anchor="_making_the_application_restart_after_each_request">8.7. Making the application restart after each request</h3>
5124
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_making_the_application_restart_after_each_request" data-comment-topic="making-the-application-restart-after-each-request-183bezx">9.7. Making the application restart after each request</h3>
5254
5125
  <div class="paragraph"><p>In some situations it might be desirable to restart the web application after
5255
5126
  each request, for example when developing a non-Rails application that doesn’t
5256
5127
  support code reloading, or when developing a web framework.</p></div>
@@ -5259,9 +5130,9 @@ application’s root folder. Unlike <em>restart.txt</em>, Phusion Passenger does
5259
5130
  check for this file’s timestamp: Phusion Passenger will always restart the
5260
5131
  application, as long as <em>always_restart.txt</em> exists.</p></div>
5261
5132
  <div class="admonitionblock">
5262
- <table><tr>
5133
+ <table><tr>
5263
5134
  <td class="icon">
5264
- <img src="./images/icons/note.png" alt="Note">
5135
+ <img src="./images/icons/note.png" alt="Note">
5265
5136
  </td>
5266
5137
  <td class="content">If you’re just developing a Rails application then you probably don’t need
5267
5138
  this feature. If you set <em>RailsEnv development</em> in your Apache configuration,
@@ -5269,11 +5140,11 @@ then Rails will automatically reload your application code after each request.
5269
5140
  <em>always_restart.txt</em> is only useful if you’re working on Ruby on Rails itself,
5270
5141
  or when you’re not developing a Rails application and your web framework
5271
5142
  does not support code reloading.</td>
5272
- </tr></table>
5143
+ </tr></table>
5273
5144
  </div>
5274
5145
  </div>
5275
5146
  <div class="sect2">
5276
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="sub_uri_deployment_uri_fix"></span><h3 data-comment-topic="how-to-fix-broken-images-css-javascript-uris-in-sub-uri-deployments-a63b6r" data-anchor="sub_uri_deployment_uri_fix">8.8. How to fix broken images/CSS/JavaScript URIs in sub-URI deployments</h3>
5147
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="sub_uri_deployment_uri_fix" data-comment-topic="how-to-fix-broken-images-css-javascript-uris-in-sub-uri-deployments-a63b6r">9.8. How to fix broken images/CSS/JavaScript URIs in sub-URI deployments</h3>
5277
5148
  <div class="paragraph"><p>Some people experience broken images and other broken static assets when they
5278
5149
  deploy their application to a sub-URI (i.e. <em>http://mysite.com/railsapp/</em>).
5279
5150
  The reason for this usually is that you used a
@@ -5311,12 +5182,12 @@ please refer to
5311
5182
  <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html">the Rails API docs</a>.</p></div>
5312
5183
  </div>
5313
5184
  <div class="sect2">
5314
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_x_sendfile_support"></span><h3 data-comment-topic="x-sendfile-support-1cgyykw" data-anchor="_x_sendfile_support">8.9. X-Sendfile support</h3>
5185
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_x_sendfile_support" data-comment-topic="x-sendfile-support-1cgyykw">9.9. X-Sendfile support</h3>
5315
5186
  <div class="paragraph"><p>Phusion Passenger does not provide X-Sendfile support by itself. Please install
5316
5187
  <a href="http://tn123.ath.cx/mod_xsendfile/">mod_xsendfile</a> for X-Sendfile support.</p></div>
5317
5188
  </div>
5318
5189
  <div class="sect2">
5319
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_upload_progress"></span><h3 data-comment-topic="upload-progress-71cyl7" data-anchor="_upload_progress">8.10. Upload progress</h3>
5190
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_upload_progress" data-comment-topic="upload-progress-71cyl7">9.10. Upload progress</h3>
5320
5191
  <div class="paragraph"><p>Phusion Passenger does not provide upload progress support by itself. Please
5321
5192
  try drogus’s <a href="http://github.com/drogus/apache-upload-progress-module/tree/master">
5322
5193
  Apache upload progress module</a> instead.</p></div>
@@ -5324,13 +5195,13 @@ Apache upload progress module</a> instead.</p></div>
5324
5195
  </div>
5325
5196
  </div>
5326
5197
  <div class="sect1">
5327
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_under_the_hood"></span><h2 data-comment-topic="under-the-hood-21ue5t" data-anchor="_under_the_hood">9. Under the hood</h2>
5198
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h2 id="_under_the_hood" data-comment-topic="under-the-hood-21ue5t">10. Under the hood</h2>
5328
5199
  <div class="sectionbody">
5329
5200
  <div class="paragraph"><p>Phusion Passenger hides a lot of complexity for the end user (i.e. the web server
5330
5201
  system administrator), but sometimes it is desirable to know what is going on.
5331
5202
  This section describes a few things that Phusion Passenger does under the hood.</p></div>
5332
5203
  <div class="sect2">
5333
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_static_assets_serving"></span><h3 data-comment-topic="static-assets-serving-wo2d9v" data-anchor="_static_assets_serving">9.1. Static assets serving</h3>
5204
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_static_assets_serving" data-comment-topic="static-assets-serving-wo2d9v">10.1. Static assets serving</h3>
5334
5205
  <div class="paragraph"><p>Phusion Passenger accelerates serving of static files. This means that, if an URI
5335
5206
  maps to a file that exists, then Phusion Passenger will let Apache serve that file
5336
5207
  directly, without hitting the web application.</p></div>
@@ -5350,7 +5221,7 @@ RewriteRule ^(.*)$ balancer://mongrel%{REQUEST_URI} [P,QSA,L]</pre>
5350
5221
  them.</p></div>
5351
5222
  </div>
5352
5223
  <div class="sect2">
5353
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_page_caching_support"></span><h3 data-comment-topic="page-caching-support-kwq9b9" data-anchor="_page_caching_support">9.2. Page caching support</h3>
5224
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_page_caching_support" data-comment-topic="page-caching-support-kwq9b9">10.2. Page caching support</h3>
5354
5225
  <div class="paragraph"><p>For each HTTP request, Phusion Passenger will automatically look for a corresponding
5355
5226
  page cache file, and serve that if it exists. It does this by appending ".html" to
5356
5227
  the filename that the URI normally maps to, and checking whether that file exists.
@@ -5358,7 +5229,7 @@ This check occurs after checking whether the original mapped filename exists (as
5358
5229
  of static asset serving). All this is done without the need for special mod_rewrite
5359
5230
  rules.</p></div>
5360
5231
  <div class="paragraph"><p>For example, suppose that the browser requests <em>/foo/bar</em>.</p></div>
5361
- <div class="olist arabic"><ol class="arabic">
5232
+ <div class="olist arabic"><ol class="arabic">
5362
5233
  <li>
5363
5234
  <p>
5364
5235
  Phusion Passenger will first check whether this URI maps to a static file, i.e.
@@ -5386,7 +5257,7 @@ the <em>public</em> directory. In that case you’ll need to use mod_rewrite to
5386
5257
  page cache files.</p></div>
5387
5258
  </div>
5388
5259
  <div class="sect2">
5389
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="application_detection"></span><h3 data-comment-topic="how-phusion-passenger-detects-whether-a-virtual-host-is-a-web-application-179mp8m" data-anchor="application_detection">9.3. How Phusion Passenger detects whether a virtual host is a web application</h3>
5260
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="application_detection" data-comment-topic="how-phusion-passenger-detects-whether-a-virtual-host-is-a-web-application-179mp8m">10.3. How Phusion Passenger detects whether a virtual host is a web application</h3>
5390
5261
  <div class="paragraph"><p>After you’ve read the deployment instructions you might wonder how Phusion Passenger
5391
5262
  knows that the DocumentRoot points to a web application that Phusion Passenger is
5392
5263
  able to serve, and how it knows what kind of web application it is (e.g. Rails or Rack).</p></div>
@@ -5399,7 +5270,7 @@ whether the following file exists:</p></div>
5399
5270
  </div>
5400
5271
  <div class="paragraph"><p>If you’re not a programmer and don’t understand the above pseudo-code snippet, it means
5401
5272
  that Phusion Passenger will:</p></div>
5402
- <div class="olist arabic"><ol class="arabic">
5273
+ <div class="olist arabic"><ol class="arabic">
5403
5274
  <li>
5404
5275
  <p>
5405
5276
  Extract the parent directory filename from the value of the DocumentRoot directory.
@@ -5435,30 +5306,28 @@ Phusion Passenger will look for <em>config.ru</em> instead of <em>config/environ
5435
5306
  </div>
5436
5307
  </div>
5437
5308
  <div class="sect1">
5438
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_appendix_a_about_this_document"></span><h2 data-comment-topic="appendix-a-about-this-document-103toqs" data-anchor="_appendix_a_about_this_document">10. Appendix A: About this document</h2>
5309
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h2 id="_appendix_a_about_this_document" data-comment-topic="appendix-a-about-this-document-103toqs">11. Appendix A: About this document</h2>
5439
5310
  <div class="sectionbody">
5440
5311
  <div class="paragraph"><p>The text of this document is licensed under the
5441
5312
  <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons
5442
5313
  Attribution-Share Alike 3.0 Unported License</a>.</p></div>
5443
5314
  <div class="paragraph"><p><span class="image">
5444
5315
  <a class="image" href="http://creativecommons.org/licenses/by-sa/3.0/">
5445
- <img src="images/by_sa.png" alt="images/by_sa.png">
5446
- </a>
5316
+ <img src="images/by_sa.png" alt="images/by_sa.png"></a>
5447
5317
  </span></p></div>
5448
5318
  <div class="paragraph"><p>Phusion Passenger is brought to you by <a href="http://www.phusion.nl/">Phusion</a>.</p></div>
5449
5319
  <div class="paragraph"><p><span class="image">
5450
5320
  <a class="image" href="http://www.phusion.nl/">
5451
- <img src="images/phusion_banner.png" alt="images/phusion_banner.png">
5452
- </a>
5321
+ <img src="images/phusion_banner.png" alt="images/phusion_banner.png"></a>
5453
5322
  </span></p></div>
5454
5323
  <div class="paragraph"><p>Phusion Passenger is a trademark of Hongli Lai &amp; Ninh Bui.</p></div>
5455
5324
  </div>
5456
5325
  </div>
5457
5326
  <div class="sect1">
5458
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_appendix_b_terminology"></span><h2 data-comment-topic="appendix-b-terminology-h4eaf4" data-anchor="_appendix_b_terminology">11. Appendix B: Terminology</h2>
5327
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h2 id="_appendix_b_terminology" data-comment-topic="appendix-b-terminology-h4eaf4">12. Appendix B: Terminology</h2>
5459
5328
  <div class="sectionbody">
5460
5329
  <div class="sect2">
5461
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="application_root"></span><h3 data-comment-topic="application-root-otx6xf" data-anchor="application_root">11.1. Application root</h3>
5330
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="application_root" data-comment-topic="application-root-otx6xf">12.1. Application root</h3>
5462
5331
  <div class="paragraph"><p>The root directory of an application that’s served by Phusion Passenger.</p></div>
5463
5332
  <div class="paragraph"><p>In case of Ruby on Rails applications, this is the directory that contains
5464
5333
  <em>Rakefile</em>, <em>app/</em>, <em>config/</em>, <em>public/</em>, etc. In other words, the directory
@@ -5520,17 +5389,17 @@ For example, take the following directory structure:</p></div>
5520
5389
  </div>
5521
5390
  </div>
5522
5391
  <div class="sect2">
5523
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="idle_process"></span><h3 data-comment-topic="idle-process-potb6g" data-anchor="idle_process">11.2. Idle process</h3>
5392
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="idle_process" data-comment-topic="idle-process-potb6g">12.2. Idle process</h3>
5524
5393
  <div class="paragraph"><p>An "idle process" refers to a process that hasn’t processed any requests for a while.</p></div>
5525
5394
  </div>
5526
5395
  <div class="sect2">
5527
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="inactive_process"></span><h3 data-comment-topic="inactive-process-16gjv2e" data-anchor="inactive_process">11.3. Inactive process</h3>
5396
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="inactive_process" data-comment-topic="inactive-process-16gjv2e">12.3. Inactive process</h3>
5528
5397
  <div class="paragraph"><p>An "inactive process" refers to a process that’s current not processing any requests. An idle process is always inactive, but an inactive process is not always considered idle.</p></div>
5529
5398
  </div>
5530
5399
  </div>
5531
5400
  </div>
5532
5401
  <div class="sect1">
5533
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="spawning_methods_explained"></span><h2 data-comment-topic="appendix-c-spawning-methods-explained-owghi9" data-anchor="spawning_methods_explained">12. Appendix C: Spawning methods explained</h2>
5402
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h2 id="spawning_methods_explained" data-comment-topic="appendix-c-spawning-methods-explained-owghi9">13. Appendix C: Spawning methods explained</h2>
5534
5403
  <div class="sectionbody">
5535
5404
  <div class="paragraph"><p>At its core, Phusion Passenger is an HTTP proxy and process manager. It spawns
5536
5405
  Ruby on Rails/Rack/WSGI worker processes (which may also be referred to as
@@ -5540,7 +5409,7 @@ processes.</p></div>
5540
5409
  Let’s go over the different spawning methods. For simplicity’s sake, let’s
5541
5410
  assume that we’re only talking about Ruby on Rails applications.</p></div>
5542
5411
  <div class="sect2">
5543
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_the_most_straightforward_and_traditional_way_conservative_spawning"></span><h3 data-comment-topic="the-most-straightforward-and-traditional-way-conservative-spawning-1ybbli2" data-anchor="_the_most_straightforward_and_traditional_way_conservative_spawning">12.1. The most straightforward and traditional way: conservative spawning</h3>
5412
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_the_most_straightforward_and_traditional_way_direct_spawning" data-comment-topic="the-most-straightforward-and-traditional-way-conservative-spawning-1ybbli2">13.1. The most straightforward and traditional way: direct spawning</h3>
5544
5413
  <div class="paragraph"><p>Phusion Passenger could create a new Ruby process, which will then load the
5545
5414
  Rails application along with the entire Rails framework. This process will then
5546
5415
  enter an request handling main loop.</p></div>
@@ -5549,7 +5418,7 @@ familiar with the Mongrel application server, then this approach is exactly
5549
5418
  what mongrel_cluster performs: it creates N worker processes, each which loads
5550
5419
  a full copy of the Rails application and the Rails framework in memory. The Thin
5551
5420
  application server employs pretty much the same approach.</p></div>
5552
- <div class="paragraph"><p>Note that Phusion Passenger’s version of conservative spawning differs slightly
5421
+ <div class="paragraph"><p>Note that Phusion Passenger’s version of direct spawning differs slightly
5553
5422
  from mongrel_cluster. Mongrel_cluster creates entirely new Ruby processes. In
5554
5423
  programmers jargon, mongrel_cluster creates new Ruby processes by forking the
5555
5424
  current process and exec()-ing a new Ruby interpreter. Phusion Passenger on the
@@ -5557,31 +5426,29 @@ other hand creates processes that reuse the already loaded Ruby interpreter. In
5557
5426
  programmers jargon, Phusion Passenger calls fork(), but not exec().</p></div>
5558
5427
  </div>
5559
5428
  <div class="sect2">
5560
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_the_smart_spawning_method"></span><h3 data-comment-topic="the-smart-spawning-method-1cvu9dd" data-anchor="_the_smart_spawning_method">12.2. The smart spawning method</h3>
5429
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_the_smart_spawning_method" data-comment-topic="the-smart-spawning-method-1cvu9dd">13.2. The smart spawning method</h3>
5561
5430
  <div class="admonitionblock">
5562
- <table><tr>
5431
+ <table><tr>
5563
5432
  <td class="icon">
5564
- <img src="./images/icons/note.png" alt="Note">
5433
+ <img src="./images/icons/note.png" alt="Note">
5565
5434
  </td>
5566
5435
  <td class="content">Smart spawning is supported for all Ruby applications but not for WSGI applications.</td>
5567
- </tr></table>
5436
+ </tr></table>
5568
5437
  </div>
5569
- <div class="paragraph"><p>While conservative spawning works well, it’s not as efficient as it could be
5438
+ <div class="paragraph"><p>While direct spawning works well, it’s not as efficient as it could be
5570
5439
  because each worker process has its own private copy of the Rails application
5571
5440
  as well as the Rails framework. This wastes memory as well as startup time.</p></div>
5572
5441
  <div class="paragraph"><p><span class="image">
5573
- <img src="images/conservative_spawning.png" alt="Worker processes and conservative spawning">
5574
- </span><br>
5575
- <em>Figure: Worker processes and conservative spawning. Each worker process has its
5442
+ <img src="images/direct_spawning.png" alt="Worker processes and direct spawning"></span><br><em>Figure: Worker processes and direct spawning. Each worker process has its
5576
5443
  own private copy of the application code and Rails framework code.</em></p></div>
5577
5444
  <div class="paragraph"><p>It is possible to make the different worker processes share the memory occupied
5578
5445
  by application and Rails framework code, by utilizing so-called
5579
5446
  copy-on-write semantics of the virtual memory system on modern operating
5580
5447
  systems. As a side effect, the startup time is also reduced. This is technique
5581
- is exploited by Phusion Passenger’s <em>smart</em> and <em>smart-lv2</em> spawn methods.</p></div>
5448
+ is exploited by Phusion Passenger’s <em>smart</em> spawn method.</p></div>
5582
5449
  <div class="sect3">
5583
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_how_it_works"></span><h4 data-comment-topic="how-it-works-672zja" data-anchor="_how_it_works">12.2.1. How it works</h4>
5584
- <div class="paragraph"><p>When the <em>smart-lv2</em> spawn method is being used, Phusion Passenger will first
5450
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_how_it_works" data-comment-topic="how-it-works-672zja">13.2.1. How it works</h4>
5451
+ <div class="paragraph"><p>When the <em>smart</em> spawn method is being used, Phusion Passenger will first
5585
5452
  create a so-called <em>ApplicationSpawner server</em> process. This process loads the
5586
5453
  entire Rails application along with the Rails framework, by loading
5587
5454
  <em>environment.rb</em>. Then, whenever Phusion Passenger needs a new worker process,
@@ -5596,24 +5463,13 @@ processes will share as much common
5596
5463
  memory as possible. That is, they will all share the same application and Rails
5597
5464
  framework code.</p></div>
5598
5465
  <div class="paragraph"><p><span class="image">
5599
- <img src="images/smart-lv2.png" alt="images/smart-lv2.png">
5600
- </span><br>
5601
- <em>Figure: Worker processes and the smart-lv2 spawn method. All worker processes,
5466
+ <img src="images/smart.png" alt="images/smart.png"></span><br><em>Figure: Worker processes and the smart spawn method. All worker processes,
5602
5467
  as well as the ApplicationSpawner, share the same application code and Rails
5603
5468
  framework code.</em></p></div>
5604
- <div class="paragraph"><p>The <em>smart</em> spawn method goes even further, by caching the Rails framework in
5605
- another process called the <em>FrameworkSpawner server</em>. This process only loads
5606
- the Rails framework, not the application. When a FrameworkSpawner server is
5607
- instructed to create a new worker process, it will create a new
5608
- ApplicationSpawner to which the instruction will be delegated. All those
5609
- ApplicationSpawner servers, as well as all worker processes created by those
5610
- ApplicationSpawner servers, will share the same Rails framework code.</p></div>
5611
- <div class="paragraph"><p>The <em>smart-lv2</em> method allows different worker processes that belong to the same
5612
- application to share memory. The <em>smart</em> method allows different worker
5613
- processes - that happen to use the same Rails version - to share memory, even if
5614
- they don’t belong to the same application.</p></div>
5469
+ <div class="paragraph"><p>The <em>smart</em> method allows different worker processes that belong to the same
5470
+ application to share memory.</p></div>
5615
5471
  <div class="paragraph"><p>Notes:</p></div>
5616
- <div class="ulist"><ul>
5472
+ <div class="ulist"><ul>
5617
5473
  <li>
5618
5474
  <p>
5619
5475
  Vendored Rails frameworks cannot be shared by different applications, even if
@@ -5623,53 +5479,32 @@ Vendored Rails frameworks cannot be shared by different applications, even if
5623
5479
  </li>
5624
5480
  <li>
5625
5481
  <p>
5626
- ApplicationSpawner and FrameworkSpawner servers have an idle timeout just
5627
- like worker processes. If an ApplicationSpawner/FrameworkSpawner server hasn’t
5628
- been instructed to do anything for a while, it will be shutdown in order to
5629
- conserve memory. This idle timeout is configurable.
5482
+ ApplicationSpawner servers have an idle timeout just like worker processes.
5483
+ If an ApplicationSpawner/FrameworkSpawner server hasn’t been instructed to do
5484
+ anything for a while, it will be shutdown in order to conserve memory. This
5485
+ idle timeout is configurable.
5630
5486
  </p>
5631
5487
  </li>
5632
5488
  </ul></div>
5633
5489
  </div>
5634
5490
  <div class="sect3">
5635
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_summary_of_benefits"></span><h4 data-comment-topic="summary-of-benefits-1yrihfb" data-anchor="_summary_of_benefits">12.2.2. Summary of benefits</h4>
5491
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_summary_of_benefits" data-comment-topic="summary-of-benefits-1yrihfb">13.2.2. Summary of benefits</h4>
5636
5492
  <div class="paragraph"><p>Suppose that Phusion Passenger needs a new worker process for an application
5637
5493
  that uses Rails 2.2.1.</p></div>
5638
- <div class="ulist"><ul>
5639
- <li>
5640
- <p>
5641
- If the <em>smart-lv2</em> spawning method is used, and an ApplicationSpawner server
5642
- for this application is already running, then worker process creation time is
5643
- about 10 times faster than conservative spawning. This worker process will also
5644
- share application and Rails framework code memory with the ApplicationSpawner
5645
- server and the worker processes that had been spawned by this ApplicationSpawner
5646
- server.
5647
- </p>
5648
- </li>
5649
- <li>
5650
- <p>
5651
- If the <em>smart</em> spawning method is used, and a FrameworkSpawner server for
5652
- Rails 2.2.1 is already running, but no ApplicationSpawner server for this
5653
- application is running, then worker process creation time is about 2 times
5654
- faster than conservative spawning. If there is an ApplicationSpawner server
5655
- for this application running, then worker process creation time is about 10
5656
- times faster. This worker process will also share application and Rails
5657
- framework code memory with the ApplicationSpawner and FrameworkSpawner
5658
- servers.
5659
- </p>
5660
- </li>
5661
- </ul></div>
5662
- <div class="paragraph"><p>You could compare ApplicationSpawner and FrameworkSpawner servers with stem
5663
- cells, that have the ability to quickly change into more specific cells (worker
5664
- process).</p></div>
5665
- <div class="paragraph"><p>In practice, the smart spawning methods could mean a memory saving of about 33%,
5494
+ <div class="paragraph"><p>If the <em>smart</em> spawning method is used, and an ApplicationSpawner server
5495
+ for this application is already running, then worker process creation time is
5496
+ about 10 times faster than direct spawning. This worker process will also
5497
+ share application and Rails framework code memory with the ApplicationSpawner
5498
+ server and the worker processes that had been spawned by this ApplicationSpawner
5499
+ server.</p></div>
5500
+ <div class="paragraph"><p>In practice, the smart spawning method could mean a memory saving of about 33%,
5666
5501
  assuming that your Ruby interpreter is <a href="#reducing_memory_usage">copy-on-write friendly</a>.</p></div>
5667
5502
  <div class="paragraph"><p>Of course, smart spawning is not without gotchas. But if you understand the
5668
5503
  gotchas you can easily reap the benefits of smart spawning.</p></div>
5669
5504
  </div>
5670
5505
  </div>
5671
5506
  <div class="sect2">
5672
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_smart_spawning_gotcha_1_unintentional_file_descriptor_sharing"></span><h3 data-comment-topic="smart-spawning-gotcha-1-unintentional-file-descriptor-sharing-z1y55l" data-anchor="_smart_spawning_gotcha_1_unintentional_file_descriptor_sharing">12.3. Smart spawning gotcha #1: unintentional file descriptor sharing</h3>
5507
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_smart_spawning_gotcha_1_unintentional_file_descriptor_sharing" data-comment-topic="smart-spawning-gotcha-1-unintentional-file-descriptor-sharing-z1y55l">13.3. Smart spawning gotcha #1: unintentional file descriptor sharing</h3>
5673
5508
  <div class="paragraph"><p>Because worker processes are created by forking from an ApplicationSpawner
5674
5509
  server, it will share all file descriptors that are opened by the
5675
5510
  ApplicationSpawner server. (This is part of the semantics of the Unix
@@ -5695,7 +5530,7 @@ http://www.gnu.org/software/src-highlite -->
5695
5530
  <span style="font-style: italic"><span style="color: #9A1900"># We're in smart spawning mode.</span></span>
5696
5531
  <span style="color: #990000">...</span> code to reestablish socket connections here <span style="color: #990000">...</span>
5697
5532
  <span style="font-weight: bold"><span style="color: #0000FF">else</span></span>
5698
- <span style="font-style: italic"><span style="color: #9A1900"># We're in conservative spawning mode. We don't need to do anything.</span></span>
5533
+ <span style="font-style: italic"><span style="color: #9A1900"># We're in direct spawning mode. We don't need to do anything.</span></span>
5699
5534
  <span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
5700
5535
  <span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
5701
5536
  <span style="font-weight: bold"><span style="color: #0000FF">end</span></span></tt></pre>
@@ -5705,7 +5540,7 @@ http://www.gnu.org/software/src-highlite -->
5705
5540
  database upon creating a new worker process, which is why you normally do not
5706
5541
  encounter any database issues when using smart spawning mode.</p></div>
5707
5542
  <div class="sect3">
5708
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_example_1_memcached_connection_sharing_harmful"></span><h4 data-comment-topic="example-1-memcached-connection-sharing-harmful--c71wqw" data-anchor="_example_1_memcached_connection_sharing_harmful">12.3.1. Example 1: Memcached connection sharing (harmful)</h4>
5543
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_example_1_memcached_connection_sharing_harmful" data-comment-topic="example-1-memcached-connection-sharing-harmful--c71wqw">13.3.1. Example 1: Memcached connection sharing (harmful)</h4>
5709
5544
  <div class="paragraph"><p>Suppose we have a Rails application that connects to a Memcached server in
5710
5545
  <em>environment.rb</em>. This causes the ApplicationSpawner to have a socket connection
5711
5546
  (file descriptor) to the Memcached server, as shown in the following figure:</p></div>
@@ -5796,7 +5631,7 @@ http://www.gnu.org/software/src-highlite -->
5796
5631
  <span style="font-style: italic"><span style="color: #9A1900"># We're in smart spawning mode.</span></span>
5797
5632
  reestablish_connection_to_memcached
5798
5633
  <span style="font-weight: bold"><span style="color: #0000FF">else</span></span>
5799
- <span style="font-style: italic"><span style="color: #9A1900"># We're in conservative spawning mode. We don't need to do anything.</span></span>
5634
+ <span style="font-style: italic"><span style="color: #9A1900"># We're in direct spawning mode. We don't need to do anything.</span></span>
5800
5635
  <span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
5801
5636
  <span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
5802
5637
  <span style="font-weight: bold"><span style="color: #0000FF">end</span></span></tt></pre>
@@ -5804,7 +5639,7 @@ http://www.gnu.org/software/src-highlite -->
5804
5639
  </div>
5805
5640
  </div>
5806
5641
  <div class="sect3">
5807
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_example_2_log_file_sharing_not_harmful"></span><h4 data-comment-topic="example-2-log-file-sharing-not-harmful--1p2yuol" data-anchor="_example_2_log_file_sharing_not_harmful">12.3.2. Example 2: Log file sharing (not harmful)</h4>
5642
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h4 id="_example_2_log_file_sharing_not_harmful" data-comment-topic="example-2-log-file-sharing-not-harmful--1p2yuol">13.3.2. Example 2: Log file sharing (not harmful)</h4>
5808
5643
  <div class="paragraph"><p>There are also cases in which unintentional file descriptor sharing is not harmful.
5809
5644
  One such case is log file file descriptor sharing. Even if two processes write
5810
5645
  to the log file at the same time, the worst thing that can happen is that the
@@ -5816,7 +5651,7 @@ Memcached example, doesn’t help.</p></div>
5816
5651
  </div>
5817
5652
  </div>
5818
5653
  <div class="sect2">
5819
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_smart_spawning_gotcha_2_the_need_to_revive_threads"></span><h3 data-comment-topic="smart-spawning-gotcha-2-the-need-to-revive-threads-1k6cj7d" data-anchor="_smart_spawning_gotcha_2_the_need_to_revive_threads">12.4. Smart spawning gotcha #2: the need to revive threads</h3>
5654
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_smart_spawning_gotcha_2_the_need_to_revive_threads" data-comment-topic="smart-spawning-gotcha-2-the-need-to-revive-threads-1k6cj7d">13.4. Smart spawning gotcha #2: the need to revive threads</h3>
5820
5655
  <div class="paragraph"><p>Another part of the <em>fork()</em> system call’s semantics is the fact that threads
5821
5656
  disappear after a fork call. So if you’ve created any threads in environment.rb,
5822
5657
  then those threads will no longer be running in newly created worker process.
@@ -5834,7 +5669,7 @@ http://www.gnu.org/software/src-highlite -->
5834
5669
  <span style="font-style: italic"><span style="color: #9A1900"># We're in smart spawning mode.</span></span>
5835
5670
  <span style="color: #990000">...</span> code to revive threads here <span style="color: #990000">...</span>
5836
5671
  <span style="font-weight: bold"><span style="color: #0000FF">else</span></span>
5837
- <span style="font-style: italic"><span style="color: #9A1900"># We're in conservative spawning mode. We don't need to do anything.</span></span>
5672
+ <span style="font-style: italic"><span style="color: #9A1900"># We're in direct spawning mode. We don't need to do anything.</span></span>
5838
5673
  <span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
5839
5674
  <span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
5840
5675
  <span style="font-weight: bold"><span style="color: #0000FF">end</span></span></tt></pre>
@@ -5842,7 +5677,7 @@ http://www.gnu.org/software/src-highlite -->
5842
5677
  </div>
5843
5678
  </div>
5844
5679
  <div class="sect2">
5845
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_smart_spawning_gotcha_3_code_load_order"></span><h3 data-comment-topic="smart-spawning-gotcha-3-code-load-order-nkotiy" data-anchor="_smart_spawning_gotcha_3_code_load_order">12.5. Smart spawning gotcha #3: code load order</h3>
5680
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><h3 id="_smart_spawning_gotcha_3_code_load_order" data-comment-topic="smart-spawning-gotcha-3-code-load-order-nkotiy">13.5. Smart spawning gotcha #3: code load order</h3>
5846
5681
  <div class="paragraph"><p>This gotcha is only applicable to the <em>smart</em> spawn method, not the <em>smart-lv2</em>
5847
5682
  spawn method.</p></div>
5848
5683
  <div class="paragraph"><p>If your application expects the Rails framework to be not loaded during the
@@ -5864,7 +5699,9 @@ has no effect.</p></div>
5864
5699
  </div>
5865
5700
  <div id="footnotes"><hr></div>
5866
5701
  <div id="footer">
5867
-
5702
+ <div id="footer-text">
5703
+ Last updated 2012-10-24 16:27:54 CEST
5704
+ </div>
5868
5705
  </div>
5869
5706
  <script>/*! jQuery v1.7.1 jquery.com | jquery.org/license */
5870
5707
  (function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function cb(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function ca(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)ca(a+"["+e+"]",b[e],c,d);else d(a,b)}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bT,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bP),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bC(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d>0){if(c!=="border")for(;g<h;g++)c||(d-=parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0;return d+"px"}d=bz(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;g<h;g++)d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0);return d+"px"}function bp(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g)},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++)if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return!!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p,q=c.createElement("div"),r=c.documentElement;q.setAttribute("className","t"),q.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="<div "+n+"><div></div></div>"+"<table "+n+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="<div style='width:4px;'></div>",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h=null;if(typeof a=="undefined"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++)g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]));f._data(this[0],"parsedAttrs",!0)}}return h}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split("."),d[1]=d[1]?"."+d[1]:"";if(c===b){h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise()}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h<g;h++)e=d[h],e&&(c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};
@@ -6201,7 +6038,6 @@ Mizuho.initializeTopBar = $.proxy(function() {
6201
6038
  var isMobileDevice = this.isMobileDevice();
6202
6039
  var timerId;
6203
6040
 
6204
- // Create the floating table of contents used in the top bar.
6205
6041
  var $floattoc = $('<div id="floattoc"></div>').html($('#toc').html());
6206
6042
  $floattoc.find('#toctitle').remove();
6207
6043
  $floattoc.find('.comments').remove();
@@ -6220,8 +6056,6 @@ Mizuho.initializeTopBar = $.proxy(function() {
6220
6056
  self.internalLinkClicked(this, event);
6221
6057
  });
6222
6058
 
6223
- // Callback for when the user clicks on the Table of Contents
6224
- // button on the top bar.
6225
6059
  function showFloatingToc() {
6226
6060
  var scrollUpdateTimerId;
6227
6061
 
@@ -6314,9 +6148,6 @@ Mizuho.initializeTopBar = $.proxy(function() {
6314
6148
  $window.bind('scroll', onScroll);
6315
6149
  }
6316
6150
 
6317
- // Called whenever the user scrolls. Updates the title of the
6318
- // Table of Contents button in the top bar to the section that
6319
- // the user is currently reading.
6320
6151
  function update() {
6321
6152
  if ($title.offset().top + $title.height() < $document.scrollTop()) {
6322
6153
  if (!$topbar.is(':visible')) {
@@ -6360,7 +6191,6 @@ Mizuho.initializeTopBar = $.proxy(function() {
6360
6191
  }, 100);
6361
6192
  }
6362
6193
 
6363
-
6364
6194
  if (isMobileDevice) {
6365
6195
  // Mobile devices don't support position fixed.
6366
6196
  $topbar.css('position', 'absolute');
@@ -6544,5 +6374,5 @@ Mizuho.topicListReceived = $.proxy(function(result) {
6544
6374
  $(document).ready(Mizuho.initializeCommenting);
6545
6375
 
6546
6376
  </script>
6547
- </body>
6377
+ </body>
6548
6378
  </html>