passenger 5.0.7 → 5.0.8

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 (50) hide show
  1. checksums.yaml +8 -8
  2. checksums.yaml.gz.asc +7 -7
  3. data.tar.gz.asc +7 -7
  4. data/CHANGELOG +17 -0
  5. data/bin/passenger-install-apache2-module +37 -5
  6. data/build/basics.rb +4 -1
  7. data/build/integration_tests.rb +6 -3
  8. data/build/packaging.rb +64 -4
  9. data/dev/ci/run_jenkins.sh +1 -7
  10. data/dev/ci/run_travis.sh +2 -34
  11. data/doc/Users guide Apache.html +184 -96
  12. data/doc/Users guide Apache.idmap.txt +9 -3
  13. data/doc/Users guide Apache.txt +11 -31
  14. data/doc/Users guide Nginx.html +192 -53
  15. data/doc/Users guide Nginx.idmap.txt +9 -3
  16. data/doc/Users guide Nginx.txt +7 -2
  17. data/doc/Users guide Standalone.html +113 -55
  18. data/doc/Users guide Standalone.idmap.txt +5 -1
  19. data/doc/users_guide_snippets/installation.txt +130 -66
  20. data/doc/users_guide_snippets/tips.txt +38 -0
  21. data/ext/apache2/Hooks.cpp +28 -2
  22. data/ext/common/AgentsStarter.h +6 -0
  23. data/ext/common/ApplicationPool2/AppTypes.h +1 -1
  24. data/ext/common/ApplicationPool2/Group.h +25 -3
  25. data/ext/common/ApplicationPool2/Options.h +1 -1
  26. data/ext/common/ApplicationPool2/Pool/GarbageCollection.h +6 -3
  27. data/ext/common/Constants.h +3 -1
  28. data/ext/common/ServerKit/http_parser.cpp +7 -1
  29. data/ext/common/agents/HelperAgent/Main.cpp +53 -0
  30. data/ext/common/agents/HelperAgent/RequestHandler.h +4 -0
  31. data/ext/common/agents/HelperAgent/RequestHandler/ForwardResponse.cpp +6 -0
  32. data/ext/nginx/ngx_http_passenger_module.c +2 -2
  33. data/lib/phusion_passenger.rb +15 -2
  34. data/lib/phusion_passenger/admin_tools/instance_registry.rb +40 -27
  35. data/lib/phusion_passenger/config/install_agent_command.rb +4 -0
  36. data/lib/phusion_passenger/config/install_standalone_runtime_command.rb +6 -0
  37. data/lib/phusion_passenger/config/installation_utils.rb +8 -2
  38. data/lib/phusion_passenger/config/nginx_engine_compiler.rb +16 -7
  39. data/lib/phusion_passenger/config/validate_install_command.rb +87 -11
  40. data/lib/phusion_passenger/constants.rb +2 -0
  41. data/lib/phusion_passenger/platform_info/apache.rb +114 -33
  42. data/lib/phusion_passenger/platform_info/apache_detector.rb +28 -4
  43. data/lib/phusion_passenger/platform_info/compiler.rb +22 -27
  44. data/lib/phusion_passenger/standalone/start_command.rb +16 -3
  45. data/lib/phusion_passenger/standalone/start_command/builtin_engine.rb +1 -0
  46. data/resources/templates/apache2/rpm_installation_recommended.txt.erb +19 -0
  47. data/resources/templates/standalone/config.erb +3 -2
  48. metadata +3 -3
  49. metadata.gz.asc +7 -7
  50. data/dev/ci/run_rpm_tests.sh +0 -80
@@ -196,11 +196,23 @@ module PhusionPassenger
196
196
  end
197
197
 
198
198
  if @results.empty?
199
+ PhusionPassenger.require_passenger_lib 'platform_info/depcheck'
200
+ PlatformInfo::Depcheck.load("depcheck_specs/apache2")
201
+ apache2 = PlatformInfo::Depcheck.find("apache2")
202
+ apache2_install_instructions = apache2.install_instructions.split("\n").join("\n ")
203
+ # apxs2 is part of the development headers.
204
+ apache2_dev = PlatformInfo::Depcheck.find("apache2-dev")
205
+ apache2_dev_install_instructions = apache2_dev.install_instructions.split("\n").join("\n ")
206
+
199
207
  log "<red>Sorry, this program cannot find an Apache installation.</red>"
200
208
  log ""
201
- log "To install Apache, please run the following. It will tell you how to install Apache."
209
+ log "Please install Apache and its development headers."
210
+ log ""
211
+ log " <yellow>* To install Apache:</yellow>"
212
+ log " #{apache2_install_instructions}"
202
213
  log ""
203
- log " <b>#{PhusionPassenger.bin_dir}/passenger-install-apache2-module</b>"
214
+ log " <yellow>* To install Apache development headers:</yellow>"
215
+ log " #{apache2_dev_install_instructions}"
204
216
  log ""
205
217
  log "If you are sure that you have Apache installed, please read the documentation:"
206
218
  log "<b>#{APACHE2_DOC_URL}#forcing_location_of_command_line_tools_and_dependencies</b>"
@@ -213,7 +225,7 @@ module PhusionPassenger
213
225
 
214
226
  def result_for(apxs2)
215
227
  # All the results use realpaths, so the input must too.
216
- apxs2 = Pathname.new(apxs2).realpath
228
+ apxs2 = try_realpath(apxs2)
217
229
  return @results.find { |r| r.apxs2 == apxs2 }
218
230
  end
219
231
 
@@ -234,7 +246,7 @@ module PhusionPassenger
234
246
  def remove_symlink_duplications(filenames)
235
247
  old_size = filenames.size
236
248
  filenames = filenames.map do |filename|
237
- Pathname.new(filename).realpath
249
+ try_realpath(filename)
238
250
  end
239
251
  filenames.uniq!
240
252
  if old_size != filenames.size
@@ -251,6 +263,18 @@ module PhusionPassenger
251
263
  @failures += 1
252
264
  end
253
265
  end
266
+
267
+ def try_realpath(path)
268
+ if path
269
+ begin
270
+ Pathname.new(path).realpath.to_s
271
+ rescue Errno::ENOENT, Errno::EACCES
272
+ path
273
+ end
274
+ else
275
+ nil
276
+ end
277
+ end
254
278
  end
255
279
 
256
280
  end
@@ -261,6 +261,7 @@ module PhusionPassenger
261
261
  # for that too.
262
262
  def self.try_compile_with_warning_flag(description, language, source, flags = nil)
263
263
  extension = detect_language_extension(language)
264
+ result = nil
264
265
  create_temp_file("passenger-compile-check.#{extension}") do |filename, f|
265
266
  f.puts(source)
266
267
  f.close
@@ -268,8 +269,27 @@ module PhusionPassenger
268
269
  "-c '#{filename}' -o '#{filename}.o'",
269
270
  flags)
270
271
  result = run_compiler(description, command, filename, source, true)
271
- return result && result[:result] && result[:output] !~ /unknown warning option/i
272
+ result = result && result[:result] && result[:output] !~ /unknown warning option/i
272
273
  end
274
+ return false if !result
275
+
276
+ # For some reason, GCC does not complain about a warning flag
277
+ # not being supported unless the source contains another error. So we
278
+ # check for this.
279
+ create_temp_file("passenger-compile-check.#{extension}") do |filename, f|
280
+ source = %Q{
281
+ void foo() {
282
+ return error;
283
+ }
284
+ }
285
+ f.puts(source)
286
+ f.close
287
+ command = create_compiler_command(language,
288
+ "-c '#{filename}' -o '#{filename}.o'",
289
+ flags)
290
+ result = run_compiler("#{description} (really)", command, filename, source, :always)
291
+ end
292
+ result && !result[:output].include?(flags)
273
293
  end
274
294
 
275
295
  def self.try_link(description, language, source, flags = nil)
@@ -378,34 +398,9 @@ module PhusionPassenger
378
398
  memoize :cxx_supports_no_tls_direct_seg_refs_option?, true
379
399
 
380
400
  def self.compiler_supports_wno_ambiguous_member_template?
381
- result = try_compile_with_warning_flag(
401
+ try_compile_with_warning_flag(
382
402
  "Checking for C++ compiler '-Wno-ambiguous-member-template' support",
383
403
  :cxx, '', '-Wno-ambiguous-member-template')
384
- return false if !result
385
-
386
- # For some reason, GCC does not complain about -Wno-ambiguous-member-template
387
- # not being supported unless the source contains another error. So we
388
- # check for this.
389
- create_temp_file("passenger-compile-check.cpp") do |filename, f|
390
- source = %Q{
391
- void foo() {
392
- return error;
393
- }
394
- }
395
- f.puts(source)
396
- f.close
397
- begin
398
- command = create_compiler_command(:cxx,
399
- "-c '#{filename}' -o '#{filename}.o'",
400
- '-Wno-ambiguous-member-template')
401
- result = run_compiler("Checking whether C++ compiler '-Wno-ambiguous-member-template' support is *really* supported",
402
- command, filename, source, :always)
403
- ensure
404
- File.unlink("#{filename}.o") rescue nil
405
- end
406
- end
407
-
408
- return result && result[:output] !~ /-Wno-ambiguous-member-template/
409
404
  end
410
405
  memoize :compiler_supports_wno_ambiguous_member_template?, true
411
406
 
@@ -46,6 +46,7 @@ module PhusionPassenger
46
46
  :engine => "nginx",
47
47
  :nginx_version => PREFERRED_NGINX_VERSION,
48
48
  :log_level => DEFAULT_LOG_LEVEL,
49
+ :auto => !STDIN.tty? || !STDOUT.tty?,
49
50
  :ctls => [],
50
51
  :envvars => {}
51
52
  }.freeze
@@ -246,6 +247,11 @@ module PhusionPassenger
246
247
  "application. Default: 1") do |value|
247
248
  options[:min_instances] = value
248
249
  end
250
+ opts.on("--pool-idle-time SECONDS", Integer,
251
+ "Maximum time that processes may be idle.#{nl}" +
252
+ "Default: #{DEFAULT_POOL_IDLE_TIME}") do |value|
253
+ options[:pool_idle_time] = value
254
+ end
249
255
  opts.on("--concurrency-model NAME", String,
250
256
  "The concurrency model to use, either#{nl}" +
251
257
  "'process' or 'thread' (Enterprise only).#{nl}" +
@@ -335,6 +341,10 @@ module PhusionPassenger
335
341
  opts.on("--log-level NUMBER", Integer, "Log level to use. Default: #{DEFAULT_LOG_LEVEL}") do |value|
336
342
  options[:log_level] = value
337
343
  end
344
+ opts.on("--auto", "Run in non-interactive mode. Default when#{nl}" +
345
+ "stdin or stdout is not a TTY") do
346
+ options[:auto] = true
347
+ end
338
348
  opts.on("--ctl NAME=VALUE", String) do |value|
339
349
  if value !~ /=.+/
340
350
  abort "*** ERROR: invalid --ctl format: #{value}"
@@ -479,6 +489,9 @@ module PhusionPassenger
479
489
  "--connect-timeout", "0",
480
490
  "--idle-timeout", "0"
481
491
  ]
492
+ if @options[:auto]
493
+ args << "--auto"
494
+ end
482
495
  if @options[:binaries_url_root]
483
496
  args << "--url-root"
484
497
  args << @options[:binaries_url_root]
@@ -732,7 +745,7 @@ module PhusionPassenger
732
745
  trap("INT", "DEFAULT")
733
746
  trap("TERM", "DEFAULT")
734
747
  end
735
-
748
+
736
749
  def trapped_intterm(signal)
737
750
  if @traps_captured == 1
738
751
  @traps_captured += 1
@@ -741,11 +754,11 @@ module PhusionPassenger
741
754
  exit!(1)
742
755
  end
743
756
  end
744
-
757
+
745
758
  def trapsafe_shutdown_and_cleanup(error_occurred)
746
759
  # Ignore INT and TERM once, to allow clean shutdown in e.g. Foreman
747
760
  capture_traps_intterm
748
-
761
+
749
762
  # Stop engine
750
763
  if @engine && (error_occurred || should_wait_until_engine_has_exited?)
751
764
  @console_mutex.synchronize do
@@ -134,6 +134,7 @@ module PhusionPassenger
134
134
  add_flag_param(command, :load_shell_envvars, "--load-shell-envvars")
135
135
  add_param(command, :max_pool_size, "--max-pool-size")
136
136
  add_param(command, :min_instances, "--min-instances")
137
+ add_param(command, :pool_idle_time, "--pool-idle-time")
137
138
  add_enterprise_param(command, :concurrency_model, "--concurrency-model")
138
139
  add_enterprise_param(command, :thread_count, "--app-thread-count")
139
140
  add_enterprise_param(command, :max_request_time, "--max-request-time")
@@ -0,0 +1,19 @@
1
+ <banner>Installation through RPMs recommended</banner>
2
+
3
+ It looks like you are on a Red Hat or CentOS operating system, with <b>SELinux</b>
4
+ enabled. SELinux is a security mechanism for which special <%= SHORT_PROGRAM_NAME %>-specific
5
+ configuration is required. We supply this configuration as part of
6
+ our <%= SHORT_PROGRAM_NAME %> <b>RPMs</b>.
7
+
8
+ However, <%= SHORT_PROGRAM_NAME %> is currently installed through <%= PhusionPassenger.packaging_method_description %> and does not
9
+ include any SELinux configuration. Therefore, we recommend that you:
10
+
11
+ 1. Uninstall your current <%= SHORT_PROGRAM_NAME %> install.
12
+ 2. Reinstall <%= SHORT_PROGRAM_NAME %> through the RPMs that we provide:
13
+ <yellow><%= APACHE2_DOC_URL %>#installing_or_upgrading_on_red_hat</yellow>
14
+
15
+ What would you like to do?
16
+
17
+ <b>Press Ctrl-C to exit this installer so that you can install RPMs (recommended)</b>
18
+ -OR-
19
+ <b>Press Enter to continue using this installer anyway</b>
@@ -41,7 +41,7 @@ events {
41
41
  http {
42
42
  log_format debug '[$time_local] $msec "$request" $status conn=$connection sent=$bytes_sent body_sent=$body_bytes_sent';
43
43
  include '<%= PhusionPassenger.resources_dir %>/mime.types';
44
-
44
+
45
45
  <% if @options[:ruby] %>
46
46
  passenger_ruby <%= @options[:ruby] %>;
47
47
  <% else %>
@@ -53,7 +53,7 @@ http {
53
53
  <% if @options[:python] %>
54
54
  passenger_python <%= @options[:python] %>;
55
55
  <% end %>
56
-
56
+
57
57
  passenger_root '<%= PhusionPassenger.install_spec %>';
58
58
  passenger_abort_on_startup_error on;
59
59
  passenger_ctl cleanup_pidfiles <%= serialize_strset("#{@working_dir}/temp_dir_toucher.pid") %>;
@@ -61,6 +61,7 @@ http {
61
61
  <%= nginx_option :passenger_log_level, :log_level %>
62
62
  <%= nginx_option :passenger_max_pool_size, :max_pool_size %>
63
63
  <%= nginx_option :passenger_min_instances, :min_instances %>
64
+ <%= nginx_option :passenger_pool_idle_time, :pool_idle_time %>
64
65
  <% if @options[:user] %>
65
66
  passenger_user <%= @options[:user] %>;
66
67
  passenger_default_user <%= @options[:user] %>;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: passenger
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.7
4
+ version: 5.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phusion - http://www.phusion.nl/
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-28 00:00:00.000000000 Z
11
+ date: 2015-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -87,7 +87,6 @@ files:
87
87
  - configure
88
88
  - dev/ci/inituidgid
89
89
  - dev/ci/run_jenkins.sh
90
- - dev/ci/run_rpm_tests.sh
91
90
  - dev/ci/run_travis.sh
92
91
  - dev/copy_boost_headers
93
92
  - dev/install_scripts_bootstrap_code.rb
@@ -2848,6 +2847,7 @@ files:
2848
2847
  - resources/templates/apache2/notify_apache_module_installed.txt.erb
2849
2848
  - resources/templates/apache2/possible_solutions_for_compilation_and_installation_problems.txt.erb
2850
2849
  - resources/templates/apache2/present_choice_for_no_update_config.txt.erb
2850
+ - resources/templates/apache2/rpm_installation_recommended.txt.erb
2851
2851
  - resources/templates/apache2/run_installer_as_root_for_apache_analysis.txt.erb
2852
2852
  - resources/templates/apache2/welcome.txt.erb
2853
2853
  - resources/templates/config/agent_compiler/confirm_enable_optimizations.txt.erb
metadata.gz.asc CHANGED
@@ -2,11 +2,11 @@
2
2
  Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
3
3
  Comment: GPGTools - http://gpgtools.org
4
4
 
5
- iQEcBAABAgAGBQJVP5XYAAoJECrHRaUKISqMX2UIALXnyIQNfxL8pzYSq0RXsULD
6
- ee9zcpGYagIQAsRw5fgUrdp3GJ2zVAPqKNkJjG0D5eRnTLLTyPlW+xLUVJ3CKmMU
7
- ftF9N7cId4tGlrKBpoN4Nm3QRK27R8cUwN/P50sealilHU6M/DWGJxpNJszWwwl4
8
- EMjfv42MerPL1cgG0w+UPgnrw5+UFCuQzzbfmIxpCMb7JUdfhZb/lgI5PQa+PCaF
9
- /DAJh6UVK95DHdOlmocwmiytrB0dujMP2RBOyav/7sNLcLa2CHJ7jDsCI6/jiS5e
10
- hz4hvQVIgmo1KqtJ34syOg45voK1Q6hsa0MPzI7GSjwoWUkoT2drP+a3f+dug64=
11
- =l9PY
5
+ iQEcBAABAgAGBQJVXENEAAoJECrHRaUKISqMhb0IAJ8sPfHIu3QKdUjqAzvIKlcF
6
+ imKJ4SKMnC9EYcR/Tk7bSQhsvL+43WxshTYjgwO0KLa8MVs5mF/RydgOl6bo9Ofo
7
+ V9+Pm8nRjcVGMfudHeWgIj5s9VxcHdCSIsYL7QP2j0dDtf92NOXzqvZv7KflMRyq
8
+ Ukbe8kq7NOgiYqCHjXETfE/pviFKFplRFk2xj385mPiPE/cBAXuwr6ktiF5EPywt
9
+ fc626wfeyg0S67ulkMrxRYJOYHX5ot/oL04W3+8NAn4gTFUPfkyeRKtWI3CyS/0t
10
+ ROFhAi7oIfVScOc0yfGJRQqBuYeQ5U92EvX9Afwd7vRBz6CAyWFlfRi/rA+9SSg=
11
+ =8IeM
12
12
  -----END PGP SIGNATURE-----
@@ -1,80 +0,0 @@
1
- #!/bin/bash
2
- # This script is run by run_travis.sh, to execute RPM packaging tests in the CI environment.
3
-
4
- set -e
5
-
6
- function run()
7
- {
8
- echo "$ $@"
9
- "$@"
10
- }
11
-
12
- function retry_run()
13
- {
14
- local reset='\x1B[0m'
15
- local red='\x1B[31m'
16
- local yellow='\x1B[33m'
17
-
18
- local max_tries="$1"
19
- local number=2
20
- shift
21
-
22
- echo "$ $@"
23
- while true; do
24
- if "$@"; then
25
- return 0
26
- elif [[ $number -le $max_tries ]]; then
27
- echo -e "${yellow}The command \"$@\" failed. Retrying, $number of $max_tries:${reset}"
28
- (( number++ ))
29
- else
30
- echo -e "${red}The command \"$@\" failed after $max_tries attempts. Giving up.${reset}"
31
- return 1
32
- fi
33
- done
34
- }
35
-
36
- function yum_install()
37
- {
38
- run yum install -y --skip-broken --enablerepo centosplus "$@"
39
- }
40
-
41
-
42
- export CACHING=false
43
- export DEVDEPS_DEFAULT=no
44
-
45
- echo '%_excludedocs 0' > /etc/rpm/macros.imgcreate
46
- sed -i 's/nodocs//' /etc/yum.conf
47
-
48
- cp /etc/hosts /etc/workaround-docker-2267/hosts
49
- cat >> /etc/workaround-docker-2267/hosts <<EOF
50
- 127.0.0.1 passenger.test
51
- 127.0.0.1 mycook.passenger.test
52
- 127.0.0.1 zsfa.passenger.test
53
- 127.0.0.1 norails.passenger.test
54
- 127.0.0.1 1.passenger.test 2.passenger.test 3.passenger.test
55
- 127.0.0.1 4.passenger.test 5.passenger.test 6.passenger.test
56
- 127.0.0.1 7.passenger.test 8.passenger.test 9.passenger.test
57
- EOF
58
-
59
- yum_install /packages/*.x86_64.rpm /packages/*.noarch.rpm
60
- perl -pi -e 's:/etc/hosts:/cte/hosts:g' /lib64/libnss_files.so.2 /lib64/libc.so.6 /lib64/libresolv.so.2
61
- sed -i 's|/etc/hosts|/cte/hosts|g' /usr/lib/ruby/1.8/resolv.rb
62
- chown -R app: /var/log/nginx /var/lib/nginx
63
-
64
- yum_install gdb
65
- gem install crash-watch --no-rdoc --no-ri
66
-
67
-
68
- cd /passenger
69
- retry_run 3 /system/internal/setuser app \
70
- rake test:install_deps BASE_DEPS=yes SUDO=1
71
- retry_run 3 /system/internal/setuser app \
72
- scl enable nodejs010 'rake test:install_deps NODE_MODULES=yes'
73
- run /system/internal/setuser app \
74
- rake test:integration:native_packaging
75
- run /system/internal/setuser app \
76
- env PASSENGER_LOCATION_CONFIGURATION_FILE=/usr/lib/ruby/site_ruby/1.8/phusion_passenger/locations.ini \
77
- scl enable python27 nodejs010 'rake test:integration:apache2'
78
- run /system/internal/setuser app \
79
- env PASSENGER_LOCATION_CONFIGURATION_FILE=/usr/lib/ruby/site_ruby/1.8/phusion_passenger/locations.ini \
80
- scl enable python27 nodejs010 'rake test:integration:nginx'