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
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
- iQEcBAABAgAGBQJR5WamAAoJECrHRaUKISqMsmoH/igRg7U+YBfKIrRjpDo1Dq3S
6
- /aaIPmBo9QudDtB2I50CbldyvDQGYmHEogQXXENZVEHe4erFvhhpHVAO4l4SEpBN
7
- 0vd2M8DXTx8QZX+AF4JwHnWG+xqLzRYgoa6vTaukZpuHjVSHD70eDs3GSNcIYQZw
8
- 83OS6pwq11UZ7TAJk/poovo7B224+K1Nqxl/RUCqlBPLuWGchtuPUSn3W/HTWN39
9
- SMry/gVXWWkQ2O0rIBFGy6HyhV+SVJ1gkOIoei/P+4CNDl/9g7xdRlQSCycwQuaL
10
- fm7Jf6VFnrp3WHIK2zd4++5/RyRYCt4ngOmzXzbR8/czsaf64A9cEKTSlw7OV1Y=
11
- =r1UX
5
+ iQEcBAABAgAGBQJSDPHCAAoJECrHRaUKISqMLiEH/A4OA7fXNqA3/aIzUn5coY6J
6
+ MMmrKyTHGxL743dWP2ja28TCIoq41TfDUsWodPbVVUSXQOfOOP83Inz9xa4JB9mw
7
+ cCU47RgmsFKsDtiwsXA0JLAtynzMMC1bk4doVWI7dh8pfckKDfwk4MvS5aMoCfyr
8
+ 98Irb7YO7hrsGAdk6NU60HghxnF661TnSTdN4IJLImQDGeuXIxRBSvE5HY13cUOO
9
+ 9zi+UiGHTSq/1ZKs06NV+OjYXijD4H5U+a8yX/Oxz1mZTKg6/4bHWp16CshphDjp
10
+ 9KqEfXgU9M+izSamX9xy3AIcJgpw8pg/PPvIljXdryUf2IAkPwcgF5ZwJhtAXfE=
11
+ =1Fig
12
12
  -----END PGP SIGNATURE-----
@@ -0,0 +1,66 @@
1
+ .cache
2
+ .DS_Store
3
+ .rbx
4
+ autom4te.cache
5
+ *.o
6
+ *.so
7
+ *.bundle
8
+ *.pyc
9
+ *.a
10
+ *.lo
11
+ *.la
12
+ *.slo
13
+ *.dSYM
14
+ *.gch
15
+ *.swp
16
+ *~.nib
17
+ *.pbxuser
18
+ *.perspective
19
+ *.perspectivev3
20
+ *.mode1v3
21
+ *.mode2v3
22
+ xcuserdata
23
+ /config.rb
24
+ /buildout
25
+ build/cache
26
+ ext/common/libboost_oxt
27
+ ext/common/libpassenger_common
28
+ ext/apache2/module_libboost_oxt
29
+ ext/apache2/module_libpassenger_common
30
+ ext/libev/Makefile
31
+ ext/libev/config.h
32
+ ext/libev/config.log
33
+ ext/libev/config.status
34
+ ext/libev/libtool
35
+ ext/libev/stamp-h1
36
+ ext/libev/ev.3
37
+ ext/libev/ev.pod
38
+ ext/libev/.libs
39
+ ext/libeio/Makefile
40
+ ext/libeio/config.h
41
+ ext/libeio/config.log
42
+ ext/libeio/config.status
43
+ ext/libeio/eio.3
44
+ ext/libeio/eio.pod
45
+ ext/ruby/*/Makefile
46
+ ext/ruby/*/mkmf.log
47
+ ext/*.a
48
+ doc/rdoc
49
+ doc/cxxapi
50
+ doc/*.html
51
+ helper-scripts/download_binaries/Makefile
52
+ test/.gdbinit
53
+ test/test.log
54
+ test/apache2.log
55
+ test/config.yml
56
+ test/config.json
57
+ test/coverage
58
+ test/cxx/CxxTestMain
59
+ test/oxt/oxt_test_main
60
+ test/stub/apache2/*.log
61
+ test/stub/apache2/*.pid
62
+ test/stub/apache2/httpd.conf
63
+ test/stub/zsfa/mycook
64
+ test/stub/zsfa/foo
65
+ test/support/allocate_memory
66
+ pkg
@@ -5,11 +5,8 @@ env:
5
5
  - TEST_CXX=1 SUDO=1
6
6
  - TEST_RUBY=1 TEST_RUBY_VERSION=1.8.7 TEST_CLASSIC_RAILS=0
7
7
  - TEST_RUBY=1 TEST_RUBY_VERSION=1.9.3 TEST_CLASSIC_RAILS=0
8
- - TEST_NGINX=1 TEST_RUBYGEMS_VERSION=1.8.25
8
+ - TEST_NGINX=1 TEST_STANDALONE=1 TEST_RUBYGEMS_VERSION=1.8.25
9
9
  - TEST_APACHE2=1 TEST_RUBYGEMS_VERSION=1.8.25
10
- - TEST_DEBIAN_PACKAGING=1 TEST_RUBYGEMS_VERSION=1.8.25
11
-
12
- before_install:
13
- - cp test/config.json.travis test/config.json
10
+ - TEST_SOURCE_PACKAGING=1 TEST_DEBIAN_PACKAGING=1 TEST_RUBYGEMS_VERSION=1.8.25
14
11
 
15
12
  script: ./dev/run_travis.sh
@@ -14,6 +14,7 @@ Damien Le Berrigaud
14
14
  Dan Peterson
15
15
  Danial Pearce
16
16
  Dave Parfitt
17
+ David Keller
17
18
  David Sissitka
18
19
  Dirk Mueller
19
20
  Dmitry Galinsky
@@ -21,7 +22,7 @@ Dylan Vaughn
21
22
  Erik Ogan
22
23
  Evan Phoenix
23
24
  Gaspard Bucher
24
- Goffert van Gool
25
+ Goffert van Gool (Phusion)
25
26
  Gokulnath Manakkattil
26
27
  Gregory Potamianos
27
28
  Hongli Lai (Phusion)
data/NEWS CHANGED
@@ -1,3 +1,27 @@
1
+ Release 4.0.13
2
+ --------------
3
+
4
+ * Updated preferred Nginx version to 1.4.2.
5
+ * Worked around the fact that FreeBSD 9.1 has a broken C++ runtime. Patch
6
+ contributed by David Keller.
7
+ * Autogenerated HTTP Date headers are now in UTC instead of local time.
8
+ This could cause cookies to have the wrong expiration time. Fixes issue #913.
9
+ * Fixed compatibility problems with Ruby 1.8.6 (issue #924).
10
+ * Introduced a tool, `passenger-config --detect-apache2`, which autodetects
11
+ all Apache installations on the system along with their parameters (which
12
+ apachectl command to run, which log file to read, which config file to edit).
13
+ The tool advises users about how to use that specific Apache installation.
14
+ Useful if the user has multiple Apache installations but don't know about
15
+ it, or when the user doesn't know how to work with multiple Apache
16
+ installations.
17
+ * Added an API for better Rack socket hijacking support.
18
+ * Added a hidden configuration option for customizing the application start
19
+ timeout. A proper configuration option will be introduced in the future.
20
+ * Added autodetection support for Amazon Linux.
21
+ * Fixed process metrics collection on some operating systems. Some systems'
22
+ 'ps' command expect no space between -p and the list of PIDs.
23
+
24
+
1
25
  Release 4.0.10
2
26
  --------------
3
27
 
data/README.md CHANGED
@@ -2,12 +2,9 @@
2
2
 
3
3
  [Phusion Passenger](https://www.phusionpassenger.com/) is a web server and application server, designed to be fast, robust and lightweight. It runs your web apps with the least amount of hassle by taking care of almost all administrative heavy lifting for you. Advanced administration tools allow you to gain deep insight into your web applications' operations and to keep your servers healthy. Phusion Passenger is polyglot by design, and currently supports Ruby (Rack), Python (WSGI) and Node.js.
4
4
 
5
- This is the [Phusion Passenger web application server](https://www.phusionpassenger.com/).
6
-
7
5
  ## Regular installation
8
6
 
9
- You can install either Phusion Passenger for Apache or for Nginx. Run either of
10
- the following programs as root:
7
+ You can install either Phusion Passenger for Apache or for Nginx. Basically, installation involves running one of these commands:
11
8
 
12
9
  ./bin/passenger-install-apache2-module
13
10
 
@@ -15,14 +12,12 @@ the following programs as root:
15
12
 
16
13
  ./bin/passenger-install-nginx-module
17
14
 
18
- That's it. :)
19
-
20
- For troubleshooting, configuration and tips, please read the corresponding Users Guide:
15
+ That's it. :) However on some systems installation may require some more steps. You may have to run `sudo` or `rvmsudo`, and you may have to relax permissions on some directories, etc. Detailed fool-proof installation instructions can be found in the documentation:
21
16
 
22
- * doc/Users guide Apache.html
23
- * doc/Users guide Nginx.html
17
+ * [Apache version](http://www.modrails.com/documentation/Users%20guide%20Apache.html#tarball_generic_install)
18
+ * [Nginx version](http://www.modrails.com/documentation/Users%20guide%20Nginx.html#tarball_generic_install)
24
19
 
25
- These files are included in the source tarball, and may also be viewed online on [our website](https://www.phusionpassenger.com/support).
20
+ For troubleshooting, configuration and tips, please also refer to the above documentation. For further support, please refer to [the Phusion Passenger support page](https://www.phusionpassenger.com/support).
26
21
 
27
22
  ## Installing as a gem
28
23
 
@@ -30,4 +30,5 @@ PhusionPassenger.locate_directories
30
30
  require 'rubygems' rescue nil
31
31
  require 'phusion_passenger/standalone/main'
32
32
 
33
+ STDOUT.sync = STDERR.sync = true
33
34
  PhusionPassenger::Standalone::Main.run!(ARGV)
@@ -41,6 +41,9 @@ def help
41
41
  puts " --nginx-libs Show Nginx runtime library flags."
42
42
  puts " --compiled Check whether runtime libraries are compiled."
43
43
  puts " --natively-packaged Check whether Phusion Passenger is natively packged."
44
+ puts " --installed-from-release-package Check whether this installation came from an official release package."
45
+ puts " --make-locations-ini Generate a locations.ini based on the current install paths."
46
+ puts " --detect-apache2 Autodetect Apache installations."
44
47
  puts " --ruby-command Print the correct command for invoking the Ruby interpreter."
45
48
  puts " --rubyext-compat-id Print the Ruby extension binary compatibility ID."
46
49
  puts " --cxx-compat-id Print the C++ binary compatibility ID."
@@ -60,7 +63,7 @@ when "--root"
60
63
  when "--includedir"
61
64
  puts PhusionPassenger.include_dir
62
65
  when "--nginx-addon-dir"
63
- puts PhusionPassenger.nginx_addon_dir
66
+ puts PhusionPassenger.nginx_module_source_dir
64
67
  when "--nginx-libs"
65
68
  text = "#{common_library.link_objects_as_string} #{PhusionPassenger.lib_dir}/common/libboost_oxt.a"
66
69
  if PhusionPassenger::PlatformInfo.has_math_library?
@@ -84,6 +87,27 @@ when "--natively-packaged"
84
87
  else
85
88
  exit 1
86
89
  end
90
+ when "--installed-from-release-package"
91
+ if PhusionPassenger.installed_from_release_package?
92
+ exit 0
93
+ else
94
+ exit 1
95
+ end
96
+ when "--make-locations-ini"
97
+ puts "[locations]"
98
+ puts "natively_packaged=true"
99
+ PhusionPassenger::REQUIRED_LOCATIONS_INI_FIELDS.each do |field|
100
+ puts "#{field}=#{PhusionPassenger.send(field)}"
101
+ end
102
+ when "--detect-apache2"
103
+ require 'phusion_passenger/platform_info/apache_detector'
104
+ detector = PhusionPassenger::PlatformInfo::ApacheDetector.new(STDOUT)
105
+ begin
106
+ detector.detect_all
107
+ detector.report
108
+ ensure
109
+ detector.finish
110
+ end
87
111
  when "--ruby-command"
88
112
  require 'phusion_passenger/platform_info/ruby'
89
113
  ruby = PhusionPassenger::PlatformInfo.ruby_command
@@ -98,7 +122,9 @@ when "--ruby-command"
98
122
  puts
99
123
 
100
124
  ruby = PhusionPassenger::PlatformInfo.find_command('ruby')
101
- if ruby
125
+ if ruby && !ruby.include?("rvm/rubies/")
126
+ # If this is an RVM Ruby executable then we don't show it. We want people to
127
+ # use the RVM wrapper scripts only.
102
128
  puts "The following Ruby interpreter was found first in $PATH:"
103
129
  puts " Command: #{ruby}"
104
130
  STDOUT.write " Version: "
@@ -107,7 +133,7 @@ when "--ruby-command"
107
133
  puts " To use in Apache: PassengerRuby #{ruby}"
108
134
  puts " To use in Nginx : passenger_ruby #{ruby}"
109
135
  puts " To use with Standalone: #{ruby} #{PhusionPassenger.bin_dir}/passenger start"
110
- else
136
+ elsif !ruby.include?("rvm/rubies/")
111
137
  puts "No Ruby interpreter found in $PATH."
112
138
  end
113
139
  puts
@@ -431,7 +431,7 @@ private
431
431
  elsif !pcre_is_installed?
432
432
  command << "--without-http_rewrite_module "
433
433
  end
434
- command << "--add-module='#{PhusionPassenger.nginx_addon_dir}' #{extra_configure_flags}"
434
+ command << "--add-module='#{PhusionPassenger.nginx_module_source_dir}' #{extra_configure_flags}"
435
435
  command.strip!
436
436
  return command
437
437
  end
@@ -59,8 +59,14 @@ class TemplateRenderer
59
59
  def render_to(filename)
60
60
  puts "Creating #{filename}"
61
61
  text = render
62
- File.open(filename, 'w') do |f|
63
- f.write(text)
62
+ # When packaging, some timestamps may be modified. The user may not
63
+ # have write access to the source root (for example, when Passenger
64
+ # Standalone is compiling its runtime), so we only write to the file
65
+ # when necessary.
66
+ if File.writable?(filename) || File.read(filename) != text
67
+ File.open(filename, 'w') do |f|
68
+ f.write(text)
69
+ end
64
70
  end
65
71
  end
66
72
  end
@@ -91,6 +91,28 @@ task 'debian:dev' do
91
91
  end
92
92
  end
93
93
 
94
+ desc "(Re)install the Debian binary packages built for local testing"
95
+ task 'debian:dev:reinstall' do
96
+ package_names = ["ruby-passenger", "ruby-passenger-dev",
97
+ "ruby-passenger-doc", "libapache2-mod-passenger"]
98
+ package_names.each do |name|
99
+ if Dir["#{PKG_DIR}/#{name}_*.deb"].size > 1
100
+ abort "Please ensure that #{PKG_DIR} only has 1 version of the Phusion Passenger packages."
101
+ end
102
+ end
103
+ package_names.each do |name|
104
+ if !system "sudo apt-get remove -y #{name}"
105
+ if !$? || $?.exitstatus != 100
106
+ abort
107
+ end
108
+ end
109
+ end
110
+ package_names.each do |name|
111
+ filename = Dir["#{PKG_DIR}/#{name}_*.deb"].first
112
+ sh "sudo gdebi -n #{filename}"
113
+ end
114
+ end
115
+
94
116
  desc "Build Debian source packages to be uploaded to repositories"
95
117
  task 'debian:production' => 'debian:orig_tarball' do
96
118
  if boolean_option('USE_CCACHE', false)
@@ -53,14 +53,28 @@ task 'test:integration:nginx' => dependencies do
53
53
  end
54
54
  end
55
55
 
56
+ dependencies = [:nginx, NATIVE_SUPPORT_TARGET].compact
57
+ desc "Run Passenger Standalone integration tests"
58
+ task 'test:integration:standalone' => dependencies do
59
+ if PlatformInfo.rspec.nil?
60
+ abort "RSpec is not installed for Ruby interpreter '#{PlatformInfo.ruby_command}'. Please install it."
61
+ else
62
+ Dir.chdir("test") do
63
+ ruby "#{PlatformInfo.rspec} -c -f s integration_tests/standalone_tests.rb"
64
+ end
65
+ end
66
+ end
67
+
56
68
  desc "Run native packaging tests"
57
69
  task 'test:integration:native_packaging' do
58
70
  if PlatformInfo.rspec.nil?
59
71
  abort "RSpec is not installed for Ruby interpreter '#{PlatformInfo.ruby_command}'. Please install it."
60
72
  else
61
- Dir.chdir("test") do
62
- ruby "#{PlatformInfo.rspec} -c -f s integration_tests/native_packaging_spec.rb"
73
+ command = "#{PlatformInfo.rspec} -c -f s integration_tests/native_packaging_spec.rb"
74
+ if boolean_option('SUDO')
75
+ command = "#{PlatformInfo.ruby_sudo_command} -E #{command}"
63
76
  end
77
+ sh "cd test && #{command}"
64
78
  end
65
79
  end
66
80
 
@@ -164,8 +164,11 @@ task :contributors do
164
164
  entries.delete "Hongli Lai (Phusion"
165
165
  entries.delete "Ninh Bui"
166
166
  entries.push "Ninh Bui (Phusion)"
167
+ entries.delete "Phusion Dev"
167
168
  entries.delete "Tinco Andringa"
168
169
  entries.push "Tinco Andringa (Phusion)"
170
+ entries.delete "Goffert van Gool"
171
+ entries.push "Goffert van Gool (Phusion)"
169
172
  entries.delete "Gokulnath"
170
173
  entries.push "Gokulnath Manakkattil"
171
174
  File.open("CONTRIBUTORS", "w") do |f|
@@ -25,6 +25,9 @@ ORIG_TARBALL_FILES = lambda { PhusionPassenger::Packaging.files }
25
25
 
26
26
  def recursive_copy_files(files, destination_dir, preprocess = false, variables = {})
27
27
  require 'fileutils' if !defined?(FileUtils)
28
+ if !STDOUT.tty?
29
+ puts "Copying files..."
30
+ end
28
31
  files.each_with_index do |filename, i|
29
32
  dir = File.dirname(filename)
30
33
  if !File.exist?("#{destination_dir}/#{dir}")
@@ -40,17 +43,25 @@ def recursive_copy_files(files, destination_dir, preprocess = false, variables =
40
43
  FileUtils.install(filename, "#{destination_dir}/#{filename}", :preserve => true)
41
44
  end
42
45
  end
43
- printf "\r[%5d/%5d] [%3.0f%%] Copying files...", i + 1, files.size, i * 100.0 / files.size
44
- STDOUT.flush
46
+ if STDOUT.tty?
47
+ printf "\r[%5d/%5d] [%3.0f%%] Copying files...", i + 1, files.size, i * 100.0 / files.size
48
+ STDOUT.flush
49
+ end
50
+ end
51
+ if STDOUT.tty?
52
+ printf "\r[%5d/%5d] [%3.0f%%] Copying files...\n", files.size, files.size, 100
45
53
  end
46
- printf "\r[%5d/%5d] [%3.0f%%] Copying files...\n", files.size, files.size, 100
47
54
  end
48
55
 
49
56
 
50
57
  task :clobber => 'package:clean'
51
58
 
59
+ task 'package:set_official' do
60
+ ENV['OFFICIAL_RELEASE'] = '1'
61
+ end
62
+
52
63
  desc "Build, sign & upload gem & tarball"
53
- task 'package:release' => ['package:gem', 'package:tarball', 'package:sign'] do
64
+ task 'package:release' => ['package:set_official', 'package:gem', 'package:tarball', 'package:sign'] do
54
65
  require 'phusion_passenger'
55
66
  require 'yaml'
56
67
  require 'uri'
@@ -77,7 +88,8 @@ task 'package:release' => ['package:gem', 'package:tarball', 'package:sign'] do
77
88
  "admin_password: ..."
78
89
  end
79
90
 
80
- sh "git tag -s #{tag_prefix}-#{version} -u 0A212A8C -m 'Release #{version}'"
91
+ tag = "#{tag_prefix}-#{version}"
92
+ sh "git tag -s #{tag} -u 0A212A8C -m 'Release #{version}'"
81
93
 
82
94
  puts "Proceed with pushing tag to remote Git repo and uploading the gem and signatures? [y/n]"
83
95
  if STDIN.readline == "y\n"
@@ -104,6 +116,9 @@ task 'package:release' => ['package:gem', 'package:tarball', 'package:sign'] do
104
116
  "Status: #{response.code}\n\n" +
105
117
  response.body
106
118
  end
119
+ sh "cd ../passenger_autobuilder && " +
120
+ "git pull && " +
121
+ "./autobuild-osx https://github.com/phusion/passenger.git passenger psg_autobuilder_chroot@juvia-helper.phusion.nl --tag=#{tag}"
107
122
  puts "--------------"
108
123
  puts "All done."
109
124
  else
@@ -111,6 +126,9 @@ task 'package:release' => ['package:gem', 'package:tarball', 'package:sign'] do
111
126
  subdir = string_option('NAME', version)
112
127
  sh "scp pkg/#{basename}.{gem,tar.gz,gem.asc,tar.gz.asc} app@shell.phusion.nl:#{dir}/"
113
128
  sh "ssh app@shell.phusion.nl 'mkdir -p \"#{dir}/assets/#{subdir}\" && mv #{dir}/#{basename}.{gem,tar.gz,gem.asc,tar.gz.asc} \"#{dir}/assets/#{subdir}/\"'"
129
+ sh "cd ../passenger_autobuilder && " +
130
+ "git pull && " +
131
+ "./autobuild-osx TODO passenger-enterprise psg_autobuilder_chroot@juvia-helper.phusion.nl --tag=#{tag}"
114
132
  end
115
133
  else
116
134
  puts "Did not upload anything."
@@ -119,9 +137,26 @@ end
119
137
 
120
138
  task 'package:gem' => Packaging::PREGENERATED_FILES do
121
139
  require 'phusion_passenger'
122
- sh "gem build #{PhusionPassenger::PACKAGE_NAME}.gemspec --sign --key 0x0A212A8C"
123
- sh "mkdir -p pkg"
124
- sh "mv #{PhusionPassenger::PACKAGE_NAME}-#{PhusionPassenger::VERSION_STRING}.gem pkg/"
140
+ if ENV['OFFICIAL_RELEASE']
141
+ release_file = "#{PhusionPassenger.resources_dir}/release.txt"
142
+ File.unlink(release_file) rescue nil
143
+ end
144
+ begin
145
+ if release_file
146
+ File.open(release_file, "w").close
147
+ end
148
+ command = "gem build #{PhusionPassenger::PACKAGE_NAME}.gemspec"
149
+ if !boolean_option('SKIP_SIGNING')
150
+ command << " --sign --key 0x0A212A8C"
151
+ end
152
+ sh(command)
153
+ ensure
154
+ if release_file
155
+ File.unlink(release_file) rescue nil
156
+ end
157
+ end
158
+ sh "mkdir -p #{PKG_DIR}"
159
+ sh "mv #{PhusionPassenger::PACKAGE_NAME}-#{PhusionPassenger::VERSION_STRING}.gem #{PKG_DIR}/"
125
160
  end
126
161
 
127
162
  task 'package:tarball' => Packaging::PREGENERATED_FILES do
@@ -129,11 +164,14 @@ task 'package:tarball' => Packaging::PREGENERATED_FILES do
129
164
  require 'fileutils'
130
165
 
131
166
  basename = "#{PhusionPassenger::PACKAGE_NAME}-#{PhusionPassenger::VERSION_STRING}"
132
- sh "rm -rf pkg/#{basename}"
133
- sh "mkdir -p pkg/#{basename}"
134
- recursive_copy_files(ORIG_TARBALL_FILES.call, "pkg/#{basename}")
135
- sh "cd pkg && tar -c #{basename} | gzip --best > #{basename}.tar.gz"
136
- sh "rm -rf pkg/#{basename}"
167
+ sh "rm -rf #{PKG_DIR}/#{basename}"
168
+ sh "mkdir -p #{PKG_DIR}/#{basename}"
169
+ recursive_copy_files(ORIG_TARBALL_FILES.call, "#{PKG_DIR}/#{basename}")
170
+ if ENV['OFFICIAL_RELEASE']
171
+ File.open("#{PKG_DIR}/#{basename}/resources/release.txt", "w").close
172
+ end
173
+ sh "cd #{PKG_DIR} && tar -c #{basename} | gzip --best > #{basename}.tar.gz"
174
+ sh "rm -rf #{PKG_DIR}/#{basename}"
137
175
  end
138
176
 
139
177
  task 'package:sign' do
@@ -190,18 +228,19 @@ task :fakeroot => [:apache2, :nginx, :doc] do
190
228
  # the files to be installed to /usr, and the Ruby interpreter
191
229
  # on the packaging machine might be in /usr/local.
192
230
  fake_rubylibdir = "#{fakeroot}/usr/lib/ruby/vendor_ruby"
193
- fake_libdir = "#{fakeroot}/usr/lib/passenger"
231
+ fake_libdir = "#{fakeroot}/usr/lib/#{GLOBAL_NAMESPACE_DIRNAME}"
194
232
  fake_native_support_dir = "#{fakeroot}/usr/lib/ruby/#{CONFIG['ruby_version']}/#{CONFIG['arch']}"
195
233
  fake_agents_dir = "#{fakeroot}/usr/lib/#{GLOBAL_NAMESPACE_DIRNAME}/agents"
196
234
  fake_helper_scripts_dir = "#{fakeroot}/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}/helper-scripts"
197
- fake_resources_dir = "#{fakeroot}/usr/share/passenger"
198
- fake_include_dir = "#{fakeroot}/usr/share/passenger/include"
235
+ fake_resources_dir = "#{fakeroot}/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}"
236
+ fake_include_dir = "#{fakeroot}/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}/include"
199
237
  fake_docdir = "#{fakeroot}/usr/share/doc/#{GLOBAL_NAMESPACE_DIRNAME}"
200
238
  fake_bindir = "#{fakeroot}/usr/bin"
201
239
  fake_sbindir = "#{fakeroot}/usr/sbin"
202
240
  fake_apache2_module_dir = "#{fakeroot}/usr/lib/apache2/modules"
203
241
  fake_apache2_module = "#{fake_apache2_module_dir}/mod_passenger.so"
204
- fake_ruby_extension_source_dir = "#{fakeroot}/usr/share/passenger/ruby_extension_source"
242
+ fake_ruby_extension_source_dir = "#{fakeroot}/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}/ruby_extension_source"
243
+ fake_nginx_module_source_dir = "#{fakeroot}/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}/ngx_http_passenger_module"
205
244
 
206
245
  sh "rm -rf #{fakeroot}"
207
246
  sh "mkdir -p #{fakeroot}"
@@ -256,8 +295,8 @@ task :fakeroot => [:apache2, :nginx, :doc] do
256
295
  end
257
296
 
258
297
  # Nginx module sources
259
- sh "mkdir -p #{fake_resources_dir}/ngx_http_passenger_module"
260
- sh "cp ext/nginx/* #{fake_resources_dir}/ngx_http_passenger_module/"
298
+ sh "mkdir -p #{fake_nginx_module_source_dir}"
299
+ sh "cp ext/nginx/* #{fake_nginx_module_source_dir}/"
261
300
 
262
301
  # Documentation
263
302
  sh "mkdir -p #{fake_docdir}"
@@ -288,16 +327,25 @@ task :fakeroot => [:apache2, :nginx, :doc] do
288
327
  File.open("#{fake_rubylibdir}/phusion_passenger/locations.ini", "w") do |f|
289
328
  f.puts "[locations]"
290
329
  f.puts "natively_packaged=true"
291
- f.puts "bin=/usr/bin"
292
- f.puts "agents=/usr/lib/passenger/agents"
293
- f.puts "libdir=/usr/lib/passenger"
294
- f.puts "helper_scripts=/usr/share/passenger/helper-scripts"
295
- f.puts "resources=/usr/share/passenger"
296
- f.puts "includedir=/usr/share/passenger/include"
297
- f.puts "doc=/usr/share/doc/passenger"
298
- f.puts "rubylibdir=/usr/lib/ruby/vendor_ruby"
299
- f.puts "apache2_module=/usr/lib/apache2/modules/mod_passenger.so"
300
- f.puts "ruby_extension_source=/usr/share/passenger/ruby_extension_source"
330
+ f.puts "bin_dir=/usr/bin"
331
+ f.puts "agents_dir=/usr/lib/#{GLOBAL_NAMESPACE_DIRNAME}/agents"
332
+ f.puts "lib_dir=/usr/lib/#{GLOBAL_NAMESPACE_DIRNAME}"
333
+ f.puts "helper_scripts_dir=/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}/helper-scripts"
334
+ f.puts "resources_dir=/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}"
335
+ f.puts "include_dir=/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}/include"
336
+ f.puts "doc_dir=/usr/share/doc/#{GLOBAL_NAMESPACE_DIRNAME}"
337
+ f.puts "ruby_libdir=/usr/lib/ruby/vendor_ruby"
338
+ f.puts "apache2_module_path=/usr/lib/apache2/modules/mod_passenger.so"
339
+ f.puts "ruby_extension_source_dir=/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}/ruby_extension_source"
340
+ f.puts "nginx_module_source_dir=/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}/ngx_http_passenger_module"
341
+ end
342
+
343
+ # Sanity check the locations.ini file
344
+ options = PhusionPassenger.parse_ini_file("#{fake_rubylibdir}/phusion_passenger/locations.ini")
345
+ PhusionPassenger::REQUIRED_LOCATIONS_INI_FIELDS.each do |field|
346
+ if !options[field.to_s]
347
+ raise "Bug in build/packaging.rb: the generated locations.ini is missing the '#{field}' field"
348
+ end
301
349
  end
302
350
 
303
351
  sh "find #{fakeroot} -name .DS_Store -print0 | xargs -0 rm -f"