passenger 4.0.30 → 4.0.31

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 (409) hide show
  1. data.tar.gz.asc +7 -7
  2. data/NEWS +31 -0
  3. data/bin/passenger +5 -5
  4. data/bin/passenger-config +6 -126
  5. data/bin/passenger-install-apache2-module +108 -26
  6. data/bin/passenger-install-nginx-module +81 -27
  7. data/bin/passenger-memory-stats +7 -6
  8. data/bin/passenger-status +13 -10
  9. data/build/agents.rb +8 -12
  10. data/build/apache2.rb +12 -7
  11. data/build/basics.rb +28 -20
  12. data/build/common_library.rb +4 -4
  13. data/build/cplusplus_support.rb +4 -4
  14. data/build/cxx_tests.rb +5 -3
  15. data/build/debian.rb +1 -2
  16. data/build/integration_tests.rb +25 -9
  17. data/build/misc.rb +2 -2
  18. data/build/oxt_tests.rb +5 -6
  19. data/build/packaging.rb +72 -40
  20. data/build/ruby_tests.rb +5 -1
  21. data/build/test_basics.rb +1 -2
  22. data/debian.template/locations.ini.template +1 -0
  23. data/debian.template/rules.template +2 -1
  24. data/dev/install_scripts_bootstrap_code.rb +42 -0
  25. data/dev/run_travis.sh +1 -0
  26. data/dev/runner +27 -0
  27. data/doc/Packaging.txt.md +5 -10
  28. data/doc/Users guide Apache.idmap.txt +3 -1
  29. data/doc/Users guide Apache.txt +5 -3
  30. data/doc/Users guide Nginx.idmap.txt +9 -5
  31. data/doc/Users guide Nginx.txt +47 -17
  32. data/doc/users_guide_snippets/environment_variables.txt +2 -2
  33. data/doc/users_guide_snippets/installation.txt +6 -2
  34. data/doc/users_guide_snippets/tips.txt +4 -0
  35. data/ext/apache2/Hooks.cpp +16 -3
  36. data/ext/common/Account.h +6 -5
  37. data/ext/common/AgentsStarter.h +1 -1
  38. data/ext/common/ApplicationPool2/Common.h +72 -0
  39. data/ext/common/ApplicationPool2/Group.h +263 -148
  40. data/ext/common/ApplicationPool2/Implementation.cpp +66 -44
  41. data/ext/common/ApplicationPool2/Options.h +1 -7
  42. data/ext/common/ApplicationPool2/Pool.h +96 -72
  43. data/ext/common/ApplicationPool2/Process.h +12 -17
  44. data/ext/common/ApplicationPool2/Socket.h +4 -4
  45. data/ext/common/ApplicationPool2/SuperGroup.h +20 -17
  46. data/ext/common/Constants.h +15 -1
  47. data/ext/common/MessageServer.h +22 -0
  48. data/ext/common/Utils.cpp +4 -1
  49. data/ext/common/Utils.h +3 -1
  50. data/ext/common/Utils/StrIntUtils.h +1 -0
  51. data/ext/common/Utils/Timer.h +15 -1
  52. data/ext/common/Utils/utf8/checked.h +0 -0
  53. data/ext/common/Utils/utf8/core.h +0 -0
  54. data/ext/common/Utils/utf8/unchecked.h +0 -0
  55. data/ext/common/agents/Base.cpp +59 -35
  56. data/ext/common/agents/HelperAgent/Main.cpp +23 -12
  57. data/ext/common/agents/HelperAgent/RequestHandler.h +10 -1
  58. data/ext/common/agents/LoggingAgent/FilterSupport.h +9 -5
  59. data/ext/common/agents/TempDirToucher.c +12 -3
  60. data/ext/common/agents/Watchdog/Main.cpp +8 -2
  61. data/ext/nginx/ConfigurationCommands.c +10 -0
  62. data/ext/nginx/ConfigurationFields.h +2 -0
  63. data/ext/nginx/ContentHandler.c +32 -19
  64. data/ext/nginx/CreateLocationConfig.c +5 -0
  65. data/ext/nginx/MergeLocationConfig.c +6 -0
  66. data/ext/nginx/config +13 -6
  67. data/ext/ruby/passenger_native_support.c +61 -2
  68. data/helper-scripts/classic-rails-loader.rb +9 -10
  69. data/helper-scripts/classic-rails-preloader.rb +10 -11
  70. data/helper-scripts/node-loader.js +3 -2
  71. data/helper-scripts/rack-loader.rb +8 -9
  72. data/helper-scripts/rack-preloader.rb +9 -10
  73. data/lib/phusion_passenger.rb +36 -7
  74. data/lib/phusion_passenger/abstract_installer.rb +16 -15
  75. data/lib/phusion_passenger/active_support3_extensions/init.rb +1 -1
  76. data/lib/phusion_passenger/admin_tools/memory_stats.rb +2 -2
  77. data/lib/phusion_passenger/admin_tools/server_instance.rb +5 -5
  78. data/lib/phusion_passenger/analytics_logger.rb +3 -3
  79. data/lib/phusion_passenger/classic_rails/thread_handler_extension.rb +1 -1
  80. data/lib/phusion_passenger/config.rb +125 -0
  81. data/lib/phusion_passenger/config/about_command.rb +183 -0
  82. data/lib/phusion_passenger/config/command.rb +57 -0
  83. data/lib/phusion_passenger/config/restart_app_command.rb +146 -0
  84. data/lib/phusion_passenger/config/utils.rb +108 -0
  85. data/lib/phusion_passenger/console_text_template.rb +2 -1
  86. data/lib/phusion_passenger/constants.rb +7 -2
  87. data/lib/phusion_passenger/loader_shared_helpers.rb +12 -21
  88. data/lib/phusion_passenger/message_client.rb +15 -4
  89. data/lib/phusion_passenger/native_support.rb +116 -98
  90. data/lib/phusion_passenger/nginx/config_options.rb +5 -0
  91. data/lib/phusion_passenger/platform_info.rb +1 -1
  92. data/lib/phusion_passenger/platform_info/apache.rb +9 -5
  93. data/lib/phusion_passenger/platform_info/apache_detector.rb +5 -6
  94. data/lib/phusion_passenger/platform_info/binary_compatibility.rb +3 -3
  95. data/lib/phusion_passenger/platform_info/compiler.rb +29 -11
  96. data/lib/phusion_passenger/platform_info/curl.rb +1 -1
  97. data/lib/phusion_passenger/platform_info/cxx_portability.rb +30 -16
  98. data/lib/phusion_passenger/platform_info/depcheck.rb +6 -6
  99. data/lib/phusion_passenger/platform_info/linux.rb +2 -2
  100. data/lib/phusion_passenger/platform_info/operating_system.rb +25 -5
  101. data/lib/phusion_passenger/platform_info/ruby.rb +7 -4
  102. data/lib/phusion_passenger/platform_info/zlib.rb +1 -1
  103. data/lib/phusion_passenger/plugin.rb +0 -1
  104. data/lib/phusion_passenger/preloader_shared_helpers.rb +1 -1
  105. data/lib/phusion_passenger/public_api.rb +1 -1
  106. data/lib/phusion_passenger/rack/thread_handler_extension.rb +1 -1
  107. data/lib/phusion_passenger/request_handler.rb +8 -9
  108. data/lib/phusion_passenger/request_handler/thread_handler.rb +21 -9
  109. data/lib/phusion_passenger/ruby_core_enhancements.rb +1 -1
  110. data/lib/phusion_passenger/standalone/app_finder.rb +2 -2
  111. data/lib/phusion_passenger/standalone/command.rb +10 -8
  112. data/lib/phusion_passenger/standalone/help_command.rb +1 -1
  113. data/lib/phusion_passenger/standalone/main.rb +3 -3
  114. data/lib/phusion_passenger/standalone/package_runtime_command.rb +2 -2
  115. data/lib/phusion_passenger/standalone/runtime_installer.rb +55 -13
  116. data/lib/phusion_passenger/standalone/runtime_locator.rb +3 -3
  117. data/lib/phusion_passenger/standalone/start_command.rb +6 -7
  118. data/lib/phusion_passenger/standalone/status_command.rb +1 -1
  119. data/lib/phusion_passenger/standalone/stop_command.rb +1 -1
  120. data/lib/phusion_passenger/standalone/utils.rb +1 -1
  121. data/lib/phusion_passenger/standalone/version_command.rb +2 -3
  122. data/lib/phusion_passenger/utils.rb +1 -1
  123. data/lib/phusion_passenger/utils/download.rb +1 -2
  124. data/lib/phusion_passenger/utils/file_system_watcher.rb +1 -1
  125. data/lib/phusion_passenger/utils/hosts_file_parser.rb +1 -1
  126. data/lib/phusion_passenger/utils/tee_input.rb +1 -1
  127. data/lib/phusion_passenger/utils/terminal_choice_menu.rb +217 -0
  128. data/lib/phusion_passenger/utils/unseekable_socket.rb +1 -1
  129. data/resources/templates/apache2/config_snippets.txt.erb +2 -3
  130. data/resources/templates/apache2/deployment_example.txt.erb +2 -2
  131. data/resources/templates/apache2/notify_apache_module_installed.txt.erb +3 -0
  132. data/resources/templates/nginx/config_snippets.txt.erb +1 -1
  133. data/resources/templates/nginx/deployment_example.txt.erb +2 -2
  134. data/resources/templates/nginx/nginx_module_sources_not_available.txt.erb +11 -5
  135. data/rpm/Vagrantfile +1 -0
  136. data/test/cxx/ApplicationPool2/PoolTest.cpp +224 -35
  137. data/test/cxx/ApplicationPool2/ProcessTest.cpp +6 -6
  138. data/test/cxx/MessagePassingTest.cpp +1 -1
  139. data/test/cxx/RequestHandlerTest.cpp +26 -26
  140. data/test/integration_tests/apache2_tests.rb +162 -243
  141. data/test/integration_tests/native_packaging_spec.rb +10 -10
  142. data/test/integration_tests/nginx_tests.rb +87 -107
  143. data/test/integration_tests/shared/example_webapp_tests.rb +246 -0
  144. data/test/integration_tests/source_packaging_test.rb +2 -1
  145. data/test/integration_tests/standalone_tests.rb +34 -19
  146. data/test/ruby/admin_tools_spec.rb +4 -4
  147. data/test/ruby/analytics_logger_spec.rb +1 -1
  148. data/test/ruby/debug_logging_spec.rb +2 -2
  149. data/test/ruby/message_channel_spec.rb +1 -1
  150. data/test/ruby/request_handler_spec.rb +171 -64
  151. data/test/ruby/shared/loader_sharedspec.rb +5 -5
  152. data/test/ruby/shared/rails/analytics_logging_extensions_sharedspec.rb +2 -2
  153. data/test/ruby/spec_helper.rb +4 -4
  154. data/test/ruby/standalone/runtime_installer_spec.rb +1 -1
  155. data/test/ruby/standalone/runtime_locator_spec.rb +1 -1
  156. data/test/ruby/utils/file_system_watcher_spec.rb +1 -1
  157. data/test/ruby/utils/hosts_file_parser.rb +1 -1
  158. data/test/ruby/utils/unseekable_socket_spec.rb +1 -1
  159. data/test/ruby/utils_spec.rb +4 -4
  160. data/test/stub/apache2/httpd.conf.erb +5 -0
  161. data/test/stub/index.html +1 -0
  162. data/test/stub/rack/config.ru +80 -33
  163. data/test/stub/{rails_apps/1.2/empty/app/models → rack/public}/.gitignore +0 -0
  164. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/Rakefile +0 -0
  165. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/application_controller.rb +0 -0
  166. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/recipes_controller.rb +0 -0
  167. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/uploads_controller.rb +0 -0
  168. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/welcome_controller.rb +0 -0
  169. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/app/helpers/application_helper.rb +0 -0
  170. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/recipes_helper.rb +0 -0
  171. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/test_helper.rb +0 -0
  172. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/uploads_helper.rb +0 -0
  173. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/welcome_helper.rb +0 -0
  174. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/layouts/default.rhtml +0 -0
  175. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/recipes/create.rhtml +0 -0
  176. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/recipes/index.rhtml +0 -0
  177. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/recipes/new.rhtml +0 -0
  178. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/uploads/index.rhtml +0 -0
  179. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/uploads/new.html.erb +0 -0
  180. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/welcome/cached.rhtml +0 -0
  181. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/welcome/index.rhtml +0 -0
  182. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/boot.rb +0 -0
  183. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/database.yml +0 -0
  184. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/environment.rb +0 -0
  185. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/config/environments/development.rb +0 -0
  186. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/environments/production.rb +0 -0
  187. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/config/initializers/inflections.rb +0 -0
  188. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/config/initializers/mime_types.rb +0 -0
  189. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/routes.rb +0 -0
  190. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/log/useless.txt +0 -0
  191. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/.htaccess +0 -0
  192. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/public/404.html +0 -0
  193. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/public/422.html +0 -0
  194. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/public/500.html +0 -0
  195. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/dispatch.cgi +0 -0
  196. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/dispatch.fcgi +0 -0
  197. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/dispatch.rb +0 -0
  198. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/public/favicon.ico +0 -0
  199. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/images/angrywizard.gif +0 -0
  200. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/images/cookbook.gif +0 -0
  201. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/images/header.png +0 -0
  202. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/public/images/rails.png +0 -0
  203. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/public/robots.txt +0 -0
  204. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/uploads.html +0 -0
  205. data/test/stub/{rails_apps/1.2/empty/db → rails2.3-mycook/public/uploads}/.gitignore +0 -0
  206. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/welcome/cached.html +0 -0
  207. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/about +0 -0
  208. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/console +0 -0
  209. data/test/stub/{rails_apps/2.2/empty → rails2.3-mycook}/script/dbconsole +0 -0
  210. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/destroy +0 -0
  211. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/generate +0 -0
  212. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/performance/benchmarker +0 -0
  213. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/performance/profiler +0 -0
  214. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/performance/request +0 -0
  215. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/plugin +0 -0
  216. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/process/inspector +0 -0
  217. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/process/reaper +0 -0
  218. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/process/spawner +0 -0
  219. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/runner +0 -0
  220. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/server +0 -0
  221. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/sites/some.site/public/uploads.html +0 -0
  222. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/sites/some.site/public/welcome/cached.html +0 -0
  223. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/cache/useless.txt +0 -0
  224. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/pids/useless.txt +0 -0
  225. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/sessions/useless.txt +0 -0
  226. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/sockets/useless.txt +0 -0
  227. data/test/stub/rails2.3/app/controllers/foo_controller.rb +1 -1
  228. data/test/stub/rails2.3/config/routes.rb +1 -2
  229. data/test/stub/wsgi/passenger_wsgi.py +47 -8
  230. data/test/stub/{rails_apps/1.2/empty/public/stylesheets → wsgi/public}/.gitignore +0 -0
  231. data/test/support/apache2_controller.rb +2 -2
  232. data/test/support/nginx_controller.rb +11 -5
  233. data/test/support/placebo-preloader.rb +2 -2
  234. data/test/support/test_helper.rb +26 -7
  235. metadata +78 -240
  236. metadata.gz.asc +7 -7
  237. data/debian.template/repack.sh +0 -42
  238. data/debian.template/watch +0 -3
  239. data/test/integration_tests/cgi_environment_spec.rb +0 -36
  240. data/test/integration_tests/hello_world_rack_spec.rb +0 -43
  241. data/test/integration_tests/hello_world_wsgi_spec.rb +0 -41
  242. data/test/integration_tests/mycook_spec.rb +0 -166
  243. data/test/stub/rack/public/rack.jpg +0 -0
  244. data/test/stub/rails_apps/1.2/empty/.gitignore +0 -3
  245. data/test/stub/rails_apps/1.2/empty/app/controllers/application.rb +0 -7
  246. data/test/stub/rails_apps/1.2/empty/config/boot.rb +0 -108
  247. data/test/stub/rails_apps/1.2/empty/config/database.yml +0 -31
  248. data/test/stub/rails_apps/1.2/empty/config/environment.rb +0 -66
  249. data/test/stub/rails_apps/1.2/empty/config/environments/development.rb +0 -21
  250. data/test/stub/rails_apps/1.2/empty/config/environments/production.rb +0 -18
  251. data/test/stub/rails_apps/1.2/empty/config/environments/staging.rb +0 -18
  252. data/test/stub/rails_apps/1.2/empty/config/environments/test.rb +0 -19
  253. data/test/stub/rails_apps/1.2/empty/config/routes.rb +0 -23
  254. data/test/stub/rails_apps/1.2/empty/doc/README_FOR_APP +0 -2
  255. data/test/stub/rails_apps/1.2/empty/public/.htaccess +0 -40
  256. data/test/stub/rails_apps/1.2/empty/public/500.html +0 -30
  257. data/test/stub/rails_apps/1.2/empty/public/dispatch.cgi +0 -10
  258. data/test/stub/rails_apps/1.2/empty/public/dispatch.fcgi +0 -24
  259. data/test/stub/rails_apps/1.2/empty/public/dispatch.rb +0 -10
  260. data/test/stub/rails_apps/1.2/empty/public/robots.txt +0 -1
  261. data/test/stub/rails_apps/1.2/empty/script/about +0 -3
  262. data/test/stub/rails_apps/1.2/empty/script/breakpointer +0 -3
  263. data/test/stub/rails_apps/1.2/empty/script/console +0 -3
  264. data/test/stub/rails_apps/1.2/empty/script/destroy +0 -3
  265. data/test/stub/rails_apps/1.2/empty/script/generate +0 -3
  266. data/test/stub/rails_apps/1.2/empty/script/plugin +0 -3
  267. data/test/stub/rails_apps/1.2/empty/script/runner +0 -3
  268. data/test/stub/rails_apps/1.2/empty/script/server +0 -3
  269. data/test/stub/rails_apps/1.2/empty/test/test_helper.rb +0 -28
  270. data/test/stub/rails_apps/2.0/empty/.gitignore +0 -3
  271. data/test/stub/rails_apps/2.0/empty/Rakefile +0 -10
  272. data/test/stub/rails_apps/2.0/empty/app/controllers/application.rb +0 -10
  273. data/test/stub/rails_apps/2.0/empty/app/helpers/application_helper.rb +0 -3
  274. data/test/stub/rails_apps/2.0/empty/app/models/.gitignore +0 -0
  275. data/test/stub/rails_apps/2.0/empty/config/boot.rb +0 -108
  276. data/test/stub/rails_apps/2.0/empty/config/database.yml +0 -31
  277. data/test/stub/rails_apps/2.0/empty/config/environment.rb +0 -59
  278. data/test/stub/rails_apps/2.0/empty/config/environments/production.rb +0 -18
  279. data/test/stub/rails_apps/2.0/empty/config/environments/staging.rb +0 -18
  280. data/test/stub/rails_apps/2.0/empty/config/environments/test.rb +0 -22
  281. data/test/stub/rails_apps/2.0/empty/config/routes.rb +0 -35
  282. data/test/stub/rails_apps/2.0/empty/db/.gitignore +0 -0
  283. data/test/stub/rails_apps/2.0/empty/doc/README_FOR_APP +0 -2
  284. data/test/stub/rails_apps/2.0/empty/public/.htaccess +0 -40
  285. data/test/stub/rails_apps/2.0/empty/public/404.html +0 -30
  286. data/test/stub/rails_apps/2.0/empty/public/dispatch.cgi +0 -10
  287. data/test/stub/rails_apps/2.0/empty/public/dispatch.fcgi +0 -24
  288. data/test/stub/rails_apps/2.0/empty/public/dispatch.rb +0 -10
  289. data/test/stub/rails_apps/2.0/empty/public/favicon.ico +0 -0
  290. data/test/stub/rails_apps/2.0/empty/public/images/rails.png +0 -0
  291. data/test/stub/rails_apps/2.0/empty/public/stylesheets/.gitignore +0 -0
  292. data/test/stub/rails_apps/2.0/empty/script/performance/benchmarker +0 -3
  293. data/test/stub/rails_apps/2.0/empty/script/performance/profiler +0 -3
  294. data/test/stub/rails_apps/2.0/empty/script/process/inspector +0 -3
  295. data/test/stub/rails_apps/2.0/empty/script/process/reaper +0 -3
  296. data/test/stub/rails_apps/2.0/empty/script/process/spawner +0 -3
  297. data/test/stub/rails_apps/2.0/empty/test/test_helper.rb +0 -38
  298. data/test/stub/rails_apps/2.2/empty/.gitignore +0 -3
  299. data/test/stub/rails_apps/2.2/empty/Rakefile +0 -10
  300. data/test/stub/rails_apps/2.2/empty/app/controllers/application.rb +0 -15
  301. data/test/stub/rails_apps/2.2/empty/app/helpers/application_helper.rb +0 -3
  302. data/test/stub/rails_apps/2.2/empty/app/models/.gitignore +0 -0
  303. data/test/stub/rails_apps/2.2/empty/config/boot.rb +0 -109
  304. data/test/stub/rails_apps/2.2/empty/config/database.yml +0 -31
  305. data/test/stub/rails_apps/2.2/empty/config/environment.rb +0 -75
  306. data/test/stub/rails_apps/2.2/empty/config/environments/development.rb +0 -17
  307. data/test/stub/rails_apps/2.2/empty/config/environments/production.rb +0 -24
  308. data/test/stub/rails_apps/2.2/empty/config/environments/staging.rb +0 -24
  309. data/test/stub/rails_apps/2.2/empty/config/environments/test.rb +0 -22
  310. data/test/stub/rails_apps/2.2/empty/config/initializers/inflections.rb +0 -10
  311. data/test/stub/rails_apps/2.2/empty/config/initializers/mime_types.rb +0 -5
  312. data/test/stub/rails_apps/2.2/empty/config/initializers/new_rails_defaults.rb +0 -17
  313. data/test/stub/rails_apps/2.2/empty/config/locales/en.yml +0 -5
  314. data/test/stub/rails_apps/2.2/empty/config/routes.rb +0 -43
  315. data/test/stub/rails_apps/2.2/empty/db/.gitignore +0 -0
  316. data/test/stub/rails_apps/2.2/empty/doc/README_FOR_APP +0 -5
  317. data/test/stub/rails_apps/2.2/empty/public/404.html +0 -30
  318. data/test/stub/rails_apps/2.2/empty/public/422.html +0 -30
  319. data/test/stub/rails_apps/2.2/empty/public/500.html +0 -33
  320. data/test/stub/rails_apps/2.2/empty/public/dispatch.cgi +0 -10
  321. data/test/stub/rails_apps/2.2/empty/public/dispatch.fcgi +0 -24
  322. data/test/stub/rails_apps/2.2/empty/public/dispatch.rb +0 -10
  323. data/test/stub/rails_apps/2.2/empty/public/favicon.ico +0 -0
  324. data/test/stub/rails_apps/2.2/empty/public/images/rails.png +0 -0
  325. data/test/stub/rails_apps/2.2/empty/public/robots.txt +0 -5
  326. data/test/stub/rails_apps/2.2/empty/public/stylesheets/.gitignore +0 -0
  327. data/test/stub/rails_apps/2.2/empty/script/about +0 -4
  328. data/test/stub/rails_apps/2.2/empty/script/console +0 -3
  329. data/test/stub/rails_apps/2.2/empty/script/destroy +0 -3
  330. data/test/stub/rails_apps/2.2/empty/script/generate +0 -3
  331. data/test/stub/rails_apps/2.2/empty/script/performance/benchmarker +0 -3
  332. data/test/stub/rails_apps/2.2/empty/script/performance/profiler +0 -3
  333. data/test/stub/rails_apps/2.2/empty/script/performance/request +0 -3
  334. data/test/stub/rails_apps/2.2/empty/script/plugin +0 -3
  335. data/test/stub/rails_apps/2.2/empty/script/process/inspector +0 -3
  336. data/test/stub/rails_apps/2.2/empty/script/process/reaper +0 -3
  337. data/test/stub/rails_apps/2.2/empty/script/process/spawner +0 -3
  338. data/test/stub/rails_apps/2.2/empty/script/runner +0 -3
  339. data/test/stub/rails_apps/2.2/empty/script/server +0 -3
  340. data/test/stub/rails_apps/2.2/empty/test/performance/browsing_test.rb +0 -9
  341. data/test/stub/rails_apps/2.2/empty/test/test_helper.rb +0 -38
  342. data/test/stub/rails_apps/2.3/empty/.gitignore +0 -3
  343. data/test/stub/rails_apps/2.3/empty/Rakefile +0 -10
  344. data/test/stub/rails_apps/2.3/empty/app/controllers/application_controller.rb +0 -10
  345. data/test/stub/rails_apps/2.3/empty/app/helpers/application_helper.rb +0 -3
  346. data/test/stub/rails_apps/2.3/empty/app/models/.gitignore +0 -0
  347. data/test/stub/rails_apps/2.3/empty/config/boot.rb +0 -110
  348. data/test/stub/rails_apps/2.3/empty/config/database.yml +0 -31
  349. data/test/stub/rails_apps/2.3/empty/config/environment.rb +0 -41
  350. data/test/stub/rails_apps/2.3/empty/config/environments/development.rb +0 -17
  351. data/test/stub/rails_apps/2.3/empty/config/environments/production.rb +0 -28
  352. data/test/stub/rails_apps/2.3/empty/config/environments/staging.rb +0 -28
  353. data/test/stub/rails_apps/2.3/empty/config/environments/test.rb +0 -28
  354. data/test/stub/rails_apps/2.3/empty/config/initializers/backtrace_silencers.rb +0 -7
  355. data/test/stub/rails_apps/2.3/empty/config/initializers/inflections.rb +0 -10
  356. data/test/stub/rails_apps/2.3/empty/config/initializers/mime_types.rb +0 -5
  357. data/test/stub/rails_apps/2.3/empty/config/initializers/new_rails_defaults.rb +0 -21
  358. data/test/stub/rails_apps/2.3/empty/config/initializers/session_store.rb +0 -15
  359. data/test/stub/rails_apps/2.3/empty/config/locales/en.yml +0 -5
  360. data/test/stub/rails_apps/2.3/empty/config/routes.rb +0 -43
  361. data/test/stub/rails_apps/2.3/empty/db/.gitignore +0 -0
  362. data/test/stub/rails_apps/2.3/empty/db/seeds.rb +0 -7
  363. data/test/stub/rails_apps/2.3/empty/doc/README_FOR_APP +0 -2
  364. data/test/stub/rails_apps/2.3/empty/public/404.html +0 -30
  365. data/test/stub/rails_apps/2.3/empty/public/422.html +0 -30
  366. data/test/stub/rails_apps/2.3/empty/public/500.html +0 -30
  367. data/test/stub/rails_apps/2.3/empty/public/favicon.ico +0 -0
  368. data/test/stub/rails_apps/2.3/empty/public/images/rails.png +0 -0
  369. data/test/stub/rails_apps/2.3/empty/public/robots.txt +0 -5
  370. data/test/stub/rails_apps/2.3/empty/public/stylesheets/.gitignore +0 -0
  371. data/test/stub/rails_apps/2.3/empty/script/about +0 -4
  372. data/test/stub/rails_apps/2.3/empty/script/console +0 -3
  373. data/test/stub/rails_apps/2.3/empty/script/dbconsole +0 -3
  374. data/test/stub/rails_apps/2.3/empty/script/destroy +0 -3
  375. data/test/stub/rails_apps/2.3/empty/script/generate +0 -3
  376. data/test/stub/rails_apps/2.3/empty/script/performance/benchmarker +0 -3
  377. data/test/stub/rails_apps/2.3/empty/script/performance/profiler +0 -3
  378. data/test/stub/rails_apps/2.3/empty/script/plugin +0 -3
  379. data/test/stub/rails_apps/2.3/empty/script/runner +0 -3
  380. data/test/stub/rails_apps/2.3/empty/script/server +0 -3
  381. data/test/stub/rails_apps/2.3/empty/test/performance/browsing_test.rb +0 -9
  382. data/test/stub/rails_apps/2.3/empty/test/test_helper.rb +0 -38
  383. data/test/stub/rails_apps/2.3/mycook/Rakefile +0 -10
  384. data/test/stub/rails_apps/2.3/mycook/app/helpers/application_helper.rb +0 -3
  385. data/test/stub/rails_apps/2.3/mycook/config/environments/development.rb +0 -18
  386. data/test/stub/rails_apps/2.3/mycook/config/initializers/inflections.rb +0 -10
  387. data/test/stub/rails_apps/2.3/mycook/config/initializers/mime_types.rb +0 -5
  388. data/test/stub/rails_apps/2.3/mycook/public/404.html +0 -30
  389. data/test/stub/rails_apps/2.3/mycook/public/422.html +0 -30
  390. data/test/stub/rails_apps/2.3/mycook/public/500.html +0 -30
  391. data/test/stub/rails_apps/2.3/mycook/public/favicon.ico +0 -0
  392. data/test/stub/rails_apps/2.3/mycook/public/images/rails.png +0 -0
  393. data/test/stub/rails_apps/2.3/mycook/public/robots.txt +0 -5
  394. data/test/stub/rails_apps/2.3/mycook/public/uploads/.gitignore +0 -0
  395. data/test/stub/rails_apps/2.3/mycook/script/about +0 -3
  396. data/test/stub/rails_apps/2.3/mycook/script/console +0 -3
  397. data/test/stub/rails_apps/2.3/mycook/script/dbconsole +0 -3
  398. data/test/stub/rails_apps/2.3/mycook/script/destroy +0 -3
  399. data/test/stub/rails_apps/2.3/mycook/script/generate +0 -3
  400. data/test/stub/rails_apps/2.3/mycook/script/performance/benchmarker +0 -3
  401. data/test/stub/rails_apps/2.3/mycook/script/performance/profiler +0 -3
  402. data/test/stub/rails_apps/2.3/mycook/script/performance/request +0 -3
  403. data/test/stub/rails_apps/2.3/mycook/script/plugin +0 -3
  404. data/test/stub/rails_apps/2.3/mycook/script/process/inspector +0 -3
  405. data/test/stub/rails_apps/2.3/mycook/script/process/reaper +0 -3
  406. data/test/stub/rails_apps/2.3/mycook/script/process/spawner +0 -3
  407. data/test/stub/rails_apps/2.3/mycook/script/runner +0 -3
  408. data/test/stub/rails_apps/2.3/mycook/script/server +0 -3
  409. data/test/stub/wsgi/public/wsgi-snake.jpg +0 -0
@@ -29,8 +29,12 @@ task 'test:ruby' => dependencies do
29
29
  if PlatformInfo.rspec.nil?
30
30
  abort "RSpec is not installed for Ruby interpreter '#{PlatformInfo.ruby_command}'. Please install it."
31
31
  else
32
+ if maybe_grep = string_option('E')
33
+ require 'shellwords'
34
+ maybe_grep = "-e #{Shellwords.escape(maybe_grep)}"
35
+ end
32
36
  Dir.chdir("test") do
33
- ruby "#{PlatformInfo.rspec} -c -f s -P 'dont-autoload-anything' ruby/*_spec.rb ruby/*/*_spec.rb"
37
+ ruby "#{PlatformInfo.rspec} -c -f s -P 'dont-autoload-anything' #{maybe_grep} ruby/*_spec.rb ruby/*/*_spec.rb"
34
38
  end
35
39
  end
36
40
  end
@@ -24,8 +24,7 @@
24
24
  TEST_BOOST_OXT_LIBRARY = LIBBOOST_OXT
25
25
  TEST_COMMON_LIBRARY = COMMON_LIBRARY
26
26
 
27
- TEST_COMMON_CFLAGS = "-DTESTING_APPLICATION_POOL " <<
28
- "#{EXTRA_CXXFLAGS}"
27
+ TEST_COMMON_CFLAGS = "-DTESTING_APPLICATION_POOL #{EXTRA_CXXFLAGS}"
29
28
 
30
29
  desc "Run all unit tests and integration tests"
31
30
  task :test => ['test:oxt', 'test:cxx', 'test:ruby', 'test:node', 'test:integration']
@@ -1,5 +1,6 @@
1
1
  [locations]
2
2
  natively_packaged=true
3
+ native_packaging_method=deb
3
4
  bin_dir=/usr/bin
4
5
  agents_dir=/usr/lib/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>/agents
5
6
  lib_dir=/usr/lib/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>
@@ -39,7 +39,8 @@ override_dh_auto_install:
39
39
  # Merge Ruby 1.8 and 1.9 files into a single directory.
40
40
  cp -a pkg/fakeroot1.8/* debian/tmp/
41
41
  cp -a pkg/fakeroot1.9.1/* debian/tmp/
42
- sed -i 's|## Magic comment: set locations\.ini ##|ENV["PASSENGER_LOCATION_CONFIGURATION_FILE"] = "/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini"|' debian/tmp/usr/bin/* debian/tmp/usr/sbin/*
42
+ ./dev/install_scripts_bootstrap_code.rb --ruby /usr/lib/ruby/vendor_ruby debian/tmp/usr/bin/* debian/tmp/usr/sbin/*
43
+ ./dev/install_scripts_bootstrap_code.rb --nginx-module-config /usr/bin debian/tmp/usr/share/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>/ngx_http_passenger_module/config
43
44
  touch debian/tmp/usr/share/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>/release.txt
44
45
 
45
46
  override_dh_auto_clean:
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+
4
+ # This script changes the bootstrap code for all Phusion Passenger commands,
5
+ # as well as the Nginx module config script, so that they work no
6
+ # matter which Ruby interpreter is currently in $PATH, and no matter how
7
+ # Phusion Passenger is packaged.
8
+ #
9
+ # The bootstrap code must not add ruby_libdir to $LOAD_PATH. The active Ruby
10
+ # can be *any* Ruby interpreter, maybe not even MRI. ruby_libdir belongs to
11
+ # a Ruby interpreter installed by the distribution, and the files in it may
12
+ # may be incompatible with the active Ruby.
13
+
14
+ type = ARGV.shift
15
+
16
+ if type == "--ruby"
17
+ ruby_libdir = ARGV.shift
18
+ BOOTSTRAP_CODE = %Q{
19
+ ENV["PASSENGER_LOCATION_CONFIGURATION_FILE"] = "#{ruby_libdir}/phusion_passenger/locations.ini"
20
+ require '#{ruby_libdir}/phusion_passenger'
21
+ }
22
+ elsif type == "--nginx-module-config"
23
+ bindir = ARGV.shift
24
+ BOOTSTRAP_CODE = %Q{
25
+ PASSENGER_CONFIG=#{bindir}/passenger-config
26
+ }
27
+ else
28
+ abort "Invalid type"
29
+ end
30
+ BOOTSTRAP_CODE.gsub!(/^\t\t/, '').strip
31
+
32
+ ARGV.each do |filename|
33
+ File.open(filename, "r+") do |f|
34
+ text = f.read
35
+ text.sub!(
36
+ /^## Magic comment: begin bootstrap ##.*## Magic comment: end bootstrap \#\#$/m,
37
+ BOOTSTRAP_CODE)
38
+ f.rewind
39
+ f.truncate(0)
40
+ f.write(text)
41
+ end
42
+ end
@@ -139,6 +139,7 @@ if [[ "$TEST_DEBIAN_PACKAGING" = 1 ]]; then
139
139
  run rake debian:dev debian:dev:reinstall
140
140
  run rake test:integration:native_packaging \
141
141
  LOCATIONS_INI=/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini \
142
+ NATIVE_PACKAGING_METHOD=deb \
142
143
  SUDO=1
143
144
  run env PASSENGER_LOCATION_CONFIGURATION_FILE=/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini \
144
145
  rake test:integration:apache2 SUDO=1
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path(File.dirname(__FILE__) + "/../lib/phusion_passenger")
3
+ PhusionPassenger.locate_directories
4
+
5
+ while true
6
+ if ARGV[0] =~ /^-r(.*)/
7
+ if $1.empty?
8
+ lib = ARGV[1]
9
+ ARGV.shift
10
+ ARGV.shift
11
+ else
12
+ lib = $1
13
+ ARGV.shift
14
+ end
15
+ begin
16
+ PhusionPassenger.require_passenger_lib(lib)
17
+ rescue LoadError
18
+ require(lib)
19
+ end
20
+ else
21
+ break
22
+ end
23
+ end
24
+
25
+ module PhusionPassenger
26
+ p eval(ARGV.join(" "))
27
+ end
@@ -43,8 +43,9 @@ package. This configuration comes not only with all necessary binaries, but also
43
43
  with some (but not all) source files. This is because when you run Phusion Passenger
44
44
  with a different Ruby interpreter than the packager intended, Phusion Passenger
45
45
  must be able to compile a new Ruby extension for that Ruby interpreter. This
46
- configuration does not however allow compiling against a different Apache or Nginx
47
- version than the packager intended.
46
+ configuration does not however allow compiling against a different Apache version
47
+ than the packager intended (but does allow compiling against a different Nginx
48
+ version).
48
49
 
49
50
  In this configuration, files can be scattered anywhere throughout the filesystem. This
50
51
  way Phusion Passenger can be packaged in an FHS-compliant way. The exact locations
@@ -52,14 +53,8 @@ of the different types of files can be specified through a
52
53
  _location configuration file_. The existance and usage of a location configuration
53
54
  file does not automatically imply that Phusion Passenger is natively packaged.
54
55
 
55
- This configuration also does not allow running Phusion Passenger Standalone against
56
- a different Nginx version than the packager intended, but does allow running
57
- against a different Ruby version. Passenger Standlone looks for its binaries
58
- in the location as specified by the location configuration file; it makes no
59
- attempt to compile anything, except of course for the Ruby extension.
60
-
61
- If either the non-Standalone or the Standalone Passenger needs to have a new Ruby
62
- extension compiled, then it will store that in `~/.passenger/native_support/<VERSION>/<ARCH>`.
56
+ If Phusion Passenger needs to have a new Ruby extension compiled, then it will
57
+ store that in `~/.passenger/native_support/<VERSION>/<ARCH>`.
63
58
 
64
59
 
65
60
  # The location configuration file
@@ -338,7 +338,9 @@
338
338
 
339
339
  11.9.4. Error handling => error-handling-1a1uvod
340
340
 
341
- 11.9.5. Available hooks => available-hooks-159anc3
341
+ 11.9.5. Compatibility => compatibility-18tl6g3
342
+
343
+ 11.9.6. Available hooks => available-hooks-159anc3
342
344
 
343
345
  11.10. Flying Passenger => flying-passenger-q916f7
344
346
 
@@ -513,7 +513,7 @@ Please refer to link:https://github.com/phusion/passenger/wiki/Phusion-Passenger
513
513
 
514
514
  == Deploying a Meteor application
515
515
 
516
- Please refer to link:http://blog.phusion.nl/2013/11/01/will-meteor-kill-rails-i-dont-know-but-phusion-passenger-open-sources-meteor-support/[the Meteor tutorial].
516
+ Please refer to link:https://github.com/phusion/passenger/wiki/Phusion-Passenger:-Meteor-tutorial[the Meteor tutorial].
517
517
 
518
518
 
519
519
  == Configuring Phusion Passenger ==
@@ -795,8 +795,8 @@ directory that's readable by Apache, but only writable by administrators.
795
795
  :version: 3.0.0
796
796
  include::users_guide_snippets/enterprise_only.txt[]
797
797
 
798
- Enables or disables support for rolling restarts. Normally when you
799
- restart an application (by touching restart.txt), Phusion Passenger would
798
+ Enables or disables support for rolling restarts through restart.txt. Normally when you
799
+ restart an application by touching restart.txt, Phusion Passenger would
800
800
  shut down all application processes and spawn a new one. The spawning
801
801
  of a new application process could take a while, and any requests that
802
802
  come in during this time will be blocked until this first application
@@ -822,6 +822,8 @@ Rolling restarts have a few caveat however that you should be aware of:
822
822
  been restarted. It is for this reason that you should not use rolling
823
823
  restarts in development, only in production.
824
824
 
825
+ Please note that this option is completely unrelated to the `passenger-config restart` command. That command always initiates a blocking restart, unless `--rolling-restart` is given.
826
+
825
827
  This option may occur in the following places:
826
828
 
827
829
  * In the global server configuration.
@@ -148,13 +148,15 @@
148
148
 
149
149
  8.2.9. passenger_base_uri <uri> => passenger-base-uri-uri--1xtuo50
150
150
 
151
- 8.2.10. passenger_spawn_method <string> => passenger-spawn-method-string--1sc6njl
151
+ 8.2.10. passenger_document_root <path> => passenger-document-root-path--1pge8kd
152
152
 
153
- 8.2.11. passenger_load_shell_envvars <on|off> => passenger-load-shell-envvars-on-off--fw5u4l
153
+ 8.2.11. passenger_spawn_method <string> => passenger-spawn-method-string--1sc6njl
154
154
 
155
- 8.2.12. passenger_rolling_restarts <on|off> => passenger-rolling-restarts
155
+ 8.2.12. passenger_load_shell_envvars <on|off> => passenger-load-shell-envvars-on-off--fw5u4l
156
156
 
157
- 8.2.13. passenger_resist_deployment_errors <on|off> => passenger-resist-deployment-errors-on-off--k9yf1
157
+ 8.2.13. passenger_rolling_restarts <on|off> => passenger-rolling-restarts
158
+
159
+ 8.2.14. passenger_resist_deployment_errors <on|off> => passenger-resist-deployment-errors-on-off--k9yf1
158
160
 
159
161
  8.3. Connection handling options => connection-handling-options-8jgq90
160
162
 
@@ -308,7 +310,9 @@
308
310
 
309
311
  11.9.4. Error handling => error-handling-m78oxs
310
312
 
311
- 11.9.5. Available hooks => available-hooks-11w1prq
313
+ 11.9.5. Compatibility => compatibility-132b3ns
314
+
315
+ 11.9.6. Available hooks => available-hooks-11w1prq
312
316
 
313
317
  11.10. Flying Passenger => flying-passenger-137qg5e
314
318
 
@@ -90,10 +90,11 @@ And you want your Rails application, located in `/websites/rails`, to be accessi
90
90
  To do this, you need to perform the following:
91
91
 
92
92
  1. Create a `location` with parameter `~ ^/<SUBURI>(/.*|$)`. This is a regular expression that says: "match everything that is exactly <SUBURI>, or starts with <SUBDURI>/".
93
- 2. Inside the location block, set `passenger_base_uri <SUBURI>`.
94
- 3. Inside the location block, set `alias <PATH TO YOUR APPLICATION'S PUBLIC DIRECTORY>$1`.
93
+ 2. Inside the location block, set `alias <PATH TO YOUR APPLICATION'S PUBLIC DIRECTORY>$1`.
94
+ 3. Inside the location block, set `passenger_base_uri <SUBURI>`.
95
95
  4. Inside the location block, set `passenger_app_root <PATH TO YOUR APPLICATION ROOT>`.
96
- 5. Inside the location block, re-specify `passenger_enabled on`.
96
+ 5. Inside the location block, set `passenger_document_root <PATH TO YOUR APPLICATION'S PUBLIC DIRECTORY>`.
97
+ 6. Inside the location block, re-specify `passenger_enabled on`.
97
98
 
98
99
  Here is an example:
99
100
 
@@ -108,9 +109,10 @@ http {
108
109
 
109
110
  # This block has been added.
110
111
  location ~ ^/subapp(/.*|$) {
111
- passenger_base_uri /subapp;
112
112
  alias /websites/rails/public$1; # <-- be sure to point to 'public'!
113
+ passenger_base_uri /subapp;
113
114
  passenger_app_root /websites/rails;
115
+ passenger_document_root /websites/rails/public;
114
116
  passenger_enabled on;
115
117
  }
116
118
  }
@@ -281,10 +283,11 @@ And you want your Rack application, located in `/websites/rack`, to be accessibl
281
283
  To do this, you need to perform the following:
282
284
 
283
285
  1. Create a `location` with parameter `~ ^/<SUBURI>(/.*|$)`. This is a regular expression that says: "match everything that is exactly <SUBURI>, or starts with <SUBDURI>/".
284
- 2. Inside the location block, set `passenger_base_uri <SUBURI>`.
285
- 3. Inside the location block, set `alias <PATH TO YOUR APPLICATION'S PUBLIC DIRECTORY>$1`.
286
+ 2. Inside the location block, set `alias <PATH TO YOUR APPLICATION'S PUBLIC DIRECTORY>$1`.
287
+ 3. Inside the location block, set `passenger_base_uri <SUBURI>`.
286
288
  4. Inside the location block, set `passenger_app_root <PATH TO YOUR APPLICATION ROOT>`.
287
- 5. Inside the location block, re-specify `passenger_enabled on`.
289
+ 5. Inside the location block, set `passenger_document_root <PATH TO YOUR APPLICATION'S PUBLIC DIRECTORY>`.
290
+ 6. Inside the location block, re-specify `passenger_enabled on`.
288
291
 
289
292
  Here is an example:
290
293
 
@@ -299,9 +302,10 @@ http {
299
302
 
300
303
  # This block has been added.
301
304
  location ~ ^/subapp(/.*|$) {
302
- passenger_base_uri /subapp;
303
305
  alias /websites/rack/public$1; # <-- be sure to point to 'public'!
306
+ passenger_base_uri /subapp;
304
307
  passenger_app_root /websites/rack;
308
+ passenger_document_root /websites/rack/public;
305
309
  passenger_enabled on;
306
310
  }
307
311
  }
@@ -441,10 +445,11 @@ And you want your WSGI application, located in `/websites/wsgi`, to be accessibl
441
445
  To do this, you need to perform the following:
442
446
 
443
447
  1. Create a `location` with parameter `~ ^/<SUBURI>(/.*|$)`. This is a regular expression that says: "match everything that is exactly <SUBURI>, or starts with <SUBDURI>/".
444
- 2. Inside the location block, set `passenger_base_uri <SUBURI>`.
445
- 3. Inside the location block, set `alias <PATH TO YOUR APPLICATION'S PUBLIC DIRECTORY>$1`.
448
+ 2. Inside the location block, set `alias <PATH TO YOUR APPLICATION'S PUBLIC DIRECTORY>$1`.
449
+ 3. Inside the location block, set `passenger_base_uri <SUBURI>`.
446
450
  4. Inside the location block, set `passenger_app_root <PATH TO YOUR APPLICATION ROOT>`.
447
- 5. Inside the location block, re-specify `passenger_enabled on`.
451
+ 5. Inside the location block, set `passenger_document_root <PATH TO YOUR APPLICATION'S PUBLIC DIRECTORY>`.
452
+ 6. Inside the location block, re-specify `passenger_enabled on`.
448
453
 
449
454
  Here is an example:
450
455
 
@@ -459,9 +464,10 @@ http {
459
464
 
460
465
  # This block has been added.
461
466
  location ~ ^/subapp(/.*|$) {
462
- passenger_base_uri /subapp;
463
467
  alias /websites/wsgi/public$1; # <-- be sure to point to 'public'!
468
+ passenger_base_uri /subapp;
464
469
  passenger_app_root /websites/wsgi;
470
+ passenger_document_root /websites/wsgi/public;
465
471
  passenger_enabled on;
466
472
  }
467
473
  }
@@ -498,7 +504,7 @@ Please refer to link:https://github.com/phusion/passenger/wiki/Phusion-Passenger
498
504
 
499
505
  == Deploying a Meteor application
500
506
 
501
- Please refer to link:http://blog.phusion.nl/2013/11/01/will-meteor-kill-rails-i-dont-know-but-phusion-passenger-open-sources-meteor-support/[the Meteor tutorial].
507
+ Please refer to link:https://github.com/phusion/passenger/wiki/Phusion-Passenger:-Meteor-tutorial[the Meteor tutorial].
502
508
 
503
509
 
504
510
  == Configuring Phusion Passenger ==
@@ -601,8 +607,11 @@ http {
601
607
  # If you have a web app deployed in a sub-URI, customize
602
608
  # passenger_ruby/passenger_python inside a `location` block.
603
609
  # The web app under www.bar.com/blog will use JRuby 1.7.1
604
- passenger_base_uri /blog;
605
- location /blog {
610
+ location ~ ^/blog(/.*|$) {
611
+ alias /websites/blog/public$1;
612
+ passenger_base_uri /blog;
613
+ passenger_app_root /websites/blog;
614
+ passenger_document_root /websites/blog/public;
606
615
  passenger_enabled on;
607
616
  passenger_ruby /usr/local/rvm/wrappers/jruby-1.7.1/ruby;
608
617
  }
@@ -717,6 +726,25 @@ This option may occur in the following places:
717
726
  * In a 'location' configuration block.
718
727
  * In an 'if' configuration scope.
719
728
 
729
+ [[PassengerDocumentRoot]]
730
+ ==== passenger_document_root <path>
731
+ Used in sub-URI deployment scenarios to tell Phusion Passenger where it
732
+ should look for static files. Please refer to the following sections for
733
+ more information:
734
+
735
+ * <<deploying_rack_to_sub_uri,Deploying Rack to a sub URI>>
736
+ * <<deploying_wsgi_to_sub_uri,Deploying WSGI to a sub URI>>
737
+ * <<deploying_rails_to_sub_uri,Deploying Rails 1 and Rails 2 to a sub URI>>
738
+
739
+ This option may occur in the following places:
740
+
741
+ * In the 'http' configuration block.
742
+ * In a 'server' configuration block.
743
+ * In a 'location' configuration block.
744
+ * In an 'if' configuration scope.
745
+
746
+ In each place, it may be specified at most once.
747
+
720
748
  [[PassengerSpawnMethod]]
721
749
  ==== passenger_spawn_method <string>
722
750
  [TIP]
@@ -768,8 +796,8 @@ In each place, it may be specified at most once. The default value is 'on'.
768
796
  :version: 3.0.0
769
797
  include::users_guide_snippets/enterprise_only.txt[]
770
798
 
771
- Enables or disables support for rolling restarts. Normally when you
772
- restart an application (by touching restart.txt), Phusion Passenger would
799
+ Enables or disables support for rolling restarts through restart.txt. Normally when you
800
+ restart an application by touching restart.txt, Phusion Passenger would
773
801
  shut down all application processes and spawn a new one. The spawning
774
802
  of a new application process could take a while, and any requests that
775
803
  come in during this time will be blocked until this first application
@@ -795,6 +823,8 @@ Rolling restarts have a few caveat however that you should be aware of:
795
823
  been restarted. It is for this reason that you should not use rolling
796
824
  restarts in development, only in production.
797
825
 
826
+ Please note that this option is completely unrelated to the `passenger-config restart` command. That command always initiates a blocking restart, unless `--rolling-restart` is given.
827
+
798
828
  This option may occur in the following places:
799
829
 
800
830
  * In the 'http' configuration block.
@@ -185,14 +185,14 @@ On other systems, or if you did not install Apache through the system's package
185
185
 
186
186
  NOTE: This subsection describes how to set environment variables on Nginx itself, not on apps served through Phusion Passenger for Nginx. The environment variables you set here will be passed to all apps, but you cannot customize them on a per-app basis. See also <<env_vars_passenger_apps,Setting environment variables on Phusion Passenger-served apps>>.
187
187
 
188
- If you installed Nginx through <<install_on_debian_ubuntu,the Brightbox packages>>, then you can define environment variables in `/etc/default/nginx`. This is a shell script so you must use the `export FOO=bar` syntax.
188
+ If you installed Nginx through <<install_on_debian_ubuntu,the Debian or Ubuntu packages>>, then you can define environment variables in `/etc/default/nginx`. This is a shell script so you must use the `export FOO=bar` syntax.
189
189
 
190
190
  Otherwise, environment variables are best set through the script which starts Nginx. For example, if you installed Nginx from source and you used
191
191
  ifdef::apache[]
192
192
  the Nginx init script described in the link:http://www.modrails.com/documentation/Users%20guide%20Nginx.html[Phusion Passenger Users Guide, Nginx version],
193
193
  endif::apache[]
194
194
  ifdef::nginx[]
195
- <<nginx_init_script,the Nginx init script described earlier in this manual,
195
+ <<nginx_init_script,the Nginx init script described earlier in this manual>>,
196
196
  endif::nginx[]
197
197
  then you should edit that script to define the environment variables. Those init scripts are regular shell scripts, so use the `export FOO=bar` syntax. Just make sure your set your environment variables before the script starts Nginx.
198
198
 
@@ -651,7 +651,7 @@ NOTE: If you run the installer with `sudo` then environment variables may not be
651
651
  On some systems, C/C++ libraries and headers that Phusion Passenger requires may be located in a non-standard directory. You can force the Phusion Passenger build system to look in those locations by injecting compiler and linker flags using the following environment variables:
652
652
 
653
653
  `EXTRA_PRE_CFLAGS`::
654
- These flags are injected into all C compiler invocations that involve compiling C or C++ source files. This includes compiler invocations that compile *and* link. The flags are injected at the beginning of the command string, even before `EXTRA_PRE_LDFLAGS`.
654
+ These flags are injected into all C compiler invocations that involve compiling C source files. This also covers compiler invocations that compile *and* link. The flags are injected at the beginning of the command string, even before `EXTRA_PRE_LDFLAGS`.
655
655
  `EXTRA_CFLAGS`::
656
656
  Similar to `EXTRA_PRE_CFLAGS`, but injected at the end of the command string, before `EXTRA_LDFLAGS`.
657
657
  `EXTRA_PRE_CXXFLAGS`::
@@ -659,7 +659,11 @@ On some systems, C/C++ libraries and headers that Phusion Passenger requires may
659
659
  `EXTRA_CXXFLAGS`::
660
660
  Similar to `EXTRA_CFLAGS`, but for C++ compiler invocations.
661
661
  `EXTRA_PRE_LDFLAGS`::
662
- These flags are injected into all C/C++ compiler invocations that involve linking. This includes compiler invocations that compile *and* link. The flags are injected at the beginning of the command string, but after `EXTRA_PRE_CFLAGS` and `EXTRA_PRE_CXXFLAGS`.
662
+ These flags are injected into all C/C++ compiler invocations that involve linking. This includes compiler invocations that compile *and* link. The flags are injected at the beginning of the command string, but after `EXTRA_PRE_CFLAGS`/`EXTRA_PRE_CXXFLAGS`.
663
+ `EXTRA_PRE_C_LDFLAGS`::
664
+ These flags are injected into all C compiler invocations that involve linking, right after `EXTRA_PRE_LDFLAGS`.
665
+ `EXTRA_PRE_CXX_LDFLAGS`::
666
+ Similar to `EXTRA_PRE_CXX_LDFLAGS`, but for C++ compiler invocations.
663
667
  `EXTRA_LDFLAGS`::
664
668
  Similar to `EXTRA_PRE_LDFLAGS`, but injected at the very end of the command string, even after `EXTRA_CFLAGS` and `EXTRA_CXXFLAGS`.
665
669
  `EXTRA_C_LDFLAGS`::
@@ -477,6 +477,10 @@ Hooks may be called concurrently. For example, while the `attached_process` hook
477
477
 
478
478
  If a hook script fails -- that is, if it exits with anything other than exit code 0 -- then the error handling depends on the hook. Some hooks will abort, other hooks will ignore the error. In all cases, the result of the hook script is printed to the log.
479
479
 
480
+ ==== Compatibility
481
+
482
+ Because hooks are inherently tied to the implementation of Phusion Passenger, there is no guarantee that hooks that currently work will continue to be available in the future versions of Phusion Passenger. The availability of hooks is very much tied to the specific version of Phusion Passenger.
483
+
480
484
  ==== Available hooks
481
485
 
482
486
  `before_watchdog_initialization`::
@@ -1218,7 +1218,17 @@ private:
1218
1218
  size_t size;
1219
1219
 
1220
1220
  size = fread(buf, 1, sizeof(buf), uploadData->handle);
1221
- writeExact(fd, buf, size);
1221
+ try {
1222
+ writeExact(fd, buf, size);
1223
+ } catch (const SystemException &e) {
1224
+ if (e.code() == EPIPE || e.code() == ECONNRESET) {
1225
+ // The HelperAgent stopped reading the body, probably
1226
+ // because the application already sent EOF.
1227
+ return;
1228
+ } else {
1229
+ throw e;
1230
+ }
1231
+ }
1222
1232
  }
1223
1233
  }
1224
1234
 
@@ -1592,6 +1602,7 @@ init_module(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *
1592
1602
  } catch (const thread_resource_error &e) {
1593
1603
  struct rlimit lim;
1594
1604
  string pthread_threads_max;
1605
+ int ret;
1595
1606
 
1596
1607
  lim.rlim_cur = 0;
1597
1608
  lim.rlim_max = 0;
@@ -1625,11 +1636,13 @@ init_module(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *
1625
1636
 
1626
1637
  fprintf(stderr, "Output of 'uname -a' follows:\n");
1627
1638
  fflush(stderr);
1628
- ::system("uname -a >&2");
1639
+ ret = ::system("uname -a >&2");
1640
+ (void) ret; // Ignore compiler warning.
1629
1641
 
1630
1642
  fprintf(stderr, "\nOutput of 'ulimit -a' follows:\n");
1631
1643
  fflush(stderr);
1632
- ::system("ulimit -a >&2");
1644
+ ret = ::system("ulimit -a >&2");
1645
+ (void) ret; // Ignore compiler warning.
1633
1646
 
1634
1647
  return DECLINED;
1635
1648