passenger 4.0.10 → 4.0.13

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 (224) hide show
  1. data.tar.gz.asc +7 -7
  2. data/.gitignore +66 -0
  3. data/.travis.yml +2 -5
  4. data/CONTRIBUTORS +2 -1
  5. data/NEWS +24 -0
  6. data/README.md +5 -10
  7. data/bin/passenger +1 -0
  8. data/bin/passenger-config +29 -3
  9. data/bin/passenger-install-nginx-module +1 -1
  10. data/build/basics.rb +8 -2
  11. data/build/debian.rb +22 -0
  12. data/build/integration_tests.rb +16 -2
  13. data/build/misc.rb +3 -0
  14. data/build/packaging.rb +77 -29
  15. data/build/preprocessor.rb +13 -10
  16. data/build/test_basics.rb +6 -0
  17. data/debian.template/locations.ini.template +13 -0
  18. data/debian.template/ruby-passenger-dev.install.template +3 -0
  19. data/debian.template/ruby-passenger-doc.install.template +2 -0
  20. data/debian.template/ruby-passenger.install.template +12 -0
  21. data/debian.template/rules.template +1 -0
  22. data/dev/run_travis.sh +46 -14
  23. data/doc/Architectural overview.html +25 -34
  24. data/doc/Packaging.html +31 -23
  25. data/doc/Packaging.txt.md +32 -23
  26. data/doc/Security of user switching support.html +16 -18
  27. data/doc/Users guide Apache.html +231 -239
  28. data/doc/Users guide Nginx.html +219 -227
  29. data/doc/Users guide Standalone.html +12 -15
  30. data/doc/users_guide_snippets/installation.txt +3 -2
  31. data/ext/common/ApplicationPool2/Implementation.cpp +6 -16
  32. data/ext/common/Constants.h +1 -1
  33. data/ext/common/ResourceLocator.h +6 -6
  34. data/ext/common/UnionStation.h +11 -15
  35. data/ext/common/Utils/ProcessMetricsCollector.h +7 -4
  36. data/ext/common/agents/HelperAgent/AgentOptions.h +6 -0
  37. data/ext/common/agents/HelperAgent/Main.cpp +5 -0
  38. data/ext/common/agents/HelperAgent/RequestHandler.h +9 -1
  39. data/ext/common/agents/LoggingAgent/Main.cpp +4 -0
  40. data/ext/common/agents/Watchdog/Main.cpp +7 -0
  41. data/ext/nginx/config +1 -1
  42. data/ext/oxt/Readme.txt +15 -0
  43. data/helper-scripts/download_binaries/extconf.rb +83 -0
  44. data/lib/phusion_passenger.rb +78 -80
  45. data/lib/phusion_passenger/abstract_installer.rb +22 -8
  46. data/lib/phusion_passenger/console_text_template.rb +1 -1
  47. data/lib/phusion_passenger/loader_shared_helpers.rb +2 -1
  48. data/lib/phusion_passenger/native_support.rb +22 -9
  49. data/lib/phusion_passenger/packaging.rb +7 -2
  50. data/lib/phusion_passenger/platform_info.rb +28 -1
  51. data/lib/phusion_passenger/platform_info/apache.rb +246 -26
  52. data/lib/phusion_passenger/platform_info/apache_detector.rb +232 -0
  53. data/lib/phusion_passenger/platform_info/depcheck_specs/ruby.rb +4 -0
  54. data/lib/phusion_passenger/platform_info/linux.rb +7 -0
  55. data/lib/phusion_passenger/public_api.rb +11 -2
  56. data/lib/phusion_passenger/standalone/command.rb +11 -14
  57. data/lib/phusion_passenger/standalone/runtime_installer.rb +313 -275
  58. data/lib/phusion_passenger/standalone/runtime_locator.rb +163 -0
  59. data/lib/phusion_passenger/standalone/start_command.rb +38 -46
  60. data/lib/phusion_passenger/utils/json.rb +329 -0
  61. data/lib/phusion_passenger/utils/tmpio.rb +1 -0
  62. data/passenger.gemspec +4 -0
  63. data/resources/mime.types +1 -0
  64. data/resources/oss-binaries.phusionpassenger.com.crt +84 -0
  65. data/resources/release.txt +0 -0
  66. data/resources/templates/standalone/download_tool_missing.txt.erb +18 -0
  67. data/rpm/README.rdoc +117 -0
  68. data/rpm/config/apache-passenger.conf.in +19 -0
  69. data/rpm/config/nginx-passenger.conf.in +10 -0
  70. data/rpm/config/rubygem-passenger.te +10 -0
  71. data/rpm/doc/README.nginx-alternatives +5 -0
  72. data/rpm/doc/example_yum_repository_htaccess +5 -0
  73. data/rpm/doc/footer.shtml +12 -0
  74. data/rpm/doc/header.shtml +156 -0
  75. data/rpm/nginx-alternatives.spec +97 -0
  76. data/rpm/passenger-release.spec +91 -0
  77. data/rpm/passenger.spec +667 -0
  78. data/rpm/patches/passenger-force-native.patch +63 -0
  79. data/rpm/release/RPM-GPG-KEY-stealthymonkeys +33 -0
  80. data/rpm/release/build-release.sh +35 -0
  81. data/rpm/release/build.rb +301 -0
  82. data/rpm/release/create-mirrors.sh +16 -0
  83. data/rpm/release/mirrors +1 -0
  84. data/rpm/release/mock-repo/comps.xml +21 -0
  85. data/rpm/release/mock-repo/rubygem-daemon_controller-0.2.5-1.noarch.rpm +0 -0
  86. data/rpm/release/mock-repo/rubygem-file-tail-1.0.5-1.noarch.rpm +0 -0
  87. data/rpm/release/mock-repo/rubygem-spruz-0.2.2-1.noarch.rpm +0 -0
  88. data/rpm/release/mocksetup-first.sh +102 -0
  89. data/rpm/release/mocksetup.sh +67 -0
  90. data/test/integration_tests/apache2_tests.rb +1 -1
  91. data/test/integration_tests/downloaded_binaries_tests.rb +76 -0
  92. data/test/integration_tests/native_packaging_spec.rb +38 -6
  93. data/test/integration_tests/source_packaging_test.rb +198 -0
  94. data/test/integration_tests/standalone_tests.rb +275 -0
  95. data/test/ruby/admin_tools_spec.rb +1 -1
  96. data/test/ruby/rails4.0/loader_spec.rb +28 -0
  97. data/test/ruby/rails4.0/preloader_spec.rb +34 -0
  98. data/test/ruby/spec_helper.rb +5 -1
  99. data/test/ruby/standalone/runtime_installer_spec.rb +399 -0
  100. data/test/ruby/standalone/runtime_locator_spec.rb +214 -0
  101. data/test/stub/apache2/httpd.conf.erb +18 -1
  102. data/test/stub/rack/tmp/.gitignore +0 -0
  103. data/test/stub/rails2.3/log/.gitignore +1 -0
  104. data/test/stub/rails2.3/public/.gitignore +1 -0
  105. data/test/stub/rails2.3/tmp/cache/.gitignore +1 -0
  106. data/test/stub/rails2.3/tmp/pids/.gitignore +1 -0
  107. data/test/stub/rails2.3/tmp/sessions/.gitignore +1 -0
  108. data/test/stub/rails2.3/tmp/sockets/.gitignore +1 -0
  109. data/test/stub/rails3.0/.gitignore +4 -0
  110. data/test/stub/rails3.0/Gemfile +1 -1
  111. data/test/stub/rails3.0/Gemfile.lock +1 -1
  112. data/test/stub/rails3.0/lib/tasks/.gitkeep +0 -0
  113. data/test/stub/rails3.0/log/.gitignore +0 -0
  114. data/test/stub/rails3.0/public/stylesheets/.gitkeep +0 -0
  115. data/test/stub/rails3.0/vendor/plugins/.gitkeep +0 -0
  116. data/test/stub/rails3.1/.gitignore +15 -0
  117. data/test/stub/rails3.1/Gemfile +1 -1
  118. data/test/stub/rails3.1/Gemfile.lock +1 -1
  119. data/test/stub/rails3.1/app/mailers/.gitkeep +0 -0
  120. data/test/stub/rails3.1/app/models/.gitkeep +0 -0
  121. data/test/stub/rails3.1/lib/assets/.gitkeep +0 -0
  122. data/test/stub/rails3.1/lib/tasks/.gitkeep +0 -0
  123. data/test/stub/rails3.1/log/.gitkeep +0 -0
  124. data/test/stub/rails3.1/test/fixtures/.gitkeep +0 -0
  125. data/test/stub/rails3.1/test/functional/.gitkeep +0 -0
  126. data/test/stub/rails3.1/test/integration/.gitkeep +0 -0
  127. data/test/stub/rails3.1/test/unit/.gitkeep +0 -0
  128. data/test/stub/rails3.1/vendor/assets/stylesheets/.gitkeep +0 -0
  129. data/test/stub/rails3.1/vendor/plugins/.gitkeep +0 -0
  130. data/test/stub/rails3.2/.gitignore +15 -0
  131. data/test/stub/rails3.2/app/mailers/.gitkeep +0 -0
  132. data/test/stub/rails3.2/app/models/.gitkeep +0 -0
  133. data/test/stub/rails3.2/lib/assets/.gitkeep +0 -0
  134. data/test/stub/rails3.2/lib/tasks/.gitkeep +0 -0
  135. data/test/stub/rails3.2/log/.gitkeep +0 -0
  136. data/test/stub/rails3.2/test/fixtures/.gitkeep +0 -0
  137. data/test/stub/rails3.2/test/functional/.gitkeep +0 -0
  138. data/test/stub/rails3.2/test/integration/.gitkeep +0 -0
  139. data/test/stub/rails3.2/test/unit/.gitkeep +0 -0
  140. data/test/stub/rails3.2/vendor/assets/stylesheets/.gitkeep +0 -0
  141. data/test/stub/rails3.2/vendor/plugins/.gitkeep +0 -0
  142. data/test/stub/rails4.0/.gitignore +16 -0
  143. data/test/stub/rails4.0/Gemfile +45 -0
  144. data/test/stub/rails4.0/Gemfile.lock +126 -0
  145. data/test/stub/rails4.0/README.rdoc +28 -0
  146. data/test/stub/rails4.0/Rakefile +6 -0
  147. data/test/stub/rails4.0/app/assets/images/.keep +0 -0
  148. data/test/stub/rails4.0/app/assets/javascripts/application.js +16 -0
  149. data/test/stub/rails4.0/app/assets/stylesheets/application.css +13 -0
  150. data/test/stub/rails4.0/app/controllers/application_controller.rb +5 -0
  151. data/test/stub/rails4.0/app/controllers/concerns/.keep +0 -0
  152. data/test/stub/rails4.0/app/helpers/application_helper.rb +2 -0
  153. data/test/stub/rails4.0/app/mailers/.keep +0 -0
  154. data/test/stub/rails4.0/app/models/.keep +0 -0
  155. data/test/stub/rails4.0/app/models/concerns/.keep +0 -0
  156. data/test/stub/rails4.0/app/views/layouts/application.html.erb +14 -0
  157. data/test/stub/rails4.0/bin/bundle +3 -0
  158. data/test/stub/rails4.0/bin/rails +4 -0
  159. data/test/stub/rails4.0/bin/rake +4 -0
  160. data/test/stub/rails4.0/config.ru +4 -0
  161. data/test/stub/rails4.0/config/application.rb +23 -0
  162. data/test/stub/rails4.0/config/boot.rb +4 -0
  163. data/test/stub/rails4.0/config/database.yml +25 -0
  164. data/test/stub/rails4.0/config/environment.rb +5 -0
  165. data/test/stub/rails4.0/config/environments/development.rb +29 -0
  166. data/test/stub/rails4.0/config/environments/production.rb +80 -0
  167. data/test/stub/rails4.0/config/environments/test.rb +36 -0
  168. data/test/stub/rails4.0/config/initializers/backtrace_silencers.rb +7 -0
  169. data/test/stub/rails4.0/config/initializers/filter_parameter_logging.rb +4 -0
  170. data/test/stub/rails4.0/config/initializers/inflections.rb +16 -0
  171. data/test/stub/rails4.0/config/initializers/mime_types.rb +5 -0
  172. data/test/stub/rails4.0/config/initializers/passenger.rb +1 -0
  173. data/test/stub/rails4.0/config/initializers/secret_token.rb +12 -0
  174. data/test/stub/rails4.0/config/initializers/session_store.rb +3 -0
  175. data/test/stub/rails4.0/config/initializers/wrap_parameters.rb +14 -0
  176. data/test/stub/rails4.0/config/locales/en.yml +23 -0
  177. data/test/stub/rails4.0/config/routes.rb +57 -0
  178. data/test/stub/rails4.0/db/seeds.rb +7 -0
  179. data/test/stub/rails4.0/lib/assets/.keep +0 -0
  180. data/test/stub/rails4.0/lib/tasks/.keep +0 -0
  181. data/test/stub/rails4.0/log/.keep +0 -0
  182. data/test/stub/rails4.0/public/404.html +58 -0
  183. data/test/stub/rails4.0/public/422.html +58 -0
  184. data/test/stub/rails4.0/public/500.html +57 -0
  185. data/test/stub/rails4.0/public/favicon.ico +0 -0
  186. data/test/stub/rails4.0/public/robots.txt +5 -0
  187. data/test/stub/rails4.0/test/controllers/.keep +0 -0
  188. data/test/stub/rails4.0/test/fixtures/.keep +0 -0
  189. data/test/stub/rails4.0/test/helpers/.keep +0 -0
  190. data/test/stub/rails4.0/test/integration/.keep +0 -0
  191. data/test/stub/rails4.0/test/mailers/.keep +0 -0
  192. data/test/stub/rails4.0/test/models/.keep +0 -0
  193. data/test/stub/rails4.0/test/test_helper.rb +15 -0
  194. data/test/stub/rails4.0/vendor/assets/javascripts/.keep +0 -0
  195. data/test/stub/rails4.0/vendor/assets/stylesheets/.keep +0 -0
  196. data/test/stub/rails_apps/1.2/empty/.gitignore +3 -0
  197. data/test/stub/rails_apps/1.2/empty/app/models/.gitignore +0 -0
  198. data/test/stub/rails_apps/1.2/empty/db/.gitignore +0 -0
  199. data/test/stub/rails_apps/1.2/empty/public/.htaccess +40 -0
  200. data/test/stub/rails_apps/1.2/empty/public/stylesheets/.gitignore +0 -0
  201. data/test/stub/rails_apps/2.0/empty/.gitignore +3 -0
  202. data/test/stub/rails_apps/2.0/empty/app/models/.gitignore +0 -0
  203. data/test/stub/rails_apps/2.0/empty/db/.gitignore +0 -0
  204. data/test/stub/rails_apps/2.0/empty/public/.htaccess +40 -0
  205. data/test/stub/rails_apps/2.0/empty/public/stylesheets/.gitignore +0 -0
  206. data/test/stub/rails_apps/2.2/empty/.gitignore +3 -0
  207. data/test/stub/rails_apps/2.2/empty/app/models/.gitignore +0 -0
  208. data/test/stub/rails_apps/2.2/empty/db/.gitignore +0 -0
  209. data/test/stub/rails_apps/2.2/empty/public/stylesheets/.gitignore +0 -0
  210. data/test/stub/rails_apps/2.3/empty/.gitignore +3 -0
  211. data/test/stub/rails_apps/2.3/empty/app/models/.gitignore +0 -0
  212. data/test/stub/rails_apps/2.3/empty/db/.gitignore +0 -0
  213. data/test/stub/rails_apps/2.3/empty/public/stylesheets/.gitignore +0 -0
  214. data/test/stub/rails_apps/2.3/mycook/public/.htaccess +42 -0
  215. data/test/stub/rails_apps/2.3/mycook/public/uploads/.gitignore +0 -0
  216. data/test/stub/wsgi/tmp/.gitignore +0 -0
  217. data/test/valgrind-osx.supp +7 -0
  218. metadata +162 -8
  219. metadata.gz.asc +7 -7
  220. data/debian.template/locations.ini +0 -12
  221. data/debian.template/ruby-passenger-dev.install +0 -3
  222. data/debian.template/ruby-passenger-doc.install +0 -2
  223. data/debian.template/ruby-passenger.install +0 -11
  224. data/resources/templates/installer_common/freebsd9_broken_cxx_runtime.txt.erb +0 -19
@@ -22,7 +22,8 @@
22
22
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  # THE SOFTWARE.
24
24
 
25
- # Implements a simple preprocessor language:
25
+ # Implements a simple preprocessor language which combines elements in the C
26
+ # preprocessor with ERB:
26
27
  #
27
28
  # Today
28
29
  # #if @today == :fine
@@ -33,6 +34,7 @@
33
34
  # is a sad day.
34
35
  # #endif
35
36
  # Let's go walking.
37
+ # Today is <%= Time.now %>.
36
38
  #
37
39
  # When run with...
38
40
  #
@@ -43,6 +45,7 @@
43
45
  # Today
44
46
  # is a fine day.
45
47
  # Let's go walking.
48
+ # Today is 2013-08-11 22:37:06 +0200.
46
49
  #
47
50
  # Highlights:
48
51
  #
@@ -50,8 +53,10 @@
50
53
  # * Expressions are Ruby expressions, evaluated within the binding of a
51
54
  # Preprocessor::Evaluator object.
52
55
  # * Text inside #if/#elif/#else are automatically unindented.
56
+ # * ERB compatible.
53
57
  class Preprocessor
54
58
  def initialize
59
+ require 'erb' if !defined?(ERB)
55
60
  @indentation_size = 4
56
61
  @debug = boolean_option('DEBUG')
57
62
  end
@@ -223,15 +228,13 @@ private
223
228
  end
224
229
 
225
230
  def each_line(filename)
226
- File.open(filename, 'r') do |f|
227
- while true
228
- begin
229
- line = f.readline.chomp
230
- rescue EOFError
231
- break
232
- end
233
- yield line
234
- end
231
+ data = File.open(filename, 'r') do |f|
232
+ erb = ERB.new(f.read, nil, "-")
233
+ erb.filename = filename
234
+ erb.result(binding)
235
+ end
236
+ data.each_line do |line|
237
+ yield line.chomp
235
238
  end
236
239
  end
237
240
 
@@ -54,5 +54,11 @@ task 'test:install_deps' do
54
54
  sh "cd test/stub/rails3.0 && bundle install"
55
55
  sh "cd test/stub/rails3.1 && bundle install"
56
56
  sh "cd test/stub/rails3.2 && bundle install"
57
+
58
+ ruby_version_int = RUBY_VERSION.split('.')[0..2].join.to_i
59
+
60
+ if ruby_version_int >= 190
61
+ sh "cd test/stub/rails4.0 && bundle install"
62
+ end
57
63
  end
58
64
  end
@@ -0,0 +1,13 @@
1
+ [locations]
2
+ natively_packaged=true
3
+ bin_dir=/usr/bin
4
+ agents_dir=/usr/lib/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>/agents
5
+ lib_dir=/usr/lib/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>
6
+ helper_scripts_dir=/usr/share/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>/helper-scripts
7
+ resources_dir=/usr/share/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>
8
+ include_dir=/usr/share/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>/include
9
+ doc_dir=/usr/share/doc/ruby-passenger
10
+ ruby_libdir=/usr/lib/ruby/vendor_ruby
11
+ apache2_module_path=/usr/lib/apache2/modules/mod_passenger.so
12
+ ruby_extension_source_dir=/usr/share/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>/ruby_extension_source
13
+ nginx_module_source_dir=/usr/share/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>/ngx_http_passenger_module
@@ -0,0 +1,3 @@
1
+ usr/share/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>/ngx_http_passenger_module
2
+ usr/share/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>/include/
3
+ usr/lib/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>/common/
@@ -0,0 +1,2 @@
1
+ debian/tmp/usr/share/doc/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>/* usr/share/doc/ruby-passenger/
2
+ CONTRIBUTORS usr/share/doc/ruby-passenger/
@@ -0,0 +1,12 @@
1
+ usr/lib/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>/agents/
2
+ usr/share/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>/helper-scripts/
3
+ usr/share/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>/templates/
4
+ usr/share/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>/standalone_default_root/
5
+ usr/share/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>/ruby_extension_source/
6
+ usr/share/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>/*.types
7
+ usr/share/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>/*.crt
8
+ usr/share/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>/*.txt
9
+ usr/lib/ruby/
10
+ debian/locations.ini usr/lib/ruby/vendor_ruby/phusion_passenger/
11
+ usr/sbin/
12
+ usr/bin/
@@ -26,6 +26,7 @@ override_dh_auto_install:
26
26
  cp -a pkg/fakeroot1.9.1/* debian/tmp/
27
27
  # Do not package Passenger Standalone.
28
28
  rm -rf debian/tmp/usr/bin/passenger
29
+ touch debian/tmp/usr/share/<%= PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME %>/release.txt
29
30
 
30
31
  override_dh_auto_clean:
31
32
  /usr/bin/rake clean CLEAN_DOCS=false
@@ -21,9 +21,33 @@ function run()
21
21
  "$@"
22
22
  }
23
23
 
24
+ function apt_get_update() {
25
+ if [[ "$apt_get_updated" = "" ]]; then
26
+ apt_get_updated=1
27
+ run sudo apt-get update
28
+ fi
29
+ }
30
+
31
+ function install_test_deps_without_rails_bundles()
32
+ {
33
+ if [[ "$install_test_deps_without_rails_bundles" = "" ]]; then
34
+ install_test_deps_without_rails_bundles=1
35
+ run rake test:install_deps RAILS_BUNDLES=no
36
+ fi
37
+ }
38
+
39
+ function install_test_deps_without_rails_bundles_without_doctools()
40
+ {
41
+ if [[ "$install_test_deps_without_rails_bundles_without_doctools" = "" ]]; then
42
+ install_test_deps_without_rails_bundles_without_doctools=1
43
+ rake test:install_deps RAILS_BUNDLES=no DOCTOOLS=no
44
+ fi
45
+ }
46
+
24
47
  run uname -a
25
48
  run lsb_release -a
26
49
  sudo tee /etc/dpkg/dpkg.cfg.d/02apt-speedup >/dev/null <<<"force-unsafe-io"
50
+ cp test/config.json.travis test/config.json
27
51
 
28
52
  if [[ "$TEST_RUBY_VERSION" != "" ]]; then
29
53
  echo "$ rvm use $TEST_RUBY_VERSION"
@@ -56,35 +80,43 @@ fi
56
80
 
57
81
  if [[ "$TEST_NGINX" = 1 ]]; then
58
82
  run rake test:install_deps RAILS_BUNDLES=no DOCTOOLS=no
59
- run gem install rack daemon_controller --no-rdoc --no-ri
60
83
  run ./bin/passenger-install-nginx-module --auto --prefix=/tmp/nginx --auto-download
61
84
  run rake test:integration:nginx
62
85
  fi
63
86
 
64
87
  if [[ "$TEST_APACHE2" = 1 ]]; then
65
- run sudo apt-get update
88
+ apt_get_update
66
89
  run sudo apt-get install -y --no-install-recommends \
67
90
  apache2-mpm-worker apache2-threaded-dev
68
- run rake test:install_deps RAILS_BUNDLES=no DOCTOOLS=no
69
- run gem install rack --no-rdoc --no-ri
91
+ install_test_deps_without_rails_bundles_without_doctools
70
92
  run ./bin/passenger-install-apache2-module --auto
71
93
  run rake test:integration:apache2
72
94
  fi
73
95
 
96
+ if [[ "$TEST_STANDALONE" = 1 ]]; then
97
+ apt_get_update
98
+ install_test_deps_without_rails_bundles_without_doctools
99
+ run rake test:integration:standalone
100
+ fi
101
+
74
102
  if [[ "$TEST_DEBIAN_PACKAGING" = 1 ]]; then
75
- run sudo apt-get update
103
+ apt_get_update
76
104
  run sudo apt-get install -y --no-install-recommends \
77
105
  devscripts debhelper rake apache2-mpm-worker apache2-threaded-dev \
78
- ruby1.8 ruby1.8-dev ruby1.9.1 ruby1.9.1-dev libev-dev gdebi-core \
106
+ ruby1.8 ruby1.8-dev ruby1.9.1 ruby1.9.1-dev rubygems libev-dev gdebi-core \
79
107
  source-highlight
80
- run rake test:install_deps RAILS_BUNDLES=no
81
- run rake debian:dev
82
- run sudo gdebi -n pkg/ruby-passenger_*.deb
83
- run sudo gdebi -n pkg/ruby-passenger-dev_*.deb
84
- run sudo gdebi -n pkg/ruby-passenger-doc_*.deb
85
- run sudo gdebi -n pkg/libapache2-mod-passenger_*.deb
86
- run rvmsudo env LOCATIONS_INI=/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini \
87
- rspec -f s -c test/integration_tests/native_packaging_spec.rb
108
+ install_test_deps_without_rails_bundles
109
+ run rake debian:dev debian:dev:reinstall
110
+ run rake test:integration:native_packaging \
111
+ LOCATIONS_INI=/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini \
112
+ SUDO=1
88
113
  run env PASSENGER_LOCATION_CONFIGURATION_FILE=/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini \
89
114
  rake test:integration:apache2 SUDO=1
90
115
  fi
116
+
117
+ if [[ "$TEST_SOURCE_PACKAGING" = 1 ]]; then
118
+ apt_get_update
119
+ run sudo apt-get install -y --no-install-recommends source-highlight
120
+ install_test_deps_without_rails_bundles
121
+ run rspec -f s -c test/integration_tests/source_packaging_test.rb
122
+ fi
@@ -1,9 +1,9 @@
1
1
  <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
- <meta name="generator" content="AsciiDoc 8.6.7">
6
- <title>Phusion Passenger design &amp; architecture</title>
2
+ <html lang="en">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <meta name="generator" content="AsciiDoc 8.6.7">
6
+ <title>Phusion Passenger design &amp; architecture</title>
7
7
  <style type="text/css">
8
8
  /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
9
9
 
@@ -603,7 +603,7 @@ div.exampleblock > div.content, div.sidebarblock > div.content, div.listingblock
603
603
  div.verseblock { border-left-width: 0; margin-left: 3em; }
604
604
  div.quoteblock { border-left-width: 3px; margin-left: 0; margin-right: 0;}
605
605
  div.admonitionblock td.content { border-left: 3px solid #E8E8E8; }
606
- </style>
606
+ </style>
607
607
  <script type="text/javascript">
608
608
  /*<![CDATA[*/
609
609
  var asciidoc = { // Namespace.
@@ -797,8 +797,7 @@ install: function(toclevels) {
797
797
  }
798
798
  asciidoc.install();
799
799
  /*]]>*/
800
- </script>
801
- <style type="text/css">
800
+ </script><style type="text/css">
802
801
  body {
803
802
  margin: 1em auto 1em auto;
804
803
  padding: 0 1em 0 1em;
@@ -1055,11 +1054,10 @@ pre {
1055
1054
  }
1056
1055
 
1057
1056
  </style>
1058
- </head>
1057
+ </head>
1059
1058
  <body class="article">
1060
1059
  <div id="topbar" style="display: none">
1061
1060
  <div class="title">
1062
- <!-- Don't put a space between the img and a. That will break the hover layout. -->
1063
1061
  <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAKCAYAAAEV95QVAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sGCRMSACDxkZwAAAAidEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVAgb24gYSBNYWOHqHdDAAAAZUlEQVQY032PSxbAIAjEIlfygL6ePF3UUvpzNjgSYWwqAMEhUQnANnsC7TQPeJpsVWzMuh2sog4vDTUbqP081zECrW4dtdaQGSIKlWluPyjK+VXxAz5XfcKufCzA130AfQHWB30HZxlPaP080xsAAAAASUVORK5CYII=" width="11" height="10" alt=""><a href="javascript:void(Mizuho.smoothlyScrollToToc())">Phusion Passenger design &amp; architecture</a>
1064
1062
  </div>
1065
1063
  <a href="javascript:void(0)" id="current_section"></a>
@@ -1070,8 +1068,7 @@ pre {
1070
1068
  <div class="sectionbody">
1071
1069
  <div class="paragraph"><p><span class="image">
1072
1070
  <a class="image" href="http://www.phusion.nl/">
1073
- <img src="images/phusion_banner.png" alt="images/phusion_banner.png">
1074
- </a>
1071
+ <img src="images/phusion_banner.png" alt="images/phusion_banner.png"></a>
1075
1072
  </span></p></div>
1076
1073
  <div class="paragraph"><p>Last updated: June 5, 2012.</p></div>
1077
1074
  <div class="paragraph"><p>This document describes Phusion Passenger’s design and architure in a global way.
@@ -1114,11 +1111,10 @@ to exit. This does not necessarily mean that the web application speaks HTTP
1114
1111
  directly: it just means that the web application accepts some kind of
1115
1112
  representation of an HTTP request.</p></div>
1116
1113
  <div class="paragraph"><p><span class="image">
1117
- <img src="images/typical_isolated_web_application.png" alt="Architecture of a typical web application in isolation">
1118
- </span></p></div>
1114
+ <img src="images/typical_isolated_web_application.png" alt="Architecture of a typical web application in isolation"></span></p></div>
1119
1115
  <div class="paragraph"><p>Few web applications are accessible directly by HTTP clients. Common models
1120
1116
  are:</p></div>
1121
- <div class="olist arabic"><ol class="arabic">
1117
+ <div class="olist arabic"><ol class="arabic">
1122
1118
  <li>
1123
1119
  <p>
1124
1120
  The web application is contained in an application server. This application
@@ -1132,7 +1128,7 @@ sent to the application server, which in turn sends them to the web server,
1132
1128
  and eventually to the HTTP client.
1133
1129
  </p>
1134
1130
  <div class="paragraph"><p>Typical examples of such a model:</p></div>
1135
- <div class="ulist"><ul>
1131
+ <div class="ulist"><ul>
1136
1132
  <li>
1137
1133
  <p>
1138
1134
  A J2EE application, contained in the Tomcat application server, proxied
@@ -1243,14 +1239,12 @@ This interface covers HTTP request and response handling, and is not dependent o
1243
1239
  any particular application server. The idea is that any Rack-compliant application
1244
1240
  server can implement the Rack specification and work with all Rack-compliant web applications.</p></div>
1245
1241
  <div class="paragraph"><p><span class="image">
1246
- <img src="images/rack.png" alt="images/rack.png">
1247
- </span></p></div>
1242
+ <img src="images/rack.png" alt="images/rack.png"></span></p></div>
1248
1243
  <div class="paragraph"><p>In the distant past, each Ruby web framework had its own interface, so application
1249
1244
  servers needed to explicitly add support for each web framework. Nowadays application
1250
1245
  servers just support Rack.</p></div>
1251
1246
  <div class="paragraph"><p><span class="image">
1252
- <img src="images/many_web_framework_protocols.png" alt="images/many_web_framework_protocols.png">
1253
- </span></p></div>
1247
+ <img src="images/many_web_framework_protocols.png" alt="images/many_web_framework_protocols.png"></span></p></div>
1254
1248
  <div class="paragraph"><p>Ruby on Rails has been fully Rack compliant since version 3.0. Rails 2.3 was partially
1255
1249
  Rack-compliant while earlier versions were not Rack-compliant at all. Phusion Passenger
1256
1250
  supports Rack as well as all Rails 1.x and 2.x versions.</p></div>
@@ -1300,10 +1294,9 @@ dynamic module system: all modules must be statically compiled into Nginx.</p></
1300
1294
  Phusion Passenger extends Apache/Nginx and allows it to act like an
1301
1295
  application server. This is shown in the following diagram:</p></div>
1302
1296
  <div class="paragraph"><p><span class="image">
1303
- <img src="images/passenger_architecture.png" alt="Passenger’s architecture">
1304
- </span></p></div>
1297
+ <img src="images/passenger_architecture.png" alt="Passenger’s architecture"></span></p></div>
1305
1298
  <div class="paragraph"><p>Phusion Passenger consists of:</p></div>
1306
- <div class="ulist"><ul>
1299
+ <div class="ulist"><ul>
1307
1300
  <li>
1308
1301
  <p>
1309
1302
  an Apache module, <em>mod_passenger</em>. This is written in C++, and can be found in the directory <em>ext/apache2</em>.
@@ -1338,7 +1331,7 @@ seconds on a modern computer, and possibly much longer on a heavily loaded serve
1338
1331
  A less naive implementation would keep spawned application processes alive,
1339
1332
  similar to how Lighttpd’s FastCGI implementation works.
1340
1333
  However, this still has several problems:</p></div>
1341
- <div class="olist arabic"><ol class="arabic">
1334
+ <div class="olist arabic"><ol class="arabic">
1342
1335
  <li>
1343
1336
  <p>
1344
1337
  The first request to a Rails website will be slow, and subsequent requests
@@ -1405,7 +1398,7 @@ idle for an extended period of time.</p></div>
1405
1398
  <a href="rdoc/index.html">The spawn server’s RDoc documentation</a> documents the
1406
1399
  implementation in detail.</p></div>
1407
1400
  <div class="paragraph"><p>The spawn server consists of 3 logical layers:</p></div>
1408
- <div class="olist arabic"><ol class="arabic">
1401
+ <div class="olist arabic"><ol class="arabic">
1409
1402
  <li>
1410
1403
  <p>
1411
1404
  <strong>The spawn manager.</strong> This is the topmost layer, and acts like a fascade for
@@ -1435,8 +1428,7 @@ implementation in detail.</p></div>
1435
1428
  </li>
1436
1429
  </ol></div>
1437
1430
  <div class="paragraph"><p><span class="image">
1438
- <img src="images/spawn_server_architecture.png" alt="The spawn server’s architecture">
1439
- </span></p></div>
1431
+ <img src="images/spawn_server_architecture.png" alt="The spawn server’s architecture"></span></p></div>
1440
1432
  <div class="paragraph"><p>As you can see, we have two layers of code caching: when the spawn server
1441
1433
  receives a request to spawn a new application instance, it will forward the
1442
1434
  request to the correct framework spawner server (and will spawn that framework
@@ -1468,9 +1460,9 @@ haven’t been written to. This means that all spawned Rails applications will
1468
1460
  application code, with each other. This results in a dramatic reduction in
1469
1461
  memory usage.</p></div>
1470
1462
  <div class="admonitionblock">
1471
- <table><tr>
1463
+ <table><tr>
1472
1464
  <td class="icon">
1473
- <img src="./images/icons/note.png" alt="Note">
1465
+ <img src="./images/icons/note.png" alt="Note">
1474
1466
  </td>
1475
1467
  <td class="content">
1476
1468
  <div class="paragraph"><p>Sharing memory only works if <a href="http://www.rubyenterpriseedition.com/">Ruby
@@ -1480,7 +1472,7 @@ Enterprise Edition website for technical details.</p></div>
1480
1472
  <div class="paragraph"><p>Passenger works fine with standard Ruby. You still get to enjoy reduced Rails
1481
1473
  startup times. You just won’t be able to benefit from memory sharing.</p></div>
1482
1474
  </td>
1483
- </tr></table>
1475
+ </tr></table>
1484
1476
  </div>
1485
1477
  <div class="paragraph"><p>Note that <a href="http://rubini.us/">Rubinius</a>'s garbage collector is already
1486
1478
  copy-on-write friendly.</p></div>
@@ -1493,7 +1485,7 @@ single request at the same time. This is obviously undesirable. But before we
1493
1485
  dive into the solution, let us take a look how the “competition” solves this
1494
1486
  problem. PHP has similar problems: a single PHP script can also process only
1495
1487
  one HTTP request at a time.</p></div>
1496
- <div class="ulist"><ul>
1488
+ <div class="ulist"><ul>
1497
1489
  <li>
1498
1490
  <p>
1499
1491
  mod_php “solves” this problem by using Apache’s MPM. In other words,
@@ -1531,8 +1523,7 @@ algorithm, which is non-trivial. The algorithm is documented in detail in
1531
1523
  Attribution-Share Alike 3.0 Unported License</a>.</p></div>
1532
1524
  <div class="paragraph"><p><span class="image">
1533
1525
  <a class="image" href="link:http://creativecommons.org/licenses/by-sa/3.0/">
1534
- <img src="images/by_sa.png" alt="images/by_sa.png">
1535
- </a>
1526
+ <img src="images/by_sa.png" alt="images/by_sa.png"></a>
1536
1527
  </span></p></div>
1537
1528
  </div>
1538
1529
  </div>
@@ -2050,5 +2041,5 @@ Mizuho.initializeTopBar = $.proxy(function() {
2050
2041
  $(document).ready(Mizuho.initializeTopBar);
2051
2042
 
2052
2043
  </script>
2053
- </body>
2044
+ </body>
2054
2045
  </html>
@@ -579,16 +579,17 @@ location configuration file, and the configuration depends on the
579
579
 
580
580
  <pre><code>[locations]
581
581
  natively_packaged=true
582
- bin=/usr/bin
583
- agents=/usr/lib/phusion-passenger/agents
584
- libdir=/usr/lib/phusion-passenger
585
- helper_scripts=/usr/share/phusion-passenger/helper-scripts
586
- resources=/usr/share/phusion-passenger
587
- includedir=/usr/share/phusion-passenger/include
588
- doc=/usr/share/doc/phusion-passenger
589
- rubylibdir=/usr/lib/ruby/vendor_ruby
590
- apache2_module=/usr/lib/apache2/modules/mod_passenger.so
591
- ruby_extension_source=/usr/share/phusion-passenger/ruby_extension_source
582
+ bin_dir=/usr/bin
583
+ agents_dir=/usr/lib/phusion-passenger/agents
584
+ lib_dir=/usr/lib/phusion-passenger
585
+ helper_scripts_dir=/usr/share/phusion-passenger/helper-scripts
586
+ resources_dir=/usr/share/phusion-passenger
587
+ include_dir=/usr/share/phusion-passenger/include
588
+ doc_dir=/usr/share/doc/phusion-passenger
589
+ ruby_libdir=/usr/lib/ruby/vendor_ruby
590
+ apache2_module_path=/usr/lib/apache2/modules/mod_passenger.so
591
+ ruby_extension_source_dir=/usr/share/phusion-passenger/ruby_extension_source
592
+ nginx_module_source_dir=/usr/share/phusion-passenger/ngx_http_passenger_module
592
593
  </code></pre>
593
594
 
594
595
  <p>All keys except fo <code>natively_packaged</code> specify the locations of assets and asset
@@ -656,13 +657,13 @@ a list of all possible assets and asset directories.</p>
656
657
  <p>When Phusion Passenger is originally packaged, this refers to the directory
657
658
  that contains the entire Phusion passenger source tree. Not available when
658
659
  natively packaged.</p></li>
659
- <li><p><code>bin</code></p>
660
+ <li><p><code>bin_dir</code></p>
660
661
 
661
662
  <p>A directory containing administration binaries and scripts and like
662
663
  <code>passenger-status</code>; tools that the user may directly invoke on the command line.</p>
663
664
 
664
665
  <p>Value when originally packaged: <code>&lt;SOURCE_ROOT&gt;/bin</code></p></li>
665
- <li><p><code>agents</code></p>
666
+ <li><p><code>agents_dir</code></p>
666
667
 
667
668
  <p>A directory that contains (platform-dependent) binaries that Phusion Passenger
668
669
  uses, but that should not be directly invoked from the command line. Things like
@@ -671,42 +672,42 @@ PassengerHelperAgent are located here.</p>
671
672
  <p>Value when originally packaged:</p>
672
673
 
673
674
  <ul>
674
- <li>Normally: <code>&lt;SOURCE_ROOT&gt;/agents</code></li>
675
+ <li>Normally: <code>&lt;SOURCE_ROOT&gt;/buildout/agents</code></li>
675
676
  <li>Passenger Standalone: <code>~/.passenger/standalone/&lt;VERSION&gt;/support-&lt;ARCH&gt;</code></li>
676
677
  </ul>
677
678
  </li>
678
- <li><p><code>helper_scripts</code></p>
679
+ <li><p><code>helper_scripts_dir</code></p>
679
680
 
680
681
  <p>A directory that contains non-binary scripts that Phusion Passenger uses, but
681
682
  that should not be directly invoked from the command line. Things like
682
683
  rack-loader.rb are located here.</p>
683
684
 
684
685
  <p>Value when originally packaged: <code>&lt;SOURCE_ROOT&gt;/helper-scripts</code></p></li>
685
- <li><p><code>resources</code></p>
686
+ <li><p><code>resources_dir</code></p>
686
687
 
687
688
  <p>A directory that contains non-executable, platform-independent resource files
688
689
  that the user should not directly access, like error page templates and
689
690
  configuration file templates.</p>
690
691
 
691
692
  <p>Value when originally packaged: <code>&lt;SOURCE_ROOT&gt;/resources</code>.</p></li>
692
- <li><p><code>doc</code></p>
693
+ <li><p><code>doc_dir</code></p>
693
694
 
694
695
  <p>A directory that contains documentation.</p>
695
696
 
696
697
  <p>Value when originally packaged: <code>&lt;SOURCE_ROOT&gt;/doc</code>.</p></li>
697
- <li><p><code>includedir</code></p>
698
+ <li><p><code>include_dir</code></p>
698
699
 
699
700
  <p>A directory that contains the Phusion Passenger header files that are
700
701
  necessary for compiling Nginx.</p>
701
702
 
702
703
  <p>Value when originally packaged: <code>&lt;SOURCE_ROOT&gt;/ext</code></p></li>
703
- <li><p><code>libdir</code></p>
704
+ <li><p><code>lib_dir</code></p>
704
705
 
705
706
  <p>A directory that contains the Phusion Passenger library files, e.g.
706
707
  libboost_oxt.a and various .o files.</p>
707
708
 
708
- <p>Value when originally packaged: <code>&lt;SOURCE_ROOT&gt;/libout</code></p></li>
709
- <li><p><code>rubylibdir</code></p>
709
+ <p>Value when originally packaged: <code>&lt;SOURCE_ROOT&gt;/buildout</code></p></li>
710
+ <li><p><code>ruby_libdir</code></p>
710
711
 
711
712
  <p>A directory that contains the Phusion Passenger Ruby library files. Note that
712
713
  the Phusion Passenger administration tools still locate phusion_passenger.rb
@@ -715,14 +716,14 @@ irregardless of the value of this key in the location configuration file.
715
716
  The value is only useful to non-Ruby Phusion Passenger code.</p>
716
717
 
717
718
  <p>Value when originally packaged: <code>&lt;SOURCE_ROOT&gt;/lib</code>.</p></li>
718
- <li><p><code>apache2_module</code></p>
719
+ <li><p><code>apache2_module_path</code></p>
719
720
 
720
721
  <p>The filename of the Apache 2 module, or the filename that the Apache 2 module
721
722
  will be stored after it's compiled. Used by <code>passenger-install-module</code> to
722
723
  print an example configuration snippet.</p>
723
724
 
724
- <p>Value when originally packaged: <code>&lt;SOURCE_ROOT&gt;/ext/apache2/mod_passenger.so</code>.</p></li>
725
- <li><p><code>ruby_extension_source</code></p>
725
+ <p>Value when originally packaged: <code>&lt;SOURCE_ROOT&gt;/buildout/apache2/mod_passenger.so</code>.</p></li>
726
+ <li><p><code>ruby_extension_source_dir</code></p>
726
727
 
727
728
  <p>The directory that contains the source code for the Phusion Passenger Ruby
728
729
  extension. Phusion Passenger uses these sources to build a Ruby extension,
@@ -730,6 +731,13 @@ when it detects that the user is using a new Ruby interpeter for which
730
731
  no Ruby extension has been compiled.</p>
731
732
 
732
733
  <p>Value when originally packaged: <code>&lt;SOURCE_ROOT&gt;/ext/ruby</code>.</p></li>
734
+ <li><p><code>nginx_module_source_dir</code></p>
735
+
736
+ <p>The directory that contains the source code for the Phusion Passenger Nginx
737
+ module. passenger-install-nginx-module uses these sources to build Nginx
738
+ with Phusion Passenger support.</p>
739
+
740
+ <p>Value when originally packaged: <code>&lt;SOURCE_ROOT&gt;/ext/nginx</code>.</p></li>
733
741
  </ul>
734
742
 
735
743