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
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZGVkMzYyMTlmMjgxNzMzZjM2OGUwZjcyZTA2NzNiYjMxODc0NzBiMg==
4
+ NDM2NTNjMzUzYmRhZmI2YzFmNTkyNTQ4OTQ0OWM3YjBhZTljYTVhYg==
5
5
  data.tar.gz: !binary |-
6
- OTBhOGFhYWM3MDY4YzU5Y2M2YmQ1MWQ0MWQ4YjQyNDVkNzc5ZDk5Nw==
6
+ ZjQ0NTUwNjQ1ZDNlZThlNzEwODUzOTJkOTM3N2QwNjQ5YTVlNjBhZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzU3MDE1MGEzYzExOTg2NmZlNDYxYzQ4YmQ0YzUwYWJhMjdlY2NiNWYxYTE1
10
- Nzc1ZDcxZWMxNWI1ZTY1Mzc5NDYxNWZlZWMwOGVlMjJjZGI4NTJjMGQxNzZk
11
- YjZiZTQ3OWI1ODZiNTMzMjU5MjEwZDY4ZmI2OWJkNDM1NDFkMTk=
9
+ NzQwMjVkYmUyMDAyMTllYzYwNmRkNGJmZDE2ZmM0OGY1ZDVjMmE2Mjk2YTRh
10
+ NDNkODliZGM4NjQwNWY4OTYwNWFmNTVlMzczNWZkN2I3MzZmYjM1ODNkZmVh
11
+ ZDJlNDQzY2M0ODY1Mjk2Y2U5ZTZhNmU3MzI1ZWNiYTczZmM5OWE=
12
12
  data.tar.gz: !binary |-
13
- ZThmNTdiODU2MDIwODgwNmJjM2FkYzNhMjhlNDNhNjAzNDk4MGQ1ZGJkYWZk
14
- OGEyMzM5MWNkNDcxMWNmNmEyNGFjOWNjYzAyMjNmNjRkNjViZTA4ODJjMTUw
15
- NjNmZjQzNmRjNTM3ODhmZTIyYWU1NGY0MzA4YzBlNzIzNzllYTY=
13
+ NGQ0OGNmYTAwMDI4MDg5YTQ3MzhhZTlkOGMwNmUyMzE4Y2UxNzFmMTY3NWQ4
14
+ NjExNGI4MzhhNjYyMDEzZjUwNmFhZTRmYjY5NmZmYWRjYzI0NTAzZWZhM2E1
15
+ NjliZTBiNmNkMWMwYmRlMzA4M2VkOTM0ZTNmNGVkZDk2MjFkOTE=
checksums.yaml.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
- iQEcBAABAgAGBQJVP5XZAAoJECrHRaUKISqMKj8IAIGrbTDuXh7udR1pCe9K5JHf
6
- wsBtEQvDAZpp+mPdwddODK5a/2e0UsXoHPniq9kZIESGv/plrlW5QdO8ISjPClHB
7
- H/VxlnaHFgqqCoIZUxNwtO6wMHaKRM80BJZj74UcZ5GtWhKi3fymgoJDXjKpltsv
8
- 6Og68fJdLKEDY9fYr9/V/32B7wk06cW6VTcZmZKYqUsKcroqcKUZqFmHmUddp6rf
9
- WUQb/ftEn2/kzOEvO4KemikyAjVVFftSLLXMAcpKqEPcEf8maaXALMdxffUPmdYm
10
- ljSQULByzhttNz+Aj+3l8P/UC6iMAGgZk0v6LGvm7acaSutMMOuE6Kxpc3XcM54=
11
- =/84R
5
+ iQEcBAABAgAGBQJVXENEAAoJECrHRaUKISqM1yIH/3iiP55teXIQdypzsniSos6Q
6
+ lDKqr0KDOAK1HRthLmc1xyTYPqzrHNqdJelH0Hj2SEw70aM5SSJ1miwTZPuwEThT
7
+ kzwk4+rSAoeUumxr5kqW5BHrcGj5KD5lVXDpYZbwP+Ggz/UJpC0mZ0g4AxbB9//R
8
+ azlnpXIjOcek1GmxvsTOsesFYX9DCKfHpC50Droc5biUtUm7x+GHzTwALazNyUkn
9
+ chlYoAzrORXkt9N2m5l/D3qOtYKZ9MMc4ZWFGrziGgdrwiRg8lon/V4xjcKdF2JB
10
+ tppn5PEczG5co6cJ69rrKFr88nH6xqnvipxjqiGRz5jou4OTBcy46F3YKYZi/CI=
11
+ =A3tu
12
12
  -----END PGP SIGNATURE-----
data.tar.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
- iQEcBAABAgAGBQJVP5XZAAoJECrHRaUKISqMA/4IAJ2gXqVHccGedmr4esxxyFYS
6
- RNHZgu+S/dmaC+BhuboGroSqnB3SMgR2R9efGU54NmnrDb6VJfeaj+iSSy9hTX4g
7
- 3TL849nKlZmwc/bY1A47aZ6CXsm5XoxFsry+j4eUD4yrkJasIAvJjlBhiOy2oVyO
8
- cgAt18iqpdN1SyA39akeX15Qufw6sDK+4XBlXzIR2w0pXG0aCIkvil3TYCVDxlRv
9
- ZEABXT+63H6wuGRk3rFut8JYGFspE1PXP6u0/KSauo+EcJvzASo8Z1Tkdu7WqZtZ
10
- HOpaspDAJaCosT2Is23dwoAqi6EK4NIFxWqD6mm9SnK9pChXbqJ8JqrYZjqtFtA=
11
- =jxZu
5
+ iQEcBAABAgAGBQJVXENEAAoJECrHRaUKISqMJu8H/j+UFpo8bgsMoBBAQmb9VFG8
6
+ A6l0wsFtxEnd1pFNkI4+KFT4olD/rpksJAUUAt2s3yXhfreTP1lkjO/eCSX2PBBp
7
+ DQc03J7XM05SHsoJ1Vo3HqWB0gIdZQ79xn0R0DAmlZQ2EubvqtskNUsb4Eu+0qIk
8
+ /sjt8yKGt2Q+ZSxfxQGWaA85ZCIIfXQOR7ZZG0Da/v917WZ5vWEO64yOT31eAR7p
9
+ KIUzyp8o/Cit5Z1+f7iX0IhhlUZJhcVgqXTm1dNuNyW8MOlRQU+N7nbT9Rk7Jhy5
10
+ ST6vX+Ay0nqi65wU5IkXmLwJe1n+bJBXnocLigfb6tYjGfLElYtYlCbyl61PCSo=
11
+ =gIJk
12
12
  -----END PGP SIGNATURE-----
data/CHANGELOG CHANGED
@@ -1,3 +1,20 @@
1
+ Release 5.0.8
2
+ -------------
3
+
4
+ * We now supply Debian 8 and Ubuntu 15.04 packages. Closes GH-1494 and GH-1400.
5
+ * We now supply Red Hat 6, Red Hat 7, CentOS 6 and CentOS 7 packages.
6
+ * We no longer supply Ubuntu 10.04 packages because Ubuntu 10.04 is no longer supported by Canonical.
7
+ * Fixes a Passenger crash (SIGSEGV) that occurs occasionally when out-of-band garbage collection is enabled. Closes GH-1469.
8
+ * Fixes a Passenger crash (SIGSEGV) that occurs occasionally with redirects to relative URLs. Closes GH-1513.
9
+ * Fixes cases when Passenger shuts down more processes than is allowed by the `min_instances` limit. Closes GH-1500.
10
+ * Fixes "Bad Gateway" errors that would occur when an application sets the X-Sendfile or X-Accel-Redirect header, together with a non-empty response body. Closes GH-1498.
11
+ * Fixes the fact that Passenger agent processes don't lower their privilege when user switching is turned off.
12
+ * Fixes autodetection of Apache on Gentoo. Closes GH-1510.
13
+ * Fixes compilation problems on Solaris. Closes GH-1508.
14
+ * [Standalone] Adds the `--pool-idle-time` command line parameter.
15
+ * [Standalone] Adds the `--auto` command line parameter for running non-interactively. This supresses prompts. Closes GH-1511.
16
+
17
+
1
18
  Release 5.0.7
2
19
  -------------
3
20
 
@@ -45,6 +45,8 @@ require 'optparse'
45
45
  require 'stringio'
46
46
  PhusionPassenger.require_passenger_lib 'constants'
47
47
  PhusionPassenger.require_passenger_lib 'platform_info/ruby'
48
+ PhusionPassenger.require_passenger_lib 'platform_info/operating_system'
49
+ PhusionPassenger.require_passenger_lib 'platform_info/linux'
48
50
  PhusionPassenger.require_passenger_lib 'platform_info/apache'
49
51
  PhusionPassenger.require_passenger_lib 'platform_info/apache_detector'
50
52
  PhusionPassenger.require_passenger_lib 'abstract_installer'
@@ -122,6 +124,7 @@ class Installer < PhusionPassenger::AbstractInstaller
122
124
 
123
125
  Dir.chdir(PhusionPassenger.build_system_dir)
124
126
  show_welcome_screen
127
+ check_selinux_and_suggest_rpm
125
128
  query_interested_languages
126
129
  check_gem_install_permission_problems || exit(1)
127
130
  check_directory_accessible_by_web_server
@@ -148,6 +151,28 @@ private
148
151
  wait
149
152
  end
150
153
 
154
+ def check_selinux_and_suggest_rpm
155
+ return if !PhusionPassenger.originally_packaged? ||
156
+ PlatformInfo.os_name != "linux" ||
157
+ !(PlatformInfo.linux_distro_tags.include?(:rhel) ||
158
+ PlatformInfo.linux_distro_tags.include?(:centos))
159
+ !PlatformInfo.find_command('sestatus')
160
+
161
+ begin
162
+ sestatus = `sestatus`
163
+ getenforce = `getenforce`
164
+ rescue Errno::ENOTENT
165
+ return
166
+ end
167
+
168
+ status = sestatus.scan(/^SELinux status:.*/).first
169
+ if status =~ /enabled/ && getenforce =~ /Enforcing/
170
+ new_screen
171
+ render_template 'apache2/rpm_installation_recommended'
172
+ wait
173
+ end
174
+ end
175
+
151
176
  def query_interested_languages
152
177
  menu = TerminalChoiceMenu.new(["Ruby", "Python", "Node.js", "Meteor"])
153
178
  menu["Ruby"].checked = interesting_language?('ruby')
@@ -381,10 +406,14 @@ private
381
406
  end
382
407
 
383
408
  def config_snippet
384
- return "<IfModule mod_passenger.c>\n" +
409
+ result = "<IfModule mod_passenger.c>\n" +
385
410
  " PassengerRoot #{PhusionPassenger.install_spec}\n" +
386
- " PassengerDefaultRuby #{PlatformInfo.ruby_command}\n" +
387
- "</IfModule>"
411
+ " PassengerDefaultRuby #{PlatformInfo.ruby_command}\n"
412
+ if PhusionPassenger.packaging_method == "rpm"
413
+ result << " PassengerInstanceRegistryDir /var/run/passenger-instreg\n"
414
+ end
415
+ result << "</IfModule>"
416
+ result
388
417
  end
389
418
 
390
419
  def apache2_config_snippets
@@ -782,8 +811,11 @@ private
782
811
  new_screen
783
812
  puts "<banner>Validating installation...</banner>"
784
813
  puts
785
- validator = PhusionPassenger::Config::ValidateInstallCommand.new([
786
- "--auto", "--validate-apache2", "--invoked-from-installer"])
814
+ args = ["--validate-apache2", "--invoked-from-installer"]
815
+ args << "--auto" if @auto
816
+ # The validator will get the path to apxs2 from the APXS2 environment
817
+ # variable that this installer sets.
818
+ validator = PhusionPassenger::Config::ValidateInstallCommand.new(args)
787
819
  exit_code = validator.run_and_get_exit_code
788
820
  STDOUT.write(@colors.default_terminal_color)
789
821
 
data/build/basics.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010-2014 Phusion
2
+ # Copyright (c) 2010-2015 Phusion
3
3
  #
4
4
  # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
5
  #
@@ -145,12 +145,14 @@ LIBEXT = PlatformInfo.library_extension
145
145
  USE_DMALLOC = boolean_option('USE_DMALLOC')
146
146
  USE_EFENCE = boolean_option('USE_EFENCE')
147
147
  USE_ASAN = boolean_option('USE_ASAN')
148
+ USE_SELINUX = boolean_option('USE_SELINUX')
148
149
  OPTIMIZE = boolean_option('OPTIMIZE')
149
150
  LTO = OPTIMIZE && boolean_option('LTO')
150
151
 
151
152
  # Agent-specific compiler flags.
152
153
  AGENT_CFLAGS = ""
153
154
  AGENT_CFLAGS << " -O" if OPTIMIZE
155
+ AGENT_CFLAGS << " -DUSE_SELINUX" if USE_SELINUX
154
156
  AGENT_CFLAGS << " -flto" if LTO
155
157
  AGENT_CFLAGS << " #{PlatformInfo.adress_sanitizer_flag}" if USE_ASAN
156
158
  AGENT_CFLAGS.strip!
@@ -162,6 +164,7 @@ AGENT_LDFLAGS << " -flto" if LTO
162
164
  AGENT_LDFLAGS << " #{PlatformInfo.dmalloc_ldflags}" if USE_DMALLOC
163
165
  AGENT_LDFLAGS << " #{PlatformInfo.electric_fence_ldflags}" if USE_EFENCE
164
166
  AGENT_LDFLAGS << " #{PlatformInfo.adress_sanitizer_flag}" if USE_ASAN
167
+ AGENT_LDFLAGS << " -lselinux" if USE_SELINUX
165
168
  # Extra linker flags for backtrace_symbols() to generate useful output (see AgentsBase.cpp).
166
169
  AGENT_LDFLAGS << " #{PlatformInfo.export_dynamic_flags}"
167
170
  # Enable dead symbol elimination on OS X.
@@ -1,5 +1,5 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010-2014 Phusion
2
+ # Copyright (c) 2010-2015 Phusion
3
3
  #
4
4
  # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
5
  #
@@ -91,12 +91,15 @@ task 'test:integration:native_packaging' do
91
91
  case PlatformInfo.os_name
92
92
  when "linux"
93
93
  if PlatformInfo.linux_distro_tags.include?(:debian)
94
+ rubylibdir = RbConfig::CONFIG["vendordir"]
94
95
  command = "env NATIVE_PACKAGING_METHOD=deb " +
95
- "LOCATIONS_INI=/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini " +
96
+ "LOCATIONS_INI=#{rubylibdir}/phusion_passenger/locations.ini " +
96
97
  command
97
98
  elsif PlatformInfo.linux_distro_tags.include?(:redhat)
99
+ vendorlibdir = RbConfig::CONFIG["vendorlibdir"]
100
+ locations_ini = File.join(vendorlibdir, "phusion_passenger/locations.ini")
98
101
  command = "env NATIVE_PACKAGING_METHOD=rpm " +
99
- "LOCATIONS_INI=/usr/lib/ruby/site_ruby/1.8/phusion_passenger/locations.ini " +
102
+ "LOCATIONS_INI=#{locations_ini} " +
100
103
  command
101
104
  else
102
105
  abort "Unsupported Linux distribution"
data/build/packaging.rb CHANGED
@@ -193,6 +193,8 @@ task 'package:release' => ['package:set_official', 'package:gem', 'package:tarba
193
193
  if !is_beta
194
194
  puts "Initiating building of Debian packages"
195
195
  Rake::Task['package:initiate_debian_building'].invoke
196
+ puts "Initiating building of RPM packages"
197
+ Rake::Task['package:initiate_rpm_building'].invoke
196
198
  end
197
199
 
198
200
  puts "Building OS X binaries..."
@@ -234,6 +236,8 @@ task 'package:release' => ['package:set_official', 'package:gem', 'package:tarba
234
236
  if !is_beta
235
237
  puts "Initiating building of Debian packages"
236
238
  Rake::Task['package:initiate_debian_building'].invoke
239
+ puts "Initiating building of RPM packages"
240
+ Rake::Task['package:initiate_rpm_building'].invoke
237
241
  end
238
242
 
239
243
  puts "Building OS X binaries..."
@@ -459,6 +463,54 @@ task 'package:initiate_debian_building' do
459
463
  puts "Initiated building of Debian packages."
460
464
  end
461
465
 
466
+ task 'package:initiate_rpm_building' do
467
+ require 'yaml'
468
+ require 'uri'
469
+ require 'net/http'
470
+ require 'net/https'
471
+ version = VERSION_STRING
472
+ begin
473
+ website_config = YAML.load_file(File.expand_path("~/.passenger_website.yml"))
474
+ rescue Errno::ENOENT
475
+ STDERR.puts "-------------------"
476
+ abort "*** ERROR: Please put the Phusion Passenger website admin " +
477
+ "password in ~/.passenger_website.yml:\n" +
478
+ "admin_password: ..."
479
+ end
480
+ if is_open_source?
481
+ type = "open%20source"
482
+ jenkins_token = website_config["jenkins_token"]
483
+ if !jenkins_token
484
+ abort "*** ERROR: Please put the Passenger open source Jenkins " +
485
+ "authentication token in ~/.passenger_website.yml, under " +
486
+ "the 'jenkins_token' key."
487
+ end
488
+ else
489
+ type = "Enterprise"
490
+ jenkins_token = website_config["jenkins_enterprise_token"]
491
+ if !jenkins_token
492
+ abort "*** ERROR: Please put the Passenger Enterprise Jenkins " +
493
+ "authentication token in ~/.passenger_website.yml, under " +
494
+ "the 'jenkins_enterprise_token' key."
495
+ end
496
+ end
497
+
498
+ uri = URI.parse("https://oss-jenkins.phusion.nl/buildByToken/buildWithParameters?" +
499
+ "job=Passenger%20#{type}%20RPM%20packages%20(release)&ref=#{git_tag}&repo=#{apt_repo_name}")
500
+ http = Net::HTTP.new(uri.host, uri.port)
501
+ http.use_ssl = true
502
+ http.verify_mode = OpenSSL::SSL::VERIFY_PEER
503
+ request = Net::HTTP::Post.new(uri.request_uri)
504
+ request.set_form_data("token" => jenkins_token)
505
+ response = http.request(request)
506
+ if response.code != 200 && response.body != "Scheduled.\n"
507
+ abort "*** ERROR: Cannot initiate building of RPM packages:\n" +
508
+ "Status: #{response.code}\n\n" +
509
+ response.body
510
+ end
511
+ puts "Initiated building of RPM packages."
512
+ end
513
+
462
514
  task 'package:build_osx_binaries' do
463
515
  if is_open_source?
464
516
  sh "cd ../passenger_autobuilder && " +
@@ -520,6 +572,8 @@ task :fakeroot => [:apache2, :nginx, :doc] do
520
572
  psg_apache2_module_path = ENV['APACHE2_MODULE_PATH'] || "#{fs_libdir}/apache2/modules/mod_passenger.so"
521
573
  psg_ruby_extension_source_dir = "#{fs_datadir}/#{GLOBAL_NAMESPACE_DIRNAME}/ruby_extension_source"
522
574
  psg_nginx_module_source_dir = "#{fs_datadir}/#{GLOBAL_NAMESPACE_DIRNAME}/ngx_http_passenger_module"
575
+ psg_ruby = ENV['RUBY'] || "#{fs_bindir}/ruby"
576
+ psg_free_ruby = ENV['FREE_RUBY'] || "/usr/bin/env ruby"
523
577
 
524
578
  fakeroot = "pkg/fakeroot"
525
579
  fake_rubylibdir = "#{fakeroot}#{psg_rubylibdir}"
@@ -616,18 +670,24 @@ task :fakeroot => [:apache2, :nginx, :doc] do
616
670
  sh "mkdir -p #{fake_bindir}"
617
671
  Packaging::USER_EXECUTABLES.each do |exe|
618
672
  sh "cp bin/#{exe} #{fake_bindir}/"
619
- if !Packaging::EXECUTABLES_WITH_FREE_RUBY.include?(exe)
620
- change_shebang("#{fake_bindir}/#{exe}", "#{fs_bindir}/ruby")
673
+ if Packaging::EXECUTABLES_WITH_FREE_RUBY.include?(exe)
674
+ shebang = psg_free_ruby
675
+ else
676
+ shebang = psg_ruby
621
677
  end
678
+ change_shebang("#{fake_bindir}/#{exe}", shebang)
622
679
  end
623
680
 
624
681
  # Superuser binaries
625
682
  sh "mkdir -p #{fake_sbindir}"
626
683
  Packaging::SUPER_USER_EXECUTABLES.each do |exe|
627
684
  sh "cp bin/#{exe} #{fake_sbindir}/"
628
- if !Packaging::EXECUTABLES_WITH_FREE_RUBY.include?(exe)
629
- change_shebang("#{fake_sbindir}/#{exe}", "#{fs_bindir}/ruby")
685
+ if Packaging::EXECUTABLES_WITH_FREE_RUBY.include?(exe)
686
+ shebang = psg_free_ruby
687
+ else
688
+ shebang = psg_ruby
630
689
  end
690
+ change_shebang("#{fake_sbindir}/#{exe}", shebang)
631
691
  end
632
692
 
633
693
  # Apache 2 module
@@ -13,9 +13,6 @@ fi
13
13
 
14
14
  JENKINS_CACHE_DIR="$WORKSPACE/.jenkins_cache"
15
15
  mkdir -p "$JENKINS_CACHE_DIR"
16
- if [[ "$TEST_RPM_BUILDING" != 0 ]]; then
17
- rm -rf "$JENKINS_CACHE_DIR/passenger_rpm/output"
18
- fi
19
16
 
20
17
  # run_travis.sh defaults COMPILE_CONCURRENCY to 2, but
21
18
  # Jenkins jobs are run on a single machine so we'll want
@@ -66,11 +63,8 @@ run_exec docker run --rm \
66
63
  -e "TEST_APACHE2=$TEST_APACHE2" \
67
64
  -e "TEST_STANDALONE=$TEST_STANDALONE" \
68
65
  -e "TEST_SOURCE_PACKAGING=$TEST_SOURCE_PACKAGING" \
69
- -e "TEST_DEBIAN_PACKAGING=$TEST_DEBIAN_PACKAGING" \
70
- -e "TEST_RPM_PACKAGING=$TEST_RPM_PACKAGING" \
71
- -e "TEST_RPM_BUILDING=$TEST_RPM_BUILDING" \
72
66
  phusion/apachai-hopachai-sandbox \
73
- python /passenger/packaging/rpm/internal/my_init --skip-runit --skip-startup-files --quiet -- \
67
+ python /passenger/packaging/rpm/internal/scripts/my_init --skip-runit --skip-startup-files --quiet -- \
74
68
  /passenger/dev/ci/inituidgid \
75
69
  /sbin/setuser appa \
76
70
  /bin/bash -lc "cd /passenger && exec ./dev/ci/run_travis.sh"
data/dev/ci/run_travis.sh CHANGED
@@ -23,8 +23,9 @@ export rvmsudo_secure_path=1
23
23
  export LC_CTYPE=C.UTF-8
24
24
  unset BUNDLE_GEMFILE
25
25
 
26
- if [[ -e /etc/workaround-docker-2267/hosts ]]; then
26
+ if [[ -e /etc/workaround-docker-2267 ]]; then
27
27
  HOSTS_FILE=/etc/workaround-docker-2267/hosts
28
+ sudo ln -s /etc/hosts /etc/workaround-docker-2267/hosts
28
29
  sudo workaround-docker-2267
29
30
  find /usr/local/rvm/rubies/*/lib/ruby -name resolv.rb | sudo xargs sed -i 's|/etc/hosts|/cte/hosts|g'
30
31
  else
@@ -208,39 +209,6 @@ if [[ "$TEST_STANDALONE" = 1 ]]; then
208
209
  run bundle exec drake -j$COMPILE_CONCURRENCY test:integration:standalone
209
210
  fi
210
211
 
211
- if [[ "$TEST_RPM_PACKAGING" = 1 ]]; then
212
- if [[ "$TEST_RPM_BUILDING" != 0 ]]; then
213
- pushd packaging/rpm
214
- run mkdir -p "$CACHE_DIR/passenger_rpm"
215
- run mkdir -p "$CACHE_DIR/passenger_rpm/cache"
216
- run mkdir "$CACHE_DIR/passenger_rpm/output"
217
- run ./build -S "$PASSENGER_ROOT_ON_DOCKER_HOST/packaging/rpm" \
218
- -P "$PASSENGER_ROOT_ON_DOCKER_HOST" \
219
- -o "$CACHE_DIR_ON_DOCKER_HOST/passenger_rpm/output" \
220
- -c "$CACHE_DIR_ON_DOCKER_HOST/passenger_rpm/cache" \
221
- -d el6 -a x86_64
222
- popd >/dev/null
223
- fi
224
-
225
- echo "------------- Testing built RPMs -------------"
226
- run cp "test/config.json.rpm-automation" "test/config.json"
227
- run mkdir -p "$CACHE_DIR/passenger_rpm/output/el6-x86_64"
228
- if [[ "$TEST_RPM_BUILDING" != 0 ]]; then
229
- run rm "$CACHE_DIR/passenger_rpm/output/el6-x86_64"/*.src.rpm
230
- fi
231
- run docker run --rm \
232
- -v "$PASSENGER_ROOT_ON_DOCKER_HOST/packaging/rpm:/system:ro" \
233
- -v "$PASSENGER_ROOT_ON_DOCKER_HOST:/passenger" \
234
- -v "$CACHE_DIR_ON_DOCKER_HOST/passenger_rpm/output/el6-x86_64:/packages:ro" \
235
- -e "APP_UID=`id -u`" \
236
- -e "APP_GID=`id -g`" \
237
- phusion/passenger_rpm_automation \
238
- /system/internal/my_init --skip-runit --skip-startup-files --quiet -- \
239
- /system/internal/inituidgid \
240
- /bin/bash -c "cd /passenger && exec ./dev/ci/run_rpm_tests.sh"
241
- run cp "test/config.json.travis" "test/config.json"
242
- fi
243
-
244
212
  if [[ "$TEST_SOURCE_PACKAGING" = 1 ]]; then
245
213
  apt_get_update
246
214
  run sudo apt-get install -y --no-install-recommends source-highlight
@@ -1113,7 +1113,9 @@ using the command line.</p></div>
1113
1113
  <div class="foo toclevel3"><a href="#install_on_debian_ubuntu">2.3. Installing or upgrading on Debian or Ubuntu</a></div>
1114
1114
  <div class="foo toclevel4"><a href="#install_add_apt_repo">2.3.1. Adding our APT repository</a></div>
1115
1115
  <div class="foo toclevel4"><a href="#_installing_packages">2.3.2. Installing packages</a></div>
1116
- <div class="foo toclevel3"><a href="#_installing_or_upgrading_on_red_hat_fedora_centos_or_scientificlinux">2.4. Installing or upgrading on Red Hat, Fedora, CentOS or ScientificLinux</a></div>
1116
+ <div class="foo toclevel3"><a href="#installing_or_upgrading_on_red_hat">2.4. Installing or upgrading on Red Hat or CentOS</a></div>
1117
+ <div class="foo toclevel4"><a href="#install_add_yum_repo">2.4.1. Adding our YUM repository</a></div>
1118
+ <div class="foo toclevel4"><a href="#_installing_packages_2">2.4.2. Installing packages</a></div>
1117
1119
  <div class="foo toclevel3"><a href="#_installing_or_upgrading_on_heroku">2.5. Installing or upgrading on Heroku</a></div>
1118
1120
  <div class="foo toclevel3"><a href="#rubygems_generic_install">2.6. Generic installation, upgrade and downgrade method: via RubyGems</a></div>
1119
1121
  <div class="foo toclevel3"><a href="#tarball_generic_install">2.7. Generic installation, upgrade and downgrade method: via tarball</a></div>
@@ -1239,7 +1241,7 @@ using the command line.</p></div>
1239
1241
  <div class="foo toclevel3"><a href="#_os_x_the_installer_cannot_locate_mamp_8217_s_apache">8.4. OS X: The installer cannot locate MAMP’s Apache</a></div>
1240
1242
  <div class="foo toclevel3"><a href="#_apache_reports_a_403_forbidden_error">8.5. Apache reports a "403 Forbidden" error</a></div>
1241
1243
  <div class="foo toclevel3"><a href="#_static_assets_such_as_images_and_stylesheets_aren_8217_t_being_displayed">8.6. Static assets such as images and stylesheets aren’t being displayed</a></div>
1242
- <div class="foo toclevel3"><a href="#_the_apache_error_log_says_that_the_spawn_manager_script_does_not_exist_or_that_it_does_not_have_permission_to_execute_it">8.7. The Apache error log says that the spawn manager script does not exist, or that it does not have permission to execute it</a></div>
1244
+ <div class="foo toclevel3"><a href="#apache_selinux_permissions">8.7. Apache cannot access my app’s files because of SELinux errors</a></div>
1243
1245
  <div class="foo toclevel3"><a href="#_the_application_thinks_its_not_on_ssl_even_though_it_is">8.8. The application thinks its not on SSL even though it is</a></div>
1244
1246
  <div class="foo toclevel3"><a href="#_ruby_on_rails_specific_troubleshooting">8.9. Ruby on Rails-specific troubleshooting</a></div>
1245
1247
  <div class="foo toclevel4"><a href="#_the_about_your_application_8217_s_environment_link_does_not_work">8.9.1. The "About your application’s environment" link does not work</a></div>
@@ -1260,7 +1262,8 @@ using the command line.</p></div>
1260
1262
  <div class="foo toclevel4"><a href="#_requirements">10.1.1. Requirements</a></div>
1261
1263
  <div class="foo toclevel4"><a href="#_effects">10.1.2. Effects</a></div>
1262
1264
  <div class="foo toclevel4"><a href="#_caveats_amp_troubleshooting">10.1.3. Caveats &amp; troubleshooting</a></div>
1263
- <div class="foo toclevel4"><a href="#finding_out_app_user">10.1.4. Finding out what user an application is running as</a></div>
1265
+ <div class="foo toclevel4"><a href="#user_switching_rpm_caveats">10.1.4. Red Hat and CentOS caveats</a></div>
1266
+ <div class="foo toclevel4"><a href="#finding_out_app_user">10.1.5. Finding out what user an application is running as</a></div>
1264
1267
  <div class="foo toclevel3"><a href="#reducing_memory_usage">10.2. Copy-on-write memory support (reducing memory consumption of Ruby applications)</a></div>
1265
1268
  <div class="foo toclevel3"><a href="#tuning_sse_websockets">10.3. Tuning for Server Sent Events and WebSockets</a></div>
1266
1269
  <div class="foo toclevel3"><a href="#bundler_support">10.4. Bundler support</a></div>
@@ -1583,12 +1586,14 @@ by Lorenzo Bettini
1583
1586
  http://www.lorenzobettini.it
1584
1587
  http://www.gnu.org/software/src-highlite -->
1585
1588
  <pre><tt><span style="font-style: italic"><span style="color: #9A1900">##### !!!! Only add ONE of these lines, not all of them !!!! #####</span></span>
1589
+ <span style="font-style: italic"><span style="color: #9A1900"># Ubuntu 15.04</span></span>
1590
+ deb https<span style="color: #990000">:</span>//oss-binaries<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/apt/passenger vivid main
1586
1591
  <span style="font-style: italic"><span style="color: #9A1900"># Ubuntu 14.04</span></span>
1587
1592
  deb https<span style="color: #990000">:</span>//oss-binaries<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/apt/passenger trusty main
1588
1593
  <span style="font-style: italic"><span style="color: #9A1900"># Ubuntu 12.04</span></span>
1589
1594
  deb https<span style="color: #990000">:</span>//oss-binaries<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/apt/passenger precise main
1590
- <span style="font-style: italic"><span style="color: #9A1900"># Ubuntu 10.04</span></span>
1591
- deb https<span style="color: #990000">:</span>//oss-binaries<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/apt/passenger lucid main
1595
+ <span style="font-style: italic"><span style="color: #9A1900"># Debian 8</span></span>
1596
+ deb https<span style="color: #990000">:</span>//oss-binaries<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/apt/passenger jessie main
1592
1597
  <span style="font-style: italic"><span style="color: #9A1900"># Debian 7</span></span>
1593
1598
  deb https<span style="color: #990000">:</span>//oss-binaries<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/apt/passenger wheezy main
1594
1599
  <span style="font-style: italic"><span style="color: #9A1900"># Debian 6</span></span>
@@ -1607,12 +1612,14 @@ by Lorenzo Bettini
1607
1612
  http://www.lorenzobettini.it
1608
1613
  http://www.gnu.org/software/src-highlite -->
1609
1614
  <pre><tt><span style="font-style: italic"><span style="color: #9A1900">##### !!!! Only add ONE of these lines, not all of them !!!! #####</span></span>
1615
+ <span style="font-style: italic"><span style="color: #9A1900"># Ubuntu 15.04</span></span>
1616
+ deb https<span style="color: #990000">:</span>//download<span style="color: #990000">:</span>YOUR_DOWNLOAD_TOKEN@www<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/enterprise_apt vivid main
1610
1617
  <span style="font-style: italic"><span style="color: #9A1900"># Ubuntu 14.04</span></span>
1611
1618
  deb https<span style="color: #990000">:</span>//download<span style="color: #990000">:</span>YOUR_DOWNLOAD_TOKEN@www<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/enterprise_apt trusty main
1612
1619
  <span style="font-style: italic"><span style="color: #9A1900"># Ubuntu 12.04</span></span>
1613
1620
  deb https<span style="color: #990000">:</span>//download<span style="color: #990000">:</span>YOUR_DOWNLOAD_TOKEN@www<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/enterprise_apt precise main
1614
- <span style="font-style: italic"><span style="color: #9A1900"># Ubuntu 10.04</span></span>
1615
- deb https<span style="color: #990000">:</span>//download<span style="color: #990000">:</span>YOUR_DOWNLOAD_TOKEN@www<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/enterprise_apt lucid main
1621
+ <span style="font-style: italic"><span style="color: #9A1900"># Debian 8</span></span>
1622
+ deb https<span style="color: #990000">:</span>//download<span style="color: #990000">:</span>YOUR_DOWNLOAD_TOKEN@www<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/enterprise_apt jessie main
1616
1623
  <span style="font-style: italic"><span style="color: #9A1900"># Debian 7</span></span>
1617
1624
  deb https<span style="color: #990000">:</span>//download<span style="color: #990000">:</span>YOUR_DOWNLOAD_TOKEN@www<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/enterprise_apt wheezy main
1618
1625
  <span style="font-style: italic"><span style="color: #9A1900"># Debian 6</span></span>
@@ -1735,83 +1742,155 @@ sudo apache2ctl stop; sudo apache2ctl start</pre>
1735
1742
  </div>
1736
1743
  </div>
1737
1744
  <div class="sect2">
1738
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_installing_or_upgrading_on_red_hat_fedora_centos_or_scientificlinux"></span><h3 data-comment-topic="installing-or-upgrading-on-red-hat-fedora-centos-or-scientificlinux-1y5ie8b" data-anchor="_installing_or_upgrading_on_red_hat_fedora_centos_or_scientificlinux">2.4. Installing or upgrading on Red Hat, Fedora, CentOS or ScientificLinux</h3>
1739
- <div class="admonitionblock">
1740
- <table><tr>
1741
- <td class="icon">
1742
- <img src="./images/icons/warning.png" alt="Warning">
1743
- </td>
1744
- <td class="content">The RPMs are currently unmaintained. As such, the repository only contains Phusion Passenger 3.x (the latest version is 4.x), which did not support Node.js, Meteor, multiple Rubies, etc. For more recent versions of Phusion Passenger, you are suggested to install from gem or tarball instead.</td>
1745
- </tr></table>
1746
- </div>
1747
- <div class="paragraph"><p>YUM repositories with RPMs are maintained by <a href="https://github.com/erikogan/passenger">Erik Ogan</a> and <a href="http://stealthymonkeys.com/">Stealthy Monkeys Consulting</a>. Only packages for the open source version of Phusion Passenger are provided. <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a> customers should use the <a href="#rubygems_generic_install">generic RubyGems installation method</a> or <a href="#tarball_generic_install">the generic tarball installation method</a> instead.</p></div>
1748
- <div class="paragraph"><p>If you use YUM to install Phusion Passenger then you do not need to run <span class="monospaced">passenger-install-apache2-module</span> or <span class="monospaced">passenger-install-nginx-module</span>. The YUM packages contain all the binaries that you need. You also don’t need to modify any Apache or Nginx configuration to get them to load Phusion Passenger, the packages provide configuration snippets for you as well.</p></div>
1749
- <span class="anchor_helper" id="_step_1_import_the_stealthy_monkeys_consulting_8217_s_gpg_key"></span><h4 class="float" data-anchor="_step_1_import_the_stealthy_monkeys_consulting_8217_s_gpg_key">Step 1: Import the Stealthy Monkeys Consulting’s GPG key</h4>
1745
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="installing_or_upgrading_on_red_hat"></span><h3 data-comment-topic="installing-or-upgrading-on-red-hat-fedora-centos-or-scientificlinux-1y5ie8b" data-anchor="installing_or_upgrading_on_red_hat">2.4. Installing or upgrading on Red Hat or CentOS</h3>
1746
+ <div class="paragraph"><p>We provide an official Phusion Passenger YUM repository with packages for Red Hat Enterprise Linux and CentOS. These packages are automatically built by our build server after we push out a source release, and thus are always up to date with the official source releases.</p></div>
1747
+ <div class="paragraph"><p>If you use these packages to install Phusion Passenger then you do not need to run <span class="monospaced">passenger-install-apache2-module</span> or <span class="monospaced">passenger-install-nginx-module</span>. These packages contain all the binaries that you need. These packages also come with SELinux policy modules so that Passenger works nicely with SELinux.</p></div>
1748
+ <div class="paragraph"><p>Packages are available for the x86 and x86_64 architectures. Our policy is to support all Red Hat and CentOS releases that still receive full updates by their vendors. The earliest Red Hat and CentOS version we support is version 5.</p></div>
1749
+ <div class="sect3">
1750
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="install_add_yum_repo"></span><h4 data-comment-topic="adding-our-yum-repository-1fb671i" data-anchor="install_add_yum_repo">2.4.1. Adding our YUM repository</h4>
1751
+ <div class="olist arabic"><ol class="arabic">
1752
+ <li>
1753
+ <p>
1754
+ Install <a href="https://fedoraproject.org/wiki/EPEL">EPEL</a> and a few other prerequisites.
1755
+ </p>
1750
1756
  <div class="listingblock">
1751
1757
  <div class="content monospaced">
1752
- <pre>rpm --import http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc</pre>
1758
+ <pre>sudo yum install epel-release pygpgme curl</pre>
1753
1759
  </div>
1754
1760
  </div>
1755
- <span class="anchor_helper" id="_step_2_install_the_release_package"></span><h4 class="float" data-anchor="_step_2_install_the_release_package">Step 2: Install the release package</h4>
1756
- <div class="paragraph"><p>Install the passenger-release package from the <a href="http://passenger.stealthymonkeys.com/">main repository</a>.</p></div>
1757
- <div class="paragraph"><p>Fedora Core 17:</p></div>
1761
+ </li>
1762
+ <li>
1763
+ <p>
1764
+ Download the Passenger YUM repository definition.
1765
+ </p>
1766
+ <div class="dlist"><dl>
1767
+ <dt class="hdlist1">
1768
+ <strong>Open source</strong>
1769
+ </dt>
1770
+ <dd>
1758
1771
  <div class="listingblock">
1759
1772
  <div class="content monospaced">
1760
- <pre>yum install http://passenger.stealthymonkeys.com/fedora/17/passenger-release.noarch.rpm</pre>
1773
+ <pre>sudo curl --fail -sSLo /etc/yum.repos.d/passenger.repo https://oss-binaries.phusionpassenger.com/yum/definitions/el-passenger.repo</pre>
1761
1774
  </div>
1762
1775
  </div>
1763
- <div class="paragraph"><p>Fedora Core 16:</p></div>
1776
+ </dd>
1777
+ <dt class="hdlist1">
1778
+ <strong>Enterprise</strong>
1779
+ </dt>
1780
+ <dd>
1764
1781
  <div class="listingblock">
1765
1782
  <div class="content monospaced">
1766
- <pre>yum install http://passenger.stealthymonkeys.com/fedora/16/passenger-release.noarch.rpm</pre>
1783
+ <pre>unset HISTFILE
1784
+ sudo curl --fail -sSLo -u download:YOUR_DOWNLOAD_TOKEN /etc/yum.repos.d/passenger.repo https://www.phusionpassenger.com/enterprise_yum/el-passenger-enterprise.repo</pre>
1767
1785
  </div>
1768
1786
  </div>
1769
- <div class="paragraph"><p>Fedora Core 15:</p></div>
1787
+ <div class="paragraph"><p>The <span class="monospaced">unset HISTFILE</span> command ensures that your download token isn’t saved to the Bash history file.</p></div>
1788
+ <div class="paragraph"><p>You can find the correct value for <em>YOUR_DOWNLOAD_TOKEN</em> in the <a href="https://www.phusionpassenger.com/orders">Customer Area</a>.</p></div>
1789
+ </dd>
1790
+ </dl></div>
1791
+ </li>
1792
+ <li>
1793
+ <p>
1794
+ Secure <span class="monospaced">passenger.repo</span>:
1795
+ </p>
1770
1796
  <div class="listingblock">
1771
1797
  <div class="content monospaced">
1772
- <pre>yum install http://passenger.stealthymonkeys.com/fedora/15/passenger-release.noarch.rpm</pre>
1798
+ <pre>sudo chown root: /etc/yum.repos.d/passenger.repo
1799
+ sudo chmod 600 /etc/yum.repos.d/passenger.repo</pre>
1773
1800
  </div>
1774
1801
  </div>
1775
- <div class="paragraph"><p>Fedora Core 14:</p></div>
1776
- <div class="listingblock">
1777
- <div class="content monospaced">
1778
- <pre>yum install http://passenger.stealthymonkeys.com/fedora/14/passenger-release.noarch.rpm</pre>
1779
- </div>
1802
+ </li>
1803
+ </ol></div>
1780
1804
  </div>
1781
- <div class="paragraph"><p>RHEL 6 / CentOS 6 / ScientificLinux 6: (Note: these packages depend on <a href="http://fedoraproject.org/wiki/EPEL">EPEL</a>.)</p></div>
1782
- <div class="listingblock">
1783
- <div class="content monospaced">
1784
- <pre>yum install http://passenger.stealthymonkeys.com/rhel/6/passenger-release.noarch.rpm</pre>
1785
- </div>
1805
+ <div class="sect3">
1806
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_installing_packages_2"></span><h4 data-comment-topic="installing-packages-12a3uty" data-anchor="_installing_packages_2">2.4.2. Installing packages</h4>
1807
+ <div class="admonitionblock">
1808
+ <table><tr>
1809
+ <td class="icon">
1810
+ <img src="./images/icons/note.png" alt="Note">
1811
+ </td>
1812
+ <td class="content">
1813
+ <div class="title">Notes about SELinux on Red Hat 6 and CentOS 6</div>
1814
+ <div class="paragraph"><p>If you are on Red Hat 6 or CentOS 6, and you are also using SELinux in enforcing mode, then Passenger requires kernel &gt;= 2.6.39.</p></div>
1815
+ <div class="paragraph"><p>If you want to install Passenger on Red Hat 6 or CentOS 6, without upgrading your kernel, then you must <strong>disable</strong> SELinux completely. Edit <span class="monospaced">/etc/selinux/config</span>, set <span class="monospaced">SELINUX=disabled</span> and reboot. Note that merely setting SELinux to permissive mode is not enough.</p></div>
1816
+ <div class="paragraph"><p>This issue does not apply to Red Hat &gt;= 7 and CentOS &gt;= 7, because these OS versions supply recent enough kernel versions.</p></div>
1817
+ </td>
1818
+ </tr></table>
1786
1819
  </div>
1787
- <div class="paragraph"><p>RHEL 5 / CentOS 5 / ScientificLinux 5: (Note: these packages depend on <a href="http://fedoraproject.org/wiki/EPEL">EPEL</a>.)</p></div>
1820
+ <div class="paragraph"><p>You can install the Passenger packages as follows.</p></div>
1821
+ <div class="dlist"><dl>
1822
+ <dt class="hdlist1">
1823
+ <strong>Open source</strong>
1824
+ </dt>
1825
+ <dd>
1826
+ <div class="olist arabic"><ol class="arabic">
1827
+ <li>
1828
+ <p>
1829
+ <a href="#install_add_yum_repo">Add our YUM repository.</a>
1830
+ </p>
1831
+ </li>
1832
+ <li>
1833
+ <p>
1834
+ Install the package:
1835
+ </p>
1788
1836
  <div class="listingblock">
1789
1837
  <div class="content monospaced">
1790
- <pre>rpm -Uvh http://passenger.stealthymonkeys.com/rhel/5/passenger-release.noarch.rpm</pre>
1838
+ <pre>sudo yum install mod_passenger</pre>
1791
1839
  </div>
1792
1840
  </div>
1793
- <span class="anchor_helper" id="_step_3_install_the_right_phusion_passenger_package"></span><h4 class="float" data-anchor="_step_3_install_the_right_phusion_passenger_package">Step 3: Install the right Phusion Passenger package</h4>
1794
- <div class="paragraph"><p>From there you can use <a href="http://prefetch.net/articles/yum.html">YUM</a> to install packages. For example, try one of these:</p></div>
1795
- <div class="paragraph"><p>Phusion Passenger for Apache:</p></div>
1841
+ </li>
1842
+ <li>
1843
+ <p>
1844
+ Stop/start Apache (reload or restart is not enough when upgrading):
1845
+ </p>
1796
1846
  <div class="listingblock">
1797
1847
  <div class="content monospaced">
1798
- <pre>yum install mod_passenger</pre>
1848
+ <pre>sudo service httpd stop; sudo service httpd start</pre>
1799
1849
  </div>
1800
1850
  </div>
1801
- <div class="paragraph"><p>Phusion Passenger for Nginx:</p></div>
1851
+ </li>
1852
+ </ol></div>
1853
+ </dd>
1854
+ <dt class="hdlist1">
1855
+ <strong>Enterprise</strong>
1856
+ </dt>
1857
+ <dd>
1858
+ <div class="olist arabic"><ol class="arabic">
1859
+ <li>
1860
+ <p>
1861
+ Download your license key from the <a href="https://www.phusionpassenger.com/orders">Customer Area</a> and save it as <span class="monospaced">/etc/passenger-enterprise-license</span>.
1862
+ </p>
1863
+ </li>
1864
+ <li>
1865
+ <p>
1866
+ <a href="#install_add_yum_repo">Add our YUM repository.</a>
1867
+ </p>
1868
+ </li>
1869
+ <li>
1870
+ <p>
1871
+ Install the packages:
1872
+ </p>
1802
1873
  <div class="listingblock">
1803
1874
  <div class="content monospaced">
1804
- <pre>yum install nginx-passenger</pre>
1875
+ <pre>sudo yum install mod_passenger_enterprise</pre>
1805
1876
  </div>
1806
1877
  </div>
1807
- <div class="paragraph"><p>Phusion Passenger Standalone:</p></div>
1878
+ </li>
1879
+ <li>
1880
+ <p>
1881
+ Stop/start Apache (reload or restart is not enough when upgrading):
1882
+ </p>
1808
1883
  <div class="listingblock">
1809
1884
  <div class="content monospaced">
1810
- <pre>yum install passenger-standalone</pre>
1885
+ <pre>sudo service httpd stop; sudo service httpd start</pre>
1811
1886
  </div>
1812
1887
  </div>
1813
- <span class="anchor_helper" id="_building_your_own_packages"></span><h4 class="float" data-anchor="_building_your_own_packages">Building your own packages</h4>
1814
- <div class="paragraph"><p>There are instructions for building your own packages and Yum repositories in the <a href="https://github.com/phusion/passenger/tree/master/rpm#readme">rpm directory ReadMe</a> within the <a href="https://github.com/phusion/passenger">GitHub repository</a>.</p></div>
1888
+ </li>
1889
+ </ol></div>
1890
+ </dd>
1891
+ </dl></div>
1892
+ <div class="paragraph"><p>You can now proceed with a chapter for Deploying your (specific type of) application.</p></div>
1893
+ </div>
1815
1894
  </div>
1816
1895
  <div class="sect2">
1817
1896
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_installing_or_upgrading_on_heroku"></span><h3 data-comment-topic="installing-or-upgrading-on-heroku-o0o2mk" data-anchor="_installing_or_upgrading_on_heroku">2.5. Installing or upgrading on Heroku</h3>
@@ -4165,6 +4244,14 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
4165
4244
  <div class="paragraph"><p>Whether to enable <a href="#user_switching">user switching support</a>.</p></div>
4166
4245
  <div class="paragraph"><p>This option may only occur once, in the global server configuration.
4167
4246
  The default value is <em>on</em>.</p></div>
4247
+ <div class="admonitionblock">
4248
+ <table><tr>
4249
+ <td class="icon">
4250
+ <img src="./images/icons/warning.png" alt="Warning">
4251
+ </td>
4252
+ <td class="content">If you’re on Red Hat or CentOS, be sure to read <a href="#user_switching_rpm_caveats">the Red Hat and CentOS user switching caveats</a>.</td>
4253
+ </tr></table>
4254
+ </div>
4168
4255
  </div>
4169
4256
  <div class="sect3">
4170
4257
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerUser"></span><h4 data-comment-topic="passengeruser" data-anchor="PassengerUser">7.5.2. PassengerUser &lt;username&gt;</h4>
@@ -5695,15 +5782,19 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
5695
5782
  <div class="paragraph"><p>It is therefore important that, while Phusion Passenger is working, the instance directory is never removed or tampered with. However, the default path for the instance registry directory is the system’s temporary directory, and some systems may run background jobs that periodically clean this directory. If this happens, and the files inside the instance directory are removed, then it will cause Phusion Passenger to malfunction: Phusion Passenger won’t be able to communicate with its own processes, and you will see all kinds of connection errors in the log files. This malfunction can only be recovered from by restarting Apache. You can prevent such cleaning background jobs from interfering by setting this option to a different directory.</p></div>
5696
5783
  <div class="paragraph"><p>This option is also useful if Apache is not allowed to write to the system’s temporary directory (which is the case on some systems with strict SELinux policies) or if the partition that the temporary directory lives on doesn’t have enough disk space.</p></div>
5697
5784
  <div class="paragraph"><p>The instance directory is automatically removed when Apache shuts down.</p></div>
5698
- <div class="paragraph"><p>This option may be specified once, in the global server configuration. The default value is the value of the <span class="monospaced">$TMPDIR</span> environment variable. Or, if <span class="monospaced">$TMPDIR</span> is not set, <span class="monospaced">/tmp</span>.</p></div>
5699
- <div class="admonitionblock">
5700
- <table><tr>
5701
- <td class="icon">
5702
- <img src="./images/icons/note.png" alt="Note">
5703
- </td>
5704
- <td class="content">This option has no effect when you are using <a href="#flying_passenger">Flying Passenger</a>. Instead, you should configure this by passing the <span class="monospaced">--instance-registry-dir</span> command line option to the Flying Passenger daemon.</td>
5705
- </tr></table>
5706
- </div>
5785
+ <div class="paragraph"><p>This option may be specified once, in the global server configuration. The default value is as follows:</p></div>
5786
+ <div class="ulist"><ul>
5787
+ <li>
5788
+ <p>
5789
+ If you are on Red Hat and CentOS, and installed Passenger through the RPMs provided by Phusion, then the default value is <span class="monospaced">/var/run/passenger-instreg</span>.
5790
+ </p>
5791
+ </li>
5792
+ <li>
5793
+ <p>
5794
+ Otherwise, the default value is the value of the <span class="monospaced">$TMPDIR</span> environment variable. Or, if <span class="monospaced">$TMPDIR</span> is not set, <span class="monospaced">/tmp</span>.
5795
+ </p>
5796
+ </li>
5797
+ </ul></div>
5707
5798
  <div class="paragraph">
5708
5799
  <div class="title">Note regarding command line tools</div>
5709
5800
  <p>Some Phusion Passenger command line administration tools, such as <span class="monospaced">passenger-status</span>, must know what Phusion Passenger’s instance registry directory is in order to function properly. You can pass the directory through the <span class="monospaced">PASSENGER_INSTANCE_REGISTRY_DIR</span> or the <span class="monospaced">TMPDIR</span> environment variable.</p>
@@ -6017,46 +6108,15 @@ The Apache process doesn’t have permission to access your Rails application’
6017
6108
  </ol></div>
6018
6109
  </div>
6019
6110
  <div class="sect2">
6020
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_the_apache_error_log_says_that_the_spawn_manager_script_does_not_exist_or_that_it_does_not_have_permission_to_execute_it"></span><h3 data-comment-topic="the-apache-error-log-says-that-the-spawn-manager-script-does-not-exist-or-that-it-does-not-have-permission-to-execute-it-1fmoozk" data-anchor="_the_apache_error_log_says_that_the_spawn_manager_script_does_not_exist_or_that_it_does_not_have_permission_to_execute_it">8.7. The Apache error log says that the spawn manager script does not exist, or that it does not have permission to execute it</h3>
6021
- <div class="paragraph"><p>If you are sure that the <em>PassengerRoot</em> configuration option is set correctly,
6022
- then this problem is most likely caused by the fact that you’re running Apache
6023
- with SELinux. On Fedora, CentOS and RedHat Enterprise Linux, Apache is locked
6024
- down by SELinux policies.</p></div>
6025
- <div class="paragraph"><p>To solve this problem, you must set some permissions on the Phusion Passenger files
6026
- and folders, so that Apache can access them.</p></div>
6027
- <div class="ulist"><ul>
6028
- <li>
6029
- <p>
6030
- If you’ve installed Phusion Passenger via a gem, then run this command to determine
6031
- Phusion Passenger’s root folder:
6032
- </p>
6033
- <div class="listingblock">
6034
- <div class="content monospaced">
6035
- <pre>passenger-config --root</pre>
6036
- </div>
6037
- </div>
6038
- <div class="paragraph"><p>Next, run the following command:</p></div>
6111
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="apache_selinux_permissions"></span><h3 data-comment-topic="apache-cannot-access-my-app-s-files-because-of-selinux-errors-6febhd" data-anchor="apache_selinux_permissions">8.7. Apache cannot access my app’s files because of SELinux errors</h3>
6112
+ <div class="paragraph"><p>On Red Hat Enterprise Linux and CentOS, Apache is locked down by a security mechanism called SELinux. This security mechanism works on top of normal Unix permissions. In order for Apache to be able to access your app’s files, you must set the proper SELinux labels on your files.</p></div>
6113
+ <div class="paragraph"><p>First, ensure that your app does not live in a home directory. It is not possible to allow Apache to read files from your home directory.</p></div>
6114
+ <div class="paragraph"><p>Second, give your app’s files the <span class="monospaced">httpd_sys_content_t</span> labels by running the following command:</p></div>
6039
6115
  <div class="listingblock">
6040
6116
  <div class="content monospaced">
6041
- <pre>chcon -R -h -t httpd_sys_content_t /path-to-passenger-root</pre>
6117
+ <pre>sudo chcon -R -h -t httpd_sys_content_t /path-to-your-app</pre>
6042
6118
  </div>
6043
6119
  </div>
6044
- <div class="paragraph"><p>where <em>/path-to-passenger-root</em> should be replaced with whatever
6045
- <span class="monospaced">passenger-config --root</span> printed.</p></div>
6046
- </li>
6047
- <li>
6048
- <p>
6049
- If you’ve installed Phusion Passenger via the source tarball, then run the following
6050
- command:
6051
- </p>
6052
- <div class="listingblock">
6053
- <div class="content monospaced">
6054
- <pre>chcon -R -h -t httpd_sys_content_t /path/to/passenger/folder</pre>
6055
- </div>
6056
- </div>
6057
- </li>
6058
- </ul></div>
6059
- <div class="paragraph"><p>Once the permissions are fixed, restart Apache.</p></div>
6060
6120
  </div>
6061
6121
  <div class="sect2">
6062
6122
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_the_application_thinks_its_not_on_ssl_even_though_it_is"></span><h3 data-comment-topic="the-application-thinks-its-not-on-ssl-even-though-it-is-u9fcp1" data-anchor="_the_application_thinks_its_not_on_ssl_even_though_it_is">8.8. The application thinks its not on SSL even though it is</h3>
@@ -6572,7 +6632,35 @@ The application fails to start and its error message mentions the path <em>/none
6572
6632
  <div class="paragraph"><p>Whatever user your application runs as, it must have read access to the <a href="#application_root">application root</a>, and read/write access to the application’s <em>logs</em> directory.</p></div>
6573
6633
  </div>
6574
6634
  <div class="sect3">
6575
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="finding_out_app_user"></span><h4 data-comment-topic="finding-out-what-user-an-application-is-running-as-7uwrol" data-anchor="finding_out_app_user">10.1.4. Finding out what user an application is running as</h4>
6635
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="user_switching_rpm_caveats"></span><h4 data-comment-topic="red-hat-and-centos-caveats-1335bpz" data-anchor="user_switching_rpm_caveats">10.1.4. Red Hat and CentOS caveats</h4>
6636
+ <div class="admonitionblock">
6637
+ <table><tr>
6638
+ <td class="icon">
6639
+ <img src="./images/icons/note.png" alt="Note">
6640
+ </td>
6641
+ <td class="content">This information only applies if you installed Passenger through the RPM packages provided by Phusion. If you did not installed Passenger through the RPM packages provided by Phusion, then you can ignore this section.</td>
6642
+ </tr></table>
6643
+ </div>
6644
+ <div class="paragraph"><p>If you installed Passenger through Phusion’s RPM packages, and you want to disable user switching, then you must also change <a href="#PassengerInstanceRegistryDir">the location of the instance registry directory</a>.</p></div>
6645
+ <div class="paragraph"><p>This is because our RPMs configure the default instance registry directory to <span class="monospaced">/var/run/passenger-instreg</span>, which is only writable by root. If you disable user switching, then the Passenger processes will run as
6646
+ <a href="#PassengerDefaultUser">PassengerDefaultUser</a>,
6647
+ which (as long as it’s not root) won’t be able to write to that directory.</p></div>
6648
+ <div class="paragraph"><p>Note that any alternative instance registry directory must have the proper SELinux context, allowing the web server to read and write to it. We recommend that you create a directory <span class="monospaced">/var/lib/passenger-instreg</span> and give it the label <span class="monospaced">var_run_t</span>:</p></div>
6649
+ <div class="listingblock">
6650
+ <div class="content monospaced">
6651
+ <pre>sudo mkdir /var/lib/passenger-instreg
6652
+ sudo chcon -t var_run_t /var/lib/passenger-instreg</pre>
6653
+ </div>
6654
+ </div>
6655
+ <div class="paragraph"><p>Then, in your Apache config file:</p></div>
6656
+ <div class="listingblock">
6657
+ <div class="content monospaced">
6658
+ <pre>PassengerInstanceRegistryDir /var/lib/passenger-instreg</pre>
6659
+ </div>
6660
+ </div>
6661
+ </div>
6662
+ <div class="sect3">
6663
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="finding_out_app_user"></span><h4 data-comment-topic="finding-out-what-user-an-application-is-running-as-7uwrol" data-anchor="finding_out_app_user">10.1.5. Finding out what user an application is running as</h4>
6576
6664
  <div class="paragraph"><p>To find our what user an application is started as, first access its URL in your browser so that Phusion Passenger starts the application. For example:</p></div>
6577
6665
  <div class="listingblock">
6578
6666
  <div class="content monospaced">