passenger 2.1.2 → 2.1.3

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 (244) hide show
  1. data/Rakefile +7 -5
  2. data/doc/Architectural overview.html +729 -1
  3. data/doc/Architectural overview.txt +0 -5
  4. data/doc/Security of user switching support.html +605 -1
  5. data/doc/Users guide.html +110 -106
  6. data/doc/Users guide.txt +49 -0
  7. data/doc/cxxapi/ApplicationPoolServer_8h-source.html +400 -372
  8. data/doc/cxxapi/ApplicationPool_8h-source.html +1 -1
  9. data/doc/cxxapi/Application_8h-source.html +1 -1
  10. data/doc/cxxapi/Bucket_8h-source.html +1 -1
  11. data/doc/cxxapi/CachedFileStat_8h-source.html +56 -65
  12. data/doc/cxxapi/Configuration_8h-source.html +40 -32
  13. data/doc/cxxapi/DirectoryMapper_8h-source.html +1 -1
  14. data/doc/cxxapi/DummySpawnManager_8h-source.html +1 -1
  15. data/doc/cxxapi/Exceptions_8h-source.html +1 -1
  16. data/doc/cxxapi/FileChecker_8h-source.html +29 -30
  17. data/doc/cxxapi/Hooks_8h-source.html +1 -1
  18. data/doc/cxxapi/Logging_8h-source.html +1 -1
  19. data/doc/cxxapi/MessageChannel_8h-source.html +1 -1
  20. data/doc/cxxapi/PoolOptions_8h-source.html +1 -1
  21. data/doc/cxxapi/SpawnManager_8h-source.html +225 -219
  22. data/doc/cxxapi/StandardApplicationPool_8h-source.html +451 -445
  23. data/doc/cxxapi/SystemTime_8h-source.html +1 -1
  24. data/doc/cxxapi/Utils_8h-source.html +201 -140
  25. data/doc/cxxapi/annotated.html +2 -2
  26. data/doc/cxxapi/classClient-members.html +1 -1
  27. data/doc/cxxapi/classClient.html +1 -1
  28. data/doc/cxxapi/classHooks-members.html +1 -1
  29. data/doc/cxxapi/classHooks.html +1 -1
  30. data/doc/cxxapi/classPassenger_1_1Application-members.html +1 -1
  31. data/doc/cxxapi/classPassenger_1_1Application.html +1 -1
  32. data/doc/cxxapi/classPassenger_1_1ApplicationPool-members.html +1 -1
  33. data/doc/cxxapi/classPassenger_1_1ApplicationPool.html +1 -1
  34. data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer-members.html +1 -1
  35. data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer.html +1 -1
  36. data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.png +0 -0
  37. data/doc/cxxapi/classPassenger_1_1Application_1_1Session-members.html +1 -1
  38. data/doc/cxxapi/classPassenger_1_1Application_1_1Session.html +1 -1
  39. data/doc/cxxapi/{classPassenger_1_1TempFile-members.html → classPassenger_1_1BufferedUpload-members.html} +5 -5
  40. data/doc/cxxapi/{classPassenger_1_1TempFile.html → classPassenger_1_1BufferedUpload.html} +33 -43
  41. data/doc/cxxapi/classPassenger_1_1BusyException-members.html +1 -1
  42. data/doc/cxxapi/classPassenger_1_1BusyException.html +1 -1
  43. data/doc/cxxapi/classPassenger_1_1ConfigurationException-members.html +1 -1
  44. data/doc/cxxapi/classPassenger_1_1ConfigurationException.html +1 -1
  45. data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +1 -1
  46. data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +1 -1
  47. data/doc/cxxapi/classPassenger_1_1DummySpawnManager-members.html +1 -1
  48. data/doc/cxxapi/classPassenger_1_1DummySpawnManager.html +1 -1
  49. data/doc/cxxapi/classPassenger_1_1FileChecker-members.html +1 -1
  50. data/doc/cxxapi/classPassenger_1_1FileChecker.html +2 -2
  51. data/doc/cxxapi/classPassenger_1_1FileNotFoundException-members.html +1 -1
  52. data/doc/cxxapi/classPassenger_1_1FileNotFoundException.html +1 -1
  53. data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.png +0 -0
  54. data/doc/cxxapi/classPassenger_1_1FileSystemException-members.html +1 -1
  55. data/doc/cxxapi/classPassenger_1_1FileSystemException.html +1 -1
  56. data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.png +0 -0
  57. data/doc/cxxapi/classPassenger_1_1IOException-members.html +1 -1
  58. data/doc/cxxapi/classPassenger_1_1IOException.html +1 -1
  59. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.png +0 -0
  60. data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +1 -1
  61. data/doc/cxxapi/classPassenger_1_1MessageChannel.html +1 -1
  62. data/doc/cxxapi/classPassenger_1_1RuntimeException-members.html +1 -1
  63. data/doc/cxxapi/classPassenger_1_1RuntimeException.html +1 -1
  64. data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +1 -1
  65. data/doc/cxxapi/classPassenger_1_1SpawnException.html +1 -1
  66. data/doc/cxxapi/classPassenger_1_1SpawnManager-members.html +1 -1
  67. data/doc/cxxapi/classPassenger_1_1SpawnManager.html +1 -1
  68. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool-members.html +1 -1
  69. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool.html +1 -1
  70. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.png +0 -0
  71. data/doc/cxxapi/classPassenger_1_1SystemException-members.html +1 -1
  72. data/doc/cxxapi/classPassenger_1_1SystemException.html +1 -1
  73. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.png +0 -0
  74. data/doc/cxxapi/classPassenger_1_1SystemTime-members.html +1 -1
  75. data/doc/cxxapi/classPassenger_1_1SystemTime.html +1 -1
  76. data/doc/cxxapi/definitions_8h-source.html +1 -1
  77. data/doc/cxxapi/files.html +1 -1
  78. data/doc/cxxapi/functions.html +12 -11
  79. data/doc/cxxapi/functions_func.html +9 -7
  80. data/doc/cxxapi/functions_type.html +1 -1
  81. data/doc/cxxapi/functions_vars.html +2 -4
  82. data/doc/cxxapi/graph_legend.html +1 -1
  83. data/doc/cxxapi/graph_legend.png +0 -0
  84. data/doc/cxxapi/group__Configuration.html +3 -3
  85. data/doc/cxxapi/group__Configuration.png +0 -0
  86. data/doc/cxxapi/group__Core.html +1 -1
  87. data/doc/cxxapi/group__Core.png +0 -0
  88. data/doc/cxxapi/group__Exceptions.html +1 -1
  89. data/doc/cxxapi/group__Hooks.html +1 -1
  90. data/doc/cxxapi/group__Hooks.png +0 -0
  91. data/doc/cxxapi/group__Support.html +33 -16
  92. data/doc/cxxapi/hierarchy.html +2 -2
  93. data/doc/cxxapi/inherit__graph__0.png +0 -0
  94. data/doc/cxxapi/inherit__graph__1.png +0 -0
  95. data/doc/cxxapi/inherit__graph__10.map +1 -1
  96. data/doc/cxxapi/inherit__graph__10.md5 +1 -1
  97. data/doc/cxxapi/inherit__graph__10.png +0 -0
  98. data/doc/cxxapi/inherit__graph__11.map +1 -1
  99. data/doc/cxxapi/inherit__graph__11.md5 +1 -1
  100. data/doc/cxxapi/inherit__graph__11.png +0 -0
  101. data/doc/cxxapi/inherit__graph__12.map +1 -2
  102. data/doc/cxxapi/inherit__graph__12.md5 +1 -1
  103. data/doc/cxxapi/inherit__graph__12.png +0 -0
  104. data/doc/cxxapi/inherit__graph__13.map +2 -1
  105. data/doc/cxxapi/inherit__graph__13.md5 +1 -1
  106. data/doc/cxxapi/inherit__graph__13.png +0 -0
  107. data/doc/cxxapi/inherit__graph__14.map +1 -1
  108. data/doc/cxxapi/inherit__graph__14.md5 +1 -1
  109. data/doc/cxxapi/inherit__graph__14.png +0 -0
  110. data/doc/cxxapi/inherit__graph__15.map +1 -1
  111. data/doc/cxxapi/inherit__graph__15.md5 +1 -1
  112. data/doc/cxxapi/inherit__graph__15.png +0 -0
  113. data/doc/cxxapi/inherit__graph__16.map +1 -1
  114. data/doc/cxxapi/inherit__graph__16.md5 +1 -1
  115. data/doc/cxxapi/inherit__graph__16.png +0 -0
  116. data/doc/cxxapi/inherit__graph__17.map +1 -1
  117. data/doc/cxxapi/inherit__graph__17.md5 +1 -1
  118. data/doc/cxxapi/inherit__graph__17.png +0 -0
  119. data/doc/cxxapi/inherit__graph__18.map +1 -1
  120. data/doc/cxxapi/inherit__graph__18.md5 +1 -1
  121. data/doc/cxxapi/inherit__graph__18.png +0 -0
  122. data/doc/cxxapi/inherit__graph__19.map +1 -2
  123. data/doc/cxxapi/inherit__graph__19.md5 +1 -1
  124. data/doc/cxxapi/inherit__graph__19.png +0 -0
  125. data/doc/cxxapi/inherit__graph__2.png +0 -0
  126. data/doc/cxxapi/inherit__graph__20.map +2 -1
  127. data/doc/cxxapi/inherit__graph__20.md5 +1 -1
  128. data/doc/cxxapi/inherit__graph__20.png +0 -0
  129. data/doc/cxxapi/inherit__graph__21.map +1 -1
  130. data/doc/cxxapi/inherit__graph__21.md5 +1 -1
  131. data/doc/cxxapi/inherit__graph__21.png +0 -0
  132. data/doc/cxxapi/inherit__graph__3.png +0 -0
  133. data/doc/cxxapi/inherit__graph__4.png +0 -0
  134. data/doc/cxxapi/inherit__graph__5.png +0 -0
  135. data/doc/cxxapi/inherit__graph__6.png +0 -0
  136. data/doc/cxxapi/inherit__graph__7.map +1 -1
  137. data/doc/cxxapi/inherit__graph__7.md5 +1 -1
  138. data/doc/cxxapi/inherit__graph__7.png +0 -0
  139. data/doc/cxxapi/inherit__graph__8.map +1 -1
  140. data/doc/cxxapi/inherit__graph__8.md5 +1 -1
  141. data/doc/cxxapi/inherit__graph__8.png +0 -0
  142. data/doc/cxxapi/inherit__graph__9.map +1 -1
  143. data/doc/cxxapi/inherit__graph__9.md5 +1 -1
  144. data/doc/cxxapi/inherit__graph__9.png +0 -0
  145. data/doc/cxxapi/inherits.html +18 -18
  146. data/doc/cxxapi/main.html +1 -1
  147. data/doc/cxxapi/modules.html +1 -1
  148. data/doc/cxxapi/structPassenger_1_1AnythingToString-members.html +1 -1
  149. data/doc/cxxapi/structPassenger_1_1AnythingToString.html +1 -1
  150. data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4-members.html +1 -1
  151. data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4.html +1 -1
  152. data/doc/cxxapi/structPassenger_1_1PoolOptions-members.html +1 -1
  153. data/doc/cxxapi/structPassenger_1_1PoolOptions.html +1 -1
  154. data/doc/cxxapi/tree.html +4 -4
  155. data/doc/rdoc/classes/ConditionVariable.html +58 -58
  156. data/doc/rdoc/classes/Exception.html +11 -11
  157. data/doc/rdoc/classes/GC.html +4 -4
  158. data/doc/rdoc/classes/IO.html +14 -14
  159. data/doc/rdoc/classes/PhusionPassenger.html +11 -11
  160. data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +1 -1
  161. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess.html +40 -39
  162. data/doc/rdoc/classes/PhusionPassenger/Application.html +14 -14
  163. data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +12 -12
  164. data/doc/rdoc/classes/PhusionPassenger/Railz.html +1 -1
  165. data/doc/rdoc/classes/PhusionPassenger/Utils.html +15 -8
  166. data/doc/rdoc/classes/PlatformInfo.html +257 -253
  167. data/doc/rdoc/classes/RakeExtensions.html +2 -2
  168. data/doc/rdoc/classes/Signal.html +26 -26
  169. data/doc/rdoc/created.rid +1 -1
  170. data/doc/rdoc/files/DEVELOPERS_TXT.html +1 -1
  171. data/doc/rdoc/files/README.html +1 -1
  172. data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +1 -1
  173. data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +1 -1
  174. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +1 -1
  175. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +1 -1
  176. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +1 -1
  177. data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +1 -1
  178. data/doc/rdoc/files/lib/phusion_passenger/application_rb.html +1 -1
  179. data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +1 -1
  180. data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +1 -1
  181. data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +1 -1
  182. data/doc/rdoc/files/lib/phusion_passenger/events_rb.html +1 -1
  183. data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +1 -1
  184. data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +1 -1
  185. data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +1 -1
  186. data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +1 -1
  187. data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +1 -1
  188. data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +1 -1
  189. data/doc/rdoc/files/lib/phusion_passenger/railz/application_spawner_rb.html +1 -1
  190. data/doc/rdoc/files/lib/phusion_passenger/railz/cgi_fixed_rb.html +1 -1
  191. data/doc/rdoc/files/lib/phusion_passenger/railz/framework_spawner_rb.html +1 -1
  192. data/doc/rdoc/files/lib/phusion_passenger/railz/request_handler_rb.html +1 -1
  193. data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +1 -1
  194. data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +1 -1
  195. data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +9 -9
  196. data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +1 -1
  197. data/doc/rdoc/files/{lib → misc}/rake/extensions_rb.html +2 -2
  198. data/doc/rdoc/fr_file_index.html +1 -1
  199. data/doc/rdoc/fr_method_index.html +22 -22
  200. data/ext/apache2/ApplicationPoolServer.h +43 -15
  201. data/ext/apache2/ApplicationPoolServerExecutable.cpp +27 -52
  202. data/ext/apache2/CachedFileStat.h +7 -16
  203. data/ext/apache2/Configuration.h +9 -1
  204. data/ext/apache2/FileChecker.h +4 -5
  205. data/ext/apache2/Hooks.cpp +20 -22
  206. data/ext/apache2/SpawnManager.h +6 -0
  207. data/ext/apache2/StandardApplicationPool.h +6 -0
  208. data/ext/apache2/Utils.cpp +174 -16
  209. data/ext/apache2/Utils.h +99 -38
  210. data/ext/boost/cstdint.hpp +2 -1
  211. data/ext/oxt/system_calls.cpp +20 -2
  212. data/ext/oxt/system_calls.hpp +2 -0
  213. data/lib/phusion_passenger/abstract_request_handler.rb +5 -1
  214. data/lib/phusion_passenger/admin_tools.rb +1 -1
  215. data/lib/phusion_passenger/admin_tools/control_process.rb +2 -1
  216. data/lib/phusion_passenger/dependencies.rb +7 -4
  217. data/lib/phusion_passenger/platform_info.rb +8 -2
  218. data/lib/phusion_passenger/rack/application_spawner.rb +1 -1
  219. data/lib/phusion_passenger/templates/version_not_found.html.erb +9 -0
  220. data/lib/phusion_passenger/utils.rb +13 -6
  221. data/lib/phusion_passenger/wsgi/application_spawner.rb +1 -1
  222. data/{lib → misc}/rake/cplusplus.rb +0 -0
  223. data/{lib → misc}/rake/extensions.rb +0 -0
  224. data/{lib → misc}/rake/gempackagetask.rb +0 -0
  225. data/{lib → misc}/rake/packagetask.rb +0 -0
  226. data/{lib → misc}/rake/rdoctask.rb +0 -0
  227. data/misc/render_error_pages.rb +6 -5
  228. data/test/CxxTestMain.cpp +109 -7
  229. data/test/UtilsTest.cpp +61 -51
  230. data/test/config.yml.example +6 -2
  231. data/test/integration_tests.rb +4 -0
  232. data/test/ruby/abstract_request_handler_spec.rb +9 -3
  233. data/test/ruby/rack/application_spawner_spec.rb +3 -2
  234. data/test/ruby/rails/application_spawner_spec.rb +15 -4
  235. data/test/ruby/rails/framework_spawner_spec.rb +4 -2
  236. data/test/ruby/rails/spawner_error_handling_spec.rb +4 -4
  237. data/test/ruby/spawn_manager_spec.rb +22 -9
  238. data/test/ruby/utils_spec.rb +18 -12
  239. data/test/ruby/wsgi/application_spawner_spec.rb +16 -7
  240. data/test/stub/apache2/httpd.conf.erb +1 -0
  241. data/test/stub/wsgi/passenger_wsgi.pyc +0 -0
  242. metadata +1064 -1090
  243. data/doc/Users guide Apache.html +0 -3127
  244. data/doc/Users guide Nginx.html +0 -1458
@@ -3,7 +3,7 @@
3
3
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4
4
  <head>
5
5
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
- <meta name="generator" content="AsciiDoc 8.3.4" />
6
+ <meta name="generator" content="AsciiDoc 8.4.2" />
7
7
  <title>Phusion Passenger users guide</title>
8
8
  <style type="text/css">
9
9
  /* Debug borders */
@@ -118,7 +118,6 @@ div#preamble {
118
118
  div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119
119
  div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120
120
  div.admonitionblock {
121
- margin-right: 10%;
122
121
  margin-top: 1.5em;
123
122
  margin-bottom: 1.5em;
124
123
  }
@@ -160,9 +159,6 @@ div.sidebarblock > div.content {
160
159
  padding: 0.5em;
161
160
  }
162
161
 
163
- div.listingblock {
164
- margin-right: 0%;
165
- }
166
162
  div.listingblock > div.content {
167
163
  border: 1px solid silver;
168
164
  background: #f4f4f4;
@@ -171,6 +167,7 @@ div.listingblock > div.content {
171
167
 
172
168
  div.quoteblock {
173
169
  padding-left: 2.0em;
170
+ margin-right: 10%;
174
171
  }
175
172
  div.quoteblock > div.attribution {
176
173
  padding-top: 0.5em;
@@ -179,6 +176,7 @@ div.quoteblock > div.attribution {
179
176
 
180
177
  div.verseblock {
181
178
  padding-left: 2.0em;
179
+ margin-right: 10%;
182
180
  }
183
181
  div.verseblock > div.content {
184
182
  white-space: pre;
@@ -341,47 +339,6 @@ div.toclevel4 {
341
339
  margin-left: 6em;
342
340
  font-size: 0.9em;
343
341
  }
344
- /* Workarounds for IE6's broken and incomplete CSS2. */
345
-
346
- div.sidebar-content {
347
- background: #ffffee;
348
- border: 1px solid silver;
349
- padding: 0.5em;
350
- }
351
- div.sidebar-title, div.image-title {
352
- color: #527bbd;
353
- font-family: sans-serif;
354
- font-weight: bold;
355
- margin-top: 0.0em;
356
- margin-bottom: 0.5em;
357
- }
358
-
359
- div.listingblock div.content {
360
- border: 1px solid silver;
361
- background: #f4f4f4;
362
- padding: 0.5em;
363
- }
364
-
365
- div.quoteblock-attribution {
366
- padding-top: 0.5em;
367
- text-align: right;
368
- }
369
-
370
- div.verseblock-content {
371
- white-space: pre;
372
- }
373
- div.verseblock-attribution {
374
- padding-top: 0.75em;
375
- text-align: left;
376
- }
377
-
378
- div.exampleblock-content {
379
- border-left: 2px solid silver;
380
- padding-left: 0.5em;
381
- }
382
-
383
- /* IE6 sets dynamically generated links as visited. */
384
- div#toc a:visited { color: blue; }
385
342
  </style>
386
343
  <script type="text/javascript">
387
344
  /*<![CDATA[*/
@@ -585,7 +542,7 @@ if it doesn&#8217;t.</p></div>
585
542
  </div>
586
543
  <h2 id="_installing_phusion_passenger">2. Installing Phusion Passenger</h2>
587
544
  <div class="sectionbody">
588
- <h3 id="_generic_installation_instructions">2.1. Generic installation instructions</h3><div style="clear:left"></div>
545
+ <h3 id="_generic_installation_instructions">2.1. Generic installation instructions</h3>
589
546
  <h4 id="install_passenger">2.1.1. Overview of download and installation methods</h4>
590
547
  <div class="paragraph"><p>There are two ways to install Phusion Passenger:</p></div>
591
548
  <div class="olist arabic"><ol class="arabic">
@@ -732,7 +689,7 @@ tar xzvf ~/YourDownloadsFolder/passenger-x.x.x.tar.gz</tt></pre>
732
689
  installation. Furthermore, the <em>passenger-x.x.x</em> folder must be accessible by Apache.</td>
733
690
  </tr></table>
734
691
  </div>
735
- <h3 id="_operating_system_specific_instructions_and_information">2.2. Operating system-specific instructions and information</h3><div style="clear:left"></div>
692
+ <h3 id="_operating_system_specific_instructions_and_information">2.2. Operating system-specific instructions and information</h3>
736
693
  <h4 id="_macos_x">2.2.1. MacOS X</h4>
737
694
  <div class="paragraph"><p>Ben Ruebenstein has written an excellent
738
695
  <a href="http://benr75.com/articles/2008/04/12/setup-mod_rails-phusion-mac-os-x-leopard">tutorial
@@ -757,7 +714,7 @@ are run, is &#8220;production&#8221;. You can change this by changing the
757
714
  <a href="#rails_env"><em>RailsEnv</em></a> configuration option.</td>
758
715
  </tr></table>
759
716
  </div>
760
- <h3 id="_deploying_to_a_virtual_host_8217_s_root">3.1. Deploying to a virtual host&#8217;s root</h3><div style="clear:left"></div>
717
+ <h3 id="_deploying_to_a_virtual_host_8217_s_root">3.1. Deploying to a virtual host&#8217;s root</h3>
761
718
  <div class="paragraph"><p>Add a virtual host entry to your Apache configuration file. The virtual host&#8217;s
762
719
  document root must point to your Ruby on Rails application&#8217;s <em>public</em> folder.
763
720
  For example:</p></div>
@@ -769,7 +726,7 @@ For example:</p></div>
769
726
  &lt;/VirtualHost&gt;</tt></pre>
770
727
  </div></div>
771
728
  <div class="paragraph"><p>Then restart Apache. The application has now been deployed.</p></div>
772
- <h3 id="deploying_rails_to_sub_uri">3.2. Deploying to a sub URI</h3><div style="clear:left"></div>
729
+ <h3 id="deploying_rails_to_sub_uri">3.2. Deploying to a sub URI</h3>
773
730
  <div class="paragraph"><p>Suppose that you already have a virtual host:</p></div>
774
731
  <div class="listingblock">
775
732
  <div class="content">
@@ -799,6 +756,18 @@ folder to a directory in the document root. For example:</p></div>
799
756
  <div class="admonitionblock">
800
757
  <table><tr>
801
758
  <td class="icon">
759
+ <img src="./images/icons/note.png" alt="Note" />
760
+ </td>
761
+ <td class="content">If you&#8217;re deploying to a sub-URI then please make sure that your view
762
+ templates correctly handles references to sub-URI static assets! Otherwise
763
+ you may find broken links to images, CSS files, JavaScripts, etc. Please read
764
+ <a href="#sub_uri_deployment_uri_fix">How to fix broken images/CSS/JavaScript URIs in sub-URI deployments</a>
765
+ for more information.</td>
766
+ </tr></table>
767
+ </div>
768
+ <div class="admonitionblock">
769
+ <table><tr>
770
+ <td class="icon">
802
771
  <img src="./images/icons/tip.png" alt="Tip" />
803
772
  </td>
804
773
  <td class="content">
@@ -816,7 +785,7 @@ folder to a directory in the document root. For example:</p></div>
816
785
  </td>
817
786
  </tr></table>
818
787
  </div>
819
- <h3 id="_redeploying_restarting_the_ruby_on_rails_application">3.3. Redeploying (restarting the Ruby on Rails application)</h3><div style="clear:left"></div>
788
+ <h3 id="_redeploying_restarting_the_ruby_on_rails_application">3.3. Redeploying (restarting the Ruby on Rails application)</h3>
820
789
  <div class="paragraph"><p>Deploying a new version of a Ruby on Rails application is as simple as
821
790
  re-uploading the application files, and restarting the application.</p></div>
822
791
  <div class="paragraph"><p>There are two ways to restart the application:</p></div>
@@ -840,12 +809,12 @@ command line:</p></div>
840
809
  <div class="content">
841
810
  <pre><tt>touch /webapps/mycook/tmp/restart.txt</tt></pre>
842
811
  </div></div>
843
- <h3 id="_migrations">3.4. Migrations</h3><div style="clear:left"></div>
812
+ <h3 id="_migrations">3.4. Migrations</h3>
844
813
  <div class="paragraph"><p>Phusion Passenger is not related to Ruby on Rails migrations in any way. To
845
814
  run migrations on your deployment server, please login to your deployment
846
815
  server (e.g. with <em>ssh</em>) and type <tt>rake db:migrate RAILS_ENV=production</tt> in
847
816
  a shell console, just like one would normally run migrations.</p></div>
848
- <h3 id="_capistrano_integration">3.5. Capistrano integration</h3><div style="clear:left"></div>
817
+ <h3 id="_capistrano_integration">3.5. Capistrano integration</h3>
849
818
  <div class="paragraph"><p>See <a href="#capistrano">Capistrano recipe</a>.</p></div>
850
819
  </div>
851
820
  <h2 id="_deploying_a_rack_based_ruby_application">4. Deploying a Rack-based Ruby application</h2>
@@ -899,7 +868,7 @@ are run, is &#8220;production&#8221;. You can change this by changing the
899
868
  <a href="#rack_env"><em>RackEnv</em></a> configuration option.</td>
900
869
  </tr></table>
901
870
  </div>
902
- <h3 id="_tutorial_example_writing_and_deploying_a_hello_world_rack_application">4.1. Tutorial/example: writing and deploying a Hello World Rack application</h3><div style="clear:left"></div>
871
+ <h3 id="_tutorial_example_writing_and_deploying_a_hello_world_rack_application">4.1. Tutorial/example: writing and deploying a Hello World Rack application</h3>
903
872
  <div class="paragraph"><p>First we create a Phusion Passenger-compliant Rack directory structure:</p></div>
904
873
  <div class="listingblock">
905
874
  <div class="content">
@@ -930,7 +899,7 @@ the Apache configuration file:</p></div>
930
899
  </div></div>
931
900
  <div class="paragraph"><p>And we&#8217;re done! After an Apache restart, the above Rack application will be available
932
901
  under the URL <em>http://www.rackexample.com/</em>.</p></div>
933
- <h3 id="_deploying_to_a_virtual_host_8217_s_root_2">4.2. Deploying to a virtual host&#8217;s root</h3><div style="clear:left"></div>
902
+ <h3 id="_deploying_to_a_virtual_host_8217_s_root_2">4.2. Deploying to a virtual host&#8217;s root</h3>
934
903
  <div class="paragraph"><p>Add a virtual host entry to your Apache configuration file. The virtual host&#8217;s
935
904
  document root must point to your Rack application&#8217;s <em>public</em> folder.
936
905
  For example:</p></div>
@@ -942,7 +911,7 @@ For example:</p></div>
942
911
  &lt;/VirtualHost&gt;</tt></pre>
943
912
  </div></div>
944
913
  <div class="paragraph"><p>Then restart Apache. The application has now been deployed.</p></div>
945
- <h3 id="deploying_rack_to_sub_uri">4.3. Deploying to a sub URI</h3><div style="clear:left"></div>
914
+ <h3 id="deploying_rack_to_sub_uri">4.3. Deploying to a sub URI</h3>
946
915
  <div class="paragraph"><p>Suppose that you already have a virtual host:</p></div>
947
916
  <div class="listingblock">
948
917
  <div class="content">
@@ -989,7 +958,7 @@ folder to a directory in the document root. For example:</p></div>
989
958
  </td>
990
959
  </tr></table>
991
960
  </div>
992
- <h3 id="_redeploying_restarting_the_rack_application">4.4. Redeploying (restarting the Rack application)</h3><div style="clear:left"></div>
961
+ <h3 id="_redeploying_restarting_the_rack_application">4.4. Redeploying (restarting the Rack application)</h3>
993
962
  <div class="paragraph"><p>Deploying a new version of a Rack application is as simple as
994
963
  re-uploading the application files, and restarting the application.</p></div>
995
964
  <div class="paragraph"><p>There are two ways to restart the application:</p></div>
@@ -1013,7 +982,7 @@ command line:</p></div>
1013
982
  <div class="content">
1014
983
  <pre><tt>touch /webapps/rackapp/tmp/restart.txt</tt></pre>
1015
984
  </div></div>
1016
- <h3 id="_rackup_specifications_for_various_web_frameworks">4.5. Rackup specifications for various web frameworks</h3><div style="clear:left"></div>
985
+ <h3 id="_rackup_specifications_for_various_web_frameworks">4.5. Rackup specifications for various web frameworks</h3>
1017
986
  <div class="paragraph"><p>This subsection shows example <em>config.ru</em> files for various web frameworks.</p></div>
1018
987
  <h4 id="_camping">4.5.1. Camping</h4>
1019
988
  <div class="listingblock">
@@ -1095,12 +1064,12 @@ run Sinatra::Application</tt></pre>
1095
1064
  Nevertheless, the system administrator may be interested in changing
1096
1065
  Phusion Passenger&#8217;s behavior. Phusion Passenger&#8217;s Apache module supports the
1097
1066
  following configuration options:</p></div>
1098
- <h3 id="_passengerroot_lt_directory_gt">5.1. PassengerRoot &lt;directory&gt;</h3><div style="clear:left"></div>
1067
+ <h3 id="_passengerroot_lt_directory_gt">5.1. PassengerRoot &lt;directory&gt;</h3>
1099
1068
  <div class="paragraph"><p>The location to the Phusion Passenger root directory. This configuration option
1100
1069
  is essential to Phusion Passenger. The correct value is given by the installer,
1101
1070
  and should usually not be changed manually.</p></div>
1102
1071
  <div class="paragraph"><p>This required option may only occur once, in the global server configuration.</p></div>
1103
- <h3 id="_passengerloglevel_lt_integer_gt">5.2. PassengerLogLevel &lt;integer&gt;</h3><div style="clear:left"></div>
1072
+ <h3 id="_passengerloglevel_lt_integer_gt">5.2. PassengerLogLevel &lt;integer&gt;</h3>
1104
1073
  <div class="paragraph"><p>This option allows one to specify how much information Phusion Passenger should
1105
1074
  write to the Apache error log file. A higher log level value means that more
1106
1075
  information will be logged.</p></div>
@@ -1131,11 +1100,11 @@ information will be logged.</p></div>
1131
1100
  </ul></div>
1132
1101
  <div class="paragraph"><p>This option may only occur once, in the global server configuration.
1133
1102
  The default is <em>0</em>.</p></div>
1134
- <h3 id="PassengerRuby">5.3. PassengerRuby &lt;filename&gt;</h3><div style="clear:left"></div>
1103
+ <h3 id="PassengerRuby">5.3. PassengerRuby &lt;filename&gt;</h3>
1135
1104
  <div class="paragraph"><p>This option allows one to specify the Ruby interpreter to use.</p></div>
1136
1105
  <div class="paragraph"><p>This option may only occur once, in the global server configuration.
1137
1106
  The default is <em>ruby</em>.</p></div>
1138
- <h3 id="PassengerAppRoot">5.4. PassengerAppRoot &lt;path/to/root&gt;</h3><div style="clear:left"></div>
1107
+ <h3 id="PassengerAppRoot">5.4. PassengerAppRoot &lt;path/to/root&gt;</h3>
1139
1108
  <div class="paragraph"><p>By default, Phusion Passenger assumes that the application&#8217;s root directory
1140
1109
  is the parent directory of the <em>public</em> directory. This option allows one to
1141
1110
  specify the application&#8217;s root independently from the DocumentRoot, which
@@ -1174,7 +1143,7 @@ In <em>.htaccess</em>, if <tt>AllowOverride Options</tt> is on.
1174
1143
  # root is "/var/rails/zena/sites/example.com"
1175
1144
  &lt;/VirtualHost&gt;</tt></pre>
1176
1145
  </div></div>
1177
- <h3 id="PassengerUseGlobalQueue">5.5. PassengerUseGlobalQueue &lt;on|off&gt;</h3><div style="clear:left"></div>
1146
+ <h3 id="PassengerUseGlobalQueue">5.5. PassengerUseGlobalQueue &lt;on|off&gt;</h3>
1178
1147
  <div class="paragraph"><p>Turns the use of global queuing on or off.</p></div>
1179
1148
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
1180
1149
  <div class="ulist"><ul>
@@ -1263,17 +1232,17 @@ process that becomes available will take from the queue, and so this
1263
1232
  <div class="paragraph"><p>Turning global queuing off will yield a minor performance improvement (about 5%,
1264
1233
  depending on how fast/slow your web application is), which is why it&#8217;s off by
1265
1234
  default.</p></div>
1266
- <h3 id="PassengerUserSwitching">5.6. PassengerUserSwitching &lt;on|off&gt;</h3><div style="clear:left"></div>
1235
+ <h3 id="PassengerUserSwitching">5.6. PassengerUserSwitching &lt;on|off&gt;</h3>
1267
1236
  <div class="paragraph"><p>Whether to enable <a href="#user_switching">user switching support</a>.</p></div>
1268
1237
  <div class="paragraph"><p>This option may only occur once, in the global server configuration.
1269
1238
  The default value is <em>on</em>.</p></div>
1270
- <h3 id="PassengerDefaultUser">5.7. PassengerDefaultUser &lt;username&gt;</h3><div style="clear:left"></div>
1239
+ <h3 id="PassengerDefaultUser">5.7. PassengerDefaultUser &lt;username&gt;</h3>
1271
1240
  <div class="paragraph"><p>Passenger enables <a href="#user_switching">user switching support</a> by default.
1272
1241
  This configuration option allows one to specify which user Rails/Rack
1273
1242
  applications must run as, if user switching fails or is disabled.</p></div>
1274
1243
  <div class="paragraph"><p>This option may only occur once, in the global server configuration.
1275
1244
  The default value is <em>nobody</em>.</p></div>
1276
- <h3 id="PassengerHighPerformance">5.8. PassengerHighPerformance &lt;on|off&gt;</h3><div style="clear:left"></div>
1245
+ <h3 id="PassengerHighPerformance">5.8. PassengerHighPerformance &lt;on|off&gt;</h3>
1277
1246
  <div class="paragraph"><p>By default, Phusion Passenger is compatible with mod_rewrite and most other
1278
1247
  Apache modules. However, a lot of effort is required in order to be compatible.
1279
1248
  If you turn <em>PassengerHighPerformance</em> to <em>on</em>, then Phusion Passenger will be
@@ -1349,7 +1318,7 @@ then you can enable high performance mode for a certain URL only. For example:</
1349
1318
  </div></div>
1350
1319
  <div class="paragraph"><p>This enables high performance mode for
1351
1320
  <a href="http://www.foo.com/chatroom/ajax_update_poll">http://www.foo.com/chatroom/ajax_update_poll</a> only.</p></div>
1352
- <h3 id="_passengerenabled_lt_on_off_gt">5.9. PassengerEnabled &lt;on|off&gt;</h3><div style="clear:left"></div>
1321
+ <h3 id="_passengerenabled_lt_on_off_gt">5.9. PassengerEnabled &lt;on|off&gt;</h3>
1353
1322
  <div class="paragraph"><p>You can set this option to <em>off</em> to completely disable Phusion Passenger for
1354
1323
  a certain location. This is useful if, for example, you want to integrate a PHP
1355
1324
  application into the same virtual host as a Rails application.</p></div>
@@ -1393,7 +1362,7 @@ In <em>.htaccess</em>.
1393
1362
  </li>
1394
1363
  </ul></div>
1395
1364
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>on</em>.</p></div>
1396
- <h3 id="_passengertempdir_lt_directory_gt">5.10. PassengerTempDir &lt;directory&gt;</h3><div style="clear:left"></div>
1365
+ <h3 id="_passengertempdir_lt_directory_gt">5.10. PassengerTempDir &lt;directory&gt;</h3>
1397
1366
  <div class="paragraph"><p>Specifies the directory that Phusion Passenger should use for storing temporary
1398
1367
  files. This includes things such as Unix socket files, buffered file uploads,
1399
1368
  etc.</p></div>
@@ -1416,7 +1385,7 @@ environment variable, like this:</p></div>
1416
1385
  sudo -E passenger-status
1417
1386
  # The -E option tells 'sudo' to preserve environment variables.</tt></pre>
1418
1387
  </div></div>
1419
- <h3 id="_passengerrestartdir_lt_directory_gt">5.11. PassengerRestartDir &lt;directory&gt;</h3><div style="clear:left"></div>
1388
+ <h3 id="_passengerrestartdir_lt_directory_gt">5.11. PassengerRestartDir &lt;directory&gt;</h3>
1420
1389
  <div class="paragraph"><p>As described in the deployment chapters of this document, Phusion Passenger
1421
1390
  checks the file <em>tmp/restart.txt</em> in the applications'
1422
1391
  <a href="#application_root">root directory</a> for restarting applications. Sometimes it
@@ -1484,7 +1453,7 @@ security flaw which allows an attacker to touch restart.txt, then that will
1484
1453
  allow the attacker to cause a Denial-of-Service.</p></div>
1485
1454
  <div class="paragraph"><p>You can prevent this from happening by pointing PassengerRestartDir to a
1486
1455
  directory that&#8217;s readable by Apache, but only writable by administrators.</p></div>
1487
- <h3 id="_resource_control_and_optimization_options">5.12. Resource control and optimization options</h3><div style="clear:left"></div>
1456
+ <h3 id="_resource_control_and_optimization_options">5.12. Resource control and optimization options</h3>
1488
1457
  <h4 id="_passengermaxpoolsize_lt_integer_gt">5.12.1. PassengerMaxPoolSize &lt;integer&gt;</h4>
1489
1458
  <div class="paragraph"><p>The maximum number of Ruby on Rails or Rack application instances that may
1490
1459
  be simultaneously active. A larger number results in higher memory usage,
@@ -1636,7 +1605,7 @@ In <em>.htaccess</em>, if <tt>AllowOverride Limits</tt> is on.
1636
1605
  </li>
1637
1606
  </ul></div>
1638
1607
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>0</em>.</p></div>
1639
- <h3 id="_ruby_on_rails_specific_options">5.13. Ruby on Rails-specific options</h3><div style="clear:left"></div>
1608
+ <h3 id="_ruby_on_rails_specific_options">5.13. Ruby on Rails-specific options</h3>
1640
1609
  <h4 id="_railsautodetect_lt_on_off_gt">5.13.1. RailsAutoDetect &lt;on|off&gt;</h4>
1641
1610
  <div class="paragraph"><p>Whether Phusion Passenger should automatically detect whether a virtual host&#8217;s
1642
1611
  document root is a Ruby on Rails application. The default is <em>on</em>.</p></div>
@@ -1730,7 +1699,7 @@ In <em>.htaccess</em>, if <tt>AllowOverride Options</tt> is on.
1730
1699
  <div class="paragraph"><p>This subsection attempts to describe spawn methods, but it&#8217;s okay if you don&#8217;t (want to)
1731
1700
  understand it, as it&#8217;s mostly a technical detail. You can basically follow this rule of thumb:</p></div>
1732
1701
  <div class="sidebarblock">
1733
- <div class="sidebar-content">
1702
+ <div class="content">
1734
1703
  <div class="paragraph"><p>If your application works on Mongrel, but not on Phusion Passenger, then set
1735
1704
  <tt>RailsSpawnMethod</tt> to <em>conservative</em>. Otherwise, leave it at <em>smart-lv2</em> (the default).</p></div>
1736
1705
  </div></div>
@@ -1842,7 +1811,7 @@ system has enough memory, is it recommended that you set this option to a high
1842
1811
  value or to <em>0</em>.</p></div>
1843
1812
  <div class="paragraph"><p>This option may only occur in the global server configuration, and may occur at
1844
1813
  most once. The default value is <em>600</em> (10 minutes).</p></div>
1845
- <h3 id="_rack_specific_options">5.14. Rack-specific options</h3><div style="clear:left"></div>
1814
+ <h3 id="_rack_specific_options">5.14. Rack-specific options</h3>
1846
1815
  <h4 id="_rackautodetect_lt_on_off_gt">5.14.1. RackAutoDetect &lt;on|off&gt;</h4>
1847
1816
  <div class="paragraph"><p>Whether Phusion Passenger should automatically detect whether a virtual host&#8217;s
1848
1817
  document root is a Rack application. The default is <em>on</em>.</p></div>
@@ -1927,7 +1896,7 @@ In <em>.htaccess</em>, if <tt>AllowOverride Options</tt> is on.
1927
1896
  </li>
1928
1897
  </ul></div>
1929
1898
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>production</em>.</p></div>
1930
- <h3 id="_deprecated_options">5.15. Deprecated options</h3><div style="clear:left"></div>
1899
+ <h3 id="_deprecated_options">5.15. Deprecated options</h3>
1931
1900
  <div class="paragraph"><p>The following options have been deprecated, but are still supported for backwards
1932
1901
  compatibility reasons.</p></div>
1933
1902
  <h4 id="_railsruby">5.15.1. RailsRuby</h4>
@@ -1941,11 +1910,11 @@ compatibility reasons.</p></div>
1941
1910
  </div>
1942
1911
  <h2 id="_troubleshooting">6. Troubleshooting</h2>
1943
1912
  <div class="sectionbody">
1944
- <h3 id="_operating_system_specific_problems">6.1. Operating system-specific problems</h3><div style="clear:left"></div>
1913
+ <h3 id="_operating_system_specific_problems">6.1. Operating system-specific problems</h3>
1945
1914
  <h4 id="_macos_x_the_installer_cannot_locate_mamp_8217_s_apache">6.1.1. MacOS X: The installer cannot locate MAMP&#8217;s Apache</h4>
1946
1915
  <div class="sidebarblock">
1947
- <div class="sidebar-content">
1948
- <div class="sidebar-title">Symptoms</div>
1916
+ <div class="content">
1917
+ <div class="title">Symptoms</div>
1949
1918
  <div class="paragraph"><p>The installer finds Apache 2 development headers at <tt>/Applications/MAMP/Library/bin/apxs</tt>.
1950
1919
  However, Apache cannot be found. The installer also outputs the following error:</p></div>
1951
1920
  <div class="listingblock">
@@ -1958,11 +1927,11 @@ No such file or directory at /Applications/MAMP/Library/bin/apxs line 218.</tt><
1958
1927
  Please read <a href="http://forum.mamp.info/viewtopic.php?t=1866">this forum topic</a> to learn how
1959
1928
  to fix this problem.</p></div>
1960
1929
  <div class="paragraph"><p>See also <a href="http://code.google.com/p/phusion-passenger/issues/detail?id=12">this bug report</a>.</p></div>
1961
- <h3 id="_problems_during_installation">6.2. Problems during installation</h3><div style="clear:left"></div>
1930
+ <h3 id="_problems_during_installation">6.2. Problems during installation</h3>
1962
1931
  <h4 id="installing_ruby_dev">6.2.1. Ruby development headers aren&#8217;t installed</h4>
1963
1932
  <div class="sidebarblock">
1964
- <div class="sidebar-content">
1965
- <div class="sidebar-title">Symptoms</div>
1933
+ <div class="content">
1934
+ <div class="title">Symptoms</div>
1966
1935
  <div class="paragraph"><p>Installing Phusion Passenger fails because of one of the following errors:</p></div>
1967
1936
  <div class="ulist"><ul>
1968
1937
  <li>
@@ -2054,8 +2023,8 @@ which Ruby installation you want to use. Please read
2054
2023
  </div>
2055
2024
  <h4 id="_apache_development_headers_aren_8217_t_installed">6.2.2. Apache development headers aren&#8217;t installed</h4>
2056
2025
  <div class="sidebarblock">
2057
- <div class="sidebar-content">
2058
- <div class="sidebar-title">Symptoms</div>
2026
+ <div class="content">
2027
+ <div class="title">Symptoms</div>
2059
2028
  <div class="paragraph"><p>Installing Phusion Passenger fails because of one of the following errors:</p></div>
2060
2029
  <div class="ulist"><ul>
2061
2030
  <li>
@@ -2139,8 +2108,8 @@ Other operating systems
2139
2108
  </dl></div>
2140
2109
  <h4 id="_apr_development_headers_aren_8217_t_installed">6.2.3. APR development headers aren&#8217;t installed</h4>
2141
2110
  <div class="sidebarblock">
2142
- <div class="sidebar-content">
2143
- <div class="sidebar-title">Symptoms</div>
2111
+ <div class="content">
2112
+ <div class="title">Symptoms</div>
2144
2113
  <div class="paragraph"><p>Installing Phusion Passenger fails because one of the following errors:</p></div>
2145
2114
  <div class="ulist"><ul>
2146
2115
  <li>
@@ -2221,7 +2190,7 @@ Other operating systems
2221
2190
  <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>
2222
2191
  <h4 id="_phusion_passenger_is_using_the_wrong_ruby_during_installation">6.2.5. Phusion Passenger is using the wrong Ruby during installation</h4>
2223
2192
  <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>
2224
- <h3 id="_problems_after_installation">6.3. Problems after installation</h3><div style="clear:left"></div>
2193
+ <h3 id="_problems_after_installation">6.3. Problems after installation</h3>
2225
2194
  <div class="admonitionblock">
2226
2195
  <table><tr>
2227
2196
  <td class="icon">
@@ -2239,8 +2208,8 @@ inside the Apache error logs. It will tell you what exactly went wrong.</p></div
2239
2208
  <div class="paragraph"><p>Please try setting <a href="#RailsSpawnMethod">RailsSpawnMethod</a> to <em>conservative</em>.</p></div>
2240
2209
  <h4 id="_phusion_passenger_has_been_compiled_against_the_wrong_apache_installation">6.3.2. Phusion Passenger has been compiled against the wrong Apache installation</h4>
2241
2210
  <div class="sidebarblock">
2242
- <div class="sidebar-content">
2243
- <div class="sidebar-title">Symptoms</div>
2211
+ <div class="content">
2212
+ <div class="title">Symptoms</div>
2244
2213
  <div class="paragraph"><p>Apache crashes during startup (after being daemonized). The Apache error log
2245
2214
  says &#8220;<em>seg fault or similar nasty error detected in the parent process&#8221;</em>.</p></div>
2246
2215
  </div></div>
@@ -2352,7 +2321,7 @@ following command to give your Rails application folder that context:</p></div>
2352
2321
  <div class="content">
2353
2322
  <pre><tt>chcon -R -h -t httpd_sys_content_t /path/to/your/rails/app</tt></pre>
2354
2323
  </div></div>
2355
- <h3 id="conflicting_apache_modules">6.4. Conflicting Apache modules</h3><div style="clear:left"></div>
2324
+ <h3 id="conflicting_apache_modules">6.4. Conflicting Apache modules</h3>
2356
2325
  <h4 id="_mod_userdir">6.4.1. mod_userdir</h4>
2357
2326
  <div class="paragraph"><p><em>mod_userdir</em> is not compatible with Phusion Passenger at the moment.</p></div>
2358
2327
  <h4 id="_virtualdocumentroot">6.4.2. VirtualDocumentRoot</h4>
@@ -2362,7 +2331,7 @@ following command to give your Rails application folder that context:</p></div>
2362
2331
  <div class="sectionbody">
2363
2332
  <div class="paragraph"><p>Phusion Passenger provides a set of tools, which are useful for system analysis,
2364
2333
  maintenance and troubleshooting.</p></div>
2365
- <h3 id="_inspecting_memory_usage">7.1. Inspecting memory usage</h3><div style="clear:left"></div>
2334
+ <h3 id="_inspecting_memory_usage">7.1. Inspecting memory usage</h3>
2366
2335
  <div class="paragraph"><p>Process inspection tools such as <tt>ps</tt> and <tt>top</tt> are useful, but they
2367
2336
  <a href="http://groups.google.com/group/phusion-passenger/msg/1fd1c233456d3180">rarely show the correct memory usage</a>.
2368
2337
  The real memory usage is usually lower than what <tt>ps</tt> and <tt>top</tt> report.</p></div>
@@ -2411,7 +2380,7 @@ This is a lot less than the 50 MB-ish memory usage as shown in the <em>VMSize</e
2411
2380
  provide facilities for determining processes' private dirty RSS.</td>
2412
2381
  </tr></table>
2413
2382
  </div>
2414
- <h3 id="_inspecting_phusion_passenger_8217_s_internal_status">7.2. Inspecting Phusion Passenger&#8217;s internal status</h3><div style="clear:left"></div>
2383
+ <h3 id="_inspecting_phusion_passenger_8217_s_internal_status">7.2. Inspecting Phusion Passenger&#8217;s internal status</h3>
2415
2384
  <div class="paragraph"><p>One can inspect Phusion Passenger&#8217;s internal status with the tool <tt>passenger-status</tt>.
2416
2385
  This tool must typically be run as root. For example:</p></div>
2417
2386
  <div class="listingblock">
@@ -2537,7 +2506,7 @@ Your application is frozen, i.e. has stopped responding. See
2537
2506
  </p>
2538
2507
  </li>
2539
2508
  </ol></div>
2540
- <h3 id="debugging_frozen">7.3. Debugging frozen applications</h3><div style="clear:left"></div>
2509
+ <h3 id="debugging_frozen">7.3. Debugging frozen applications</h3>
2541
2510
  <div class="paragraph"><p>If one of your application instances is frozen (stopped responding), then you
2542
2511
  can figure out where it is frozen by killing it with <em>SIGABRT</em>. This will cause the
2543
2512
  application to raise an exception, with a backtrace.</p></div>
@@ -2560,7 +2529,7 @@ will restart killed application instances, as if nothing bad happened.</td>
2560
2529
  </div>
2561
2530
  <h2 id="_tips">8. Tips</h2>
2562
2531
  <div class="sectionbody">
2563
- <h3 id="user_switching">8.1. User switching (security)</h3><div style="clear:left"></div>
2532
+ <h3 id="user_switching">8.1. User switching (security)</h3>
2564
2533
  <div class="paragraph"><p>There is a problem that plagues most PHP web hosts, namely the fact that all PHP
2565
2534
  applications are run in the same user context as the web server. So for
2566
2535
  example, Joe&#8217;s PHP application will be able to read Jane&#8217;s PHP application&#8217;s
@@ -2598,12 +2567,12 @@ Under no circumstances will applications be run as <em>root</em>. If
2598
2567
  </ul></div>
2599
2568
  <div class="paragraph"><p>User switching can be disabled with the
2600
2569
  <a href="#PassengerUserSwitching">PassengerUserSwitching</a> option.</p></div>
2601
- <h3 id="reducing_memory_usage">8.2. Reducing memory consumption of Ruby on Rails applications by 33%</h3><div style="clear:left"></div>
2570
+ <h3 id="reducing_memory_usage">8.2. Reducing memory consumption of Ruby on Rails applications by 33%</h3>
2602
2571
  <div class="paragraph"><p>Is it possible to reduce memory consumption of your Rails applications by 33% on average,
2603
2572
  by using <a href="http://www.rubyenterpriseedition.com/">Ruby Enterprise Edition</a>.
2604
2573
  Please visit the website for details.</p></div>
2605
2574
  <div class="paragraph"><p>Note that this feature does not apply to Rack applications.</p></div>
2606
- <h3 id="capistrano">8.3. Capistrano recipe</h3><div style="clear:left"></div>
2575
+ <h3 id="capistrano">8.3. Capistrano recipe</h3>
2607
2576
  <div class="paragraph"><p>Phusion Passenger can be combined with <a href="http://capify.org/">Capistrano</a>.
2608
2577
  The following Capistrano recipe demonstrates Phusion Passenger support.
2609
2578
  It assumes that you&#8217;re using Git as version control system.</p></div>
@@ -2659,7 +2628,7 @@ command is as follows:</p></div>
2659
2628
  </div></div>
2660
2629
  <div class="paragraph"><p>Killing the spawn server is completely safe, because Phusion Passenger will restart the
2661
2630
  spawn server if it has been terminated.</p></div>
2662
- <h3 id="_moving_phusion_passenger_to_a_different_directory">8.4. Moving Phusion Passenger to a different directory</h3><div style="clear:left"></div>
2631
+ <h3 id="_moving_phusion_passenger_to_a_different_directory">8.4. Moving Phusion Passenger to a different directory</h3>
2663
2632
  <div class="paragraph"><p>It is possible to relocate the Phusion Passenger files to a different directory. It
2664
2633
  involves two steps:</p></div>
2665
2634
  <div class="olist arabic"><ol class="arabic">
@@ -2696,7 +2665,7 @@ Edit your Apache configuration file, and set:
2696
2665
  </div></div>
2697
2666
  </li>
2698
2667
  </ol></div>
2699
- <h3 id="_installing_multiple_ruby_on_rails_versions">8.5. Installing multiple Ruby on Rails versions</h3><div style="clear:left"></div>
2668
+ <h3 id="_installing_multiple_ruby_on_rails_versions">8.5. Installing multiple Ruby on Rails versions</h3>
2700
2669
  <div class="paragraph"><p>Each Ruby on Rails applications that are going to be deployed may require a
2701
2670
  specific Ruby on Rails version. You can install a specific version with
2702
2671
  this command:</p></div>
@@ -2707,14 +2676,14 @@ this command:</p></div>
2707
2676
  <div class="paragraph"><p>where <em>X.X.X</em> is the version number of Ruby on Rails.</p></div>
2708
2677
  <div class="paragraph"><p>All of these versions will exist in parallel, and will not conflict with each
2709
2678
  other. Phusion Passenger will automatically make use of the correct version.</p></div>
2710
- <h3 id="_x_sendfile_support">8.6. X-Sendfile support</h3><div style="clear:left"></div>
2679
+ <h3 id="_x_sendfile_support">8.6. X-Sendfile support</h3>
2711
2680
  <div class="paragraph"><p>Phusion Passenger does not provide X-Sendfile support by itself. Please install
2712
2681
  <a href="http://tn123.ath.cx/mod_xsendfile/">mod_xsendfile</a> for X-Sendfile support.</p></div>
2713
- <h3 id="_upload_progress">8.7. Upload progress</h3><div style="clear:left"></div>
2682
+ <h3 id="_upload_progress">8.7. Upload progress</h3>
2714
2683
  <div class="paragraph"><p>Phusion Passenger does not provide upload progress support by itself. Please
2715
2684
  try drogus&#8217;s <a href="http://github.com/drogus/apache-upload-progress-module/tree/master">
2716
2685
  Apache upload progress module</a> instead.</p></div>
2717
- <h3 id="_making_the_application_restart_after_each_request">8.8. Making the application restart after each request</h3><div style="clear:left"></div>
2686
+ <h3 id="_making_the_application_restart_after_each_request">8.8. Making the application restart after each request</h3>
2718
2687
  <div class="paragraph"><p>In some situations it might be desirable to restart the web application after
2719
2688
  each request, for example when developing a non-Rails application that doesn&#8217;t
2720
2689
  support code reloading, or when developing a web framework.</p></div>
@@ -2735,6 +2704,41 @@ or when you&#8217;re not developing a Rails application and your web framework
2735
2704
  does not support code reloading.</td>
2736
2705
  </tr></table>
2737
2706
  </div>
2707
+ <h3 id="sub_uri_deployment_uri_fix">8.9. How to fix broken images/CSS/JavaScript URIs in sub-URI deployments</h3>
2708
+ <div class="paragraph"><p>Some people experience broken images and other broken static assets when they
2709
+ deploy their application to a sub-URI (i.e. <em>http://mysite.com/railsapp/</em>).
2710
+ The reason for this usually is that you used a
2711
+ static URI for your image in the views. This means your <em>img</em> source probably refers
2712
+ to something like <em>/images/foo.jpg</em>. The leading slash means that it&#8217;s an absolute URI:
2713
+ you&#8217;re telling the browser to always load <em>http://mysite.com/images/foo.jpg</em> no
2714
+ matter what. The problem is that the image is actually at
2715
+ <em>http://mysite.com/railsapp/images/foo.jpg</em>. There are two ways to fix this.</p></div>
2716
+ <div class="paragraph"><p>The first way (not recommended) is to change your view templates to refer to
2717
+ <em>images/foo.jpg</em>. This is a relative URI: note the lack of a leading slash). What
2718
+ this does is making the path relative to the current URI. The problem is that if you
2719
+ use restful URIs, then your images will probably break again when you add a level to
2720
+ the URI.
2721
+ For example, when you&#8217;re at <em>http://mysite.com/railsapp</em> the browser will look for
2722
+ <em>http://mysite.com/railsapp/images/foo.jpg</em>. But when you&#8217;re at
2723
+ <em>http://mysite.com/railsapp/controller</em>. the browser will look for
2724
+ <em>http://mysite.com/railsapp/controller/images/foo.jpg</em>.
2725
+ So relative URIs usually don&#8217;t work well with layout templates.</p></div>
2726
+ <div class="paragraph"><p>The second and highly recommended way is to always use Rails helper methods to
2727
+ output tags for static assets. These helper methods automatically take care
2728
+ of prepending the base URI that you&#8217;ve deployed the application to. For images
2729
+ there is <tt>image_tag</tt>, for JavaScript there is <tt>javascript_include_tag</tt> and for
2730
+ CSS there is <tt>stylesheet_link_tag</tt>. In the above example you would simply remove
2731
+ the <em>&lt;img&gt;</em> HTML tag and replace it with inline Ruby like this:</p></div>
2732
+ <div class="listingblock">
2733
+ <div class="content">
2734
+ <pre><tt>&lt;%= image_tag("foo.jpg") %&gt;</tt></pre>
2735
+ </div></div>
2736
+ <div class="paragraph"><p>This will generate the proper image tag to <tt>$RAILS_ROOT/public/images/foo.jpg</tt>
2737
+ so that your images will always work no matter what sub-URI you&#8217;ve deployed to.</p></div>
2738
+ <div class="paragraph"><p>These helper methods are more valuable than you may think. For example they also
2739
+ append a timestamp to the URI to better facilitate HTTP caching. For more information,
2740
+ please refer to
2741
+ <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html">the Rails API docs</a>.</p></div>
2738
2742
  </div>
2739
2743
  <h2 id="_appendix_a_about_this_document">9. Appendix A: About this document</h2>
2740
2744
  <div class="sectionbody">
@@ -2756,7 +2760,7 @@ Attribution-Share Alike 3.0 Unported License</a>.</p></div>
2756
2760
  </div>
2757
2761
  <h2 id="_appendix_b_terminology">10. Appendix B: Terminology</h2>
2758
2762
  <div class="sectionbody">
2759
- <h3 id="application_root">10.1. Application root</h3><div style="clear:left"></div>
2763
+ <h3 id="application_root">10.1. Application root</h3>
2760
2764
  <div class="paragraph"><p>The root directory of an application that&#8217;s served by Phusion Passenger.</p></div>
2761
2765
  <div class="paragraph"><p>In case of Ruby on Rails applications, this is the directory that contains
2762
2766
  <em>Rakefile</em>, <em>app/</em>, <em>config/</em>, <em>public/</em>, etc. In other words, the directory
@@ -2823,7 +2827,7 @@ processes.</p></div>
2823
2827
  <div class="paragraph"><p>While this may sound simple, there&#8217;s not just one way to spawn worker processes.
2824
2828
  Let&#8217;s go over the different spawning methods. For simplicity&#8217;s sake, let&#8217;s
2825
2829
  assume that we&#8217;re only talking about Ruby on Rails applications.</p></div>
2826
- <h3 id="_the_most_straightforward_and_traditional_way_conservative_spawning">11.1. The most straightforward and traditional way: conservative spawning</h3><div style="clear:left"></div>
2830
+ <h3 id="_the_most_straightforward_and_traditional_way_conservative_spawning">11.1. The most straightforward and traditional way: conservative spawning</h3>
2827
2831
  <div class="paragraph"><p>Phusion Passenger could create a new Ruby process, which will then load the
2828
2832
  Rails application along with the entire Rails framework. This process will then
2829
2833
  enter an request handling main loop.</p></div>
@@ -2838,7 +2842,7 @@ programmers jargon, mongrel_cluster creates new Ruby processes by forking the
2838
2842
  current process and exec()-ing a new Ruby interpreter. Phusion Passenger on the
2839
2843
  other hand creates processes that reuse the already loaded Ruby interpreter. In
2840
2844
  programmers jargon, Phusion Passenger calls fork(), but not exec().</p></div>
2841
- <h3 id="_the_smart_spawning_method">11.2. The smart spawning method</h3><div style="clear:left"></div>
2845
+ <h3 id="_the_smart_spawning_method">11.2. The smart spawning method</h3>
2842
2846
  <div class="admonitionblock">
2843
2847
  <table><tr>
2844
2848
  <td class="icon">
@@ -2945,7 +2949,7 @@ process).</p></div>
2945
2949
  assuming that your Ruby interpreter is <a href="#reducing_memory_usage">copy-on-write friendly</a>.</p></div>
2946
2950
  <div class="paragraph"><p>Of course, smart spawning is not without gotchas. But if you understand the
2947
2951
  gotchas you can easily reap the benefits of smart spawning.</p></div>
2948
- <h3 id="_smart_spawning_gotcha_1_unintential_file_descriptor_sharing">11.3. Smart spawning gotcha #1: unintential file descriptor sharing</h3><div style="clear:left"></div>
2952
+ <h3 id="_smart_spawning_gotcha_1_unintential_file_descriptor_sharing">11.3. Smart spawning gotcha #1: unintential file descriptor sharing</h3>
2949
2953
  <div class="paragraph"><p>Because worker processes are created by forking from an ApplicationSpawner
2950
2954
  server, it will share all file descriptors that are opened by the
2951
2955
  ApplicationSpawner server. (This is part of the semantics of the Unix
@@ -3076,7 +3080,7 @@ data in the log file is interleaved.</p></div>
3076
3080
  must synchronize write access via an inter-process synchronization mechanism,
3077
3081
  such as file locks. Reopening the log file, like you would have done in the
3078
3082
  Memcached example, doesn&#8217;t help.</p></div>
3079
- <h3 id="_smart_spawning_gotcha_2_the_need_to_revive_threads">11.4. Smart spawning gotcha #2: the need to revive threads</h3><div style="clear:left"></div>
3083
+ <h3 id="_smart_spawning_gotcha_2_the_need_to_revive_threads">11.4. Smart spawning gotcha #2: the need to revive threads</h3>
3080
3084
  <div class="paragraph"><p>Another part of the <em>fork()</em> system call&#8217;s semantics is the fact that threads
3081
3085
  disappear after a fork call. So if you&#8217;ve created any threads in environment.rb,
3082
3086
  then those threads will no longer be running in newly created worker process.
@@ -3097,7 +3101,7 @@ http://www.gnu.org/software/src-highlite -->
3097
3101
  <span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
3098
3102
  <span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
3099
3103
  <span style="font-weight: bold"><span style="color: #0000FF">end</span></span></tt></pre></div></div>
3100
- <h3 id="_smart_spawning_gotcha_3_code_load_order">11.5. Smart spawning gotcha #3: code load order</h3><div style="clear:left"></div>
3104
+ <h3 id="_smart_spawning_gotcha_3_code_load_order">11.5. Smart spawning gotcha #3: code load order</h3>
3101
3105
  <div class="paragraph"><p>This gotcha is only applicable to the <em>smart</em> spawn method, not the <em>smart-lv2</em>
3102
3106
  spawn method.</p></div>
3103
3107
  <div class="paragraph"><p>If your application expects the Rails framework to be not loaded during the
@@ -3116,7 +3120,7 @@ has no effect.</p></div>
3116
3120
  </div>
3117
3121
  <div id="footer">
3118
3122
  <div id="footer-text">
3119
- Last updated 2009-03-13 17:14:24 CEST
3123
+ Last updated 2009-03-31 13:58:42 CEST
3120
3124
  </div>
3121
3125
  </div>
3122
3126
  </body>