passenger 5.0.14 → 5.0.15

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 (70) hide show
  1. checksums.yaml +8 -8
  2. checksums.yaml.gz.asc +7 -7
  3. data.tar.gz.asc +7 -7
  4. data/CHANGELOG +9 -0
  5. data/INSTALL.md +1 -1
  6. data/LICENSE +1 -1
  7. data/README.md +1 -1
  8. data/bin/passenger-install-apache2-module +6 -10
  9. data/bin/passenger-install-nginx-module +6 -9
  10. data/doc/CloudLicensingConfiguration.html +1 -216
  11. data/doc/CloudLicensingConfiguration.txt.md +1 -192
  12. data/doc/Design and Architecture.html +4 -4
  13. data/doc/Design and Architecture.txt +4 -4
  14. data/doc/ServerOptimizationGuide.html +1 -489
  15. data/doc/ServerOptimizationGuide.txt.md +1 -399
  16. data/doc/Users guide Apache.html +594 -6720
  17. data/doc/Users guide Apache.idmap.txt +15 -12
  18. data/doc/Users guide Apache.txt +113 -2047
  19. data/doc/Users guide Nginx.html +565 -6720
  20. data/doc/Users guide Nginx.idmap.txt +15 -12
  21. data/doc/Users guide Nginx.txt +94 -1862
  22. data/doc/Users guide Standalone.html +53 -2183
  23. data/doc/Users guide Standalone.idmap.txt +9 -6
  24. data/doc/Users guide Standalone.txt +16 -360
  25. data/doc/Users guide.html +3 -145
  26. data/doc/Users guide.txt +2 -54
  27. data/doc/users_guide_snippets/analysis_and_system_maintenance.txt +36 -175
  28. data/doc/users_guide_snippets/appendix_c_spawning_methods.txt +9 -215
  29. data/doc/users_guide_snippets/environment_variables.txt +11 -243
  30. data/doc/users_guide_snippets/installation.txt +66 -946
  31. data/doc/users_guide_snippets/rackup_specifications.txt +1 -75
  32. data/doc/users_guide_snippets/support_information.txt +1 -48
  33. data/doc/users_guide_snippets/tips.txt +103 -704
  34. data/doc/users_guide_snippets/troubleshooting/default.txt +16 -130
  35. data/doc/users_guide_snippets/troubleshooting/rails.txt +15 -12
  36. data/doc/users_guide_snippets/under_the_hood/relationship_with_ruby.txt +2 -113
  37. data/ext/apache2/Configuration.hpp +2 -2
  38. data/ext/apache2/Hooks.cpp +2 -2
  39. data/ext/common/AgentsStarter.h +18 -10
  40. data/ext/common/ApplicationPool2/ErrorRenderer.h +0 -3
  41. data/ext/common/ApplicationPool2/Options.h +8 -1
  42. data/ext/common/Constants.h +3 -9
  43. data/ext/common/agent/Core/RequestHandler/InitRequest.cpp +2 -0
  44. data/ext/common/agent/Watchdog/Main.cpp +1 -1
  45. data/ext/nginx/ContentHandler.c +2 -3
  46. data/ext/nginx/config +2 -2
  47. data/lib/phusion_passenger.rb +1 -22
  48. data/lib/phusion_passenger/abstract_installer.rb +10 -10
  49. data/lib/phusion_passenger/config/agent_compiler.rb +5 -5
  50. data/lib/phusion_passenger/config/nginx_engine_compiler.rb +4 -4
  51. data/lib/phusion_passenger/config/validate_install_command.rb +3 -3
  52. data/lib/phusion_passenger/constants.rb +1 -5
  53. data/lib/phusion_passenger/loader_shared_helpers.rb +16 -5
  54. data/lib/phusion_passenger/platform_info/apache_detector.rb +2 -2
  55. data/lib/phusion_passenger/public_api.rb +11 -2
  56. data/lib/phusion_passenger/request_handler/thread_handler.rb +2 -3
  57. data/lib/phusion_passenger/ruby_core_io_enhancements.rb +4 -1
  58. data/lib/phusion_passenger/standalone/start_command.rb +1 -1
  59. data/resources/oss-binaries.phusionpassenger.com.crt +124 -0
  60. data/resources/templates/apache2/deployment_example.txt.erb +5 -23
  61. data/resources/templates/apache2/installing_against_a_different_apache.txt.erb +3 -4
  62. data/resources/templates/apache2/possible_solutions_for_compilation_and_installation_problems.txt.erb +3 -3
  63. data/resources/templates/apache2/rpm_installation_recommended.txt.erb +1 -1
  64. data/resources/templates/installer_common/low_amount_of_memory_warning.txt.erb +4 -5
  65. data/resources/templates/nginx/deployment_example.txt.erb +5 -17
  66. data/resources/templates/nginx/possible_solutions_for_compilation_and_installation_problems.txt.erb +3 -3
  67. data/resources/templates/standalone/config.erb +1 -1
  68. data/resources/templates/undisclosed_error.html.template +4 -11
  69. metadata +2 -2
  70. metadata.gz.asc +7 -7
@@ -1073,25 +1073,7 @@ pre {
1073
1073
  <img src="images/phusion_banner.png" alt="images/phusion_banner.png">
1074
1074
  </a>
1075
1075
  </span></p></div>
1076
- <div class="paragraph"><p><a href="https://www.phusionpassenger.com/">Phusion Passenger</a> 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.</p></div>
1077
- <div class="paragraph"><p>In the Standalone mode, Phusion Passenger operates as a fully-featured, secure standalone HTTP server. You do not need to have an existing web server like Apache or Nginx. This mode is ideal…</p></div>
1078
- <div class="ulist"><ul>
1079
- <li>
1080
- <p>
1081
- …if you are not familiar with Apache or Nginx
1082
- </p>
1083
- </li>
1084
- <li>
1085
- <p>
1086
- …when you want to quickly start up a server without editing configuration files (e.g. during development)
1087
- </p>
1088
- </li>
1089
- <li>
1090
- <p>
1091
- …or when you want to decouple the web server from the application server, by setting up reverse proxies.
1092
- </p>
1093
- </li>
1094
- </ul></div>
1076
+ <div class="paragraph"><p>This is the old, deprecated Passenger Standalone documentation. Please visit <a href="https://www.phusionpassenger.com/library/">https://www.phusionpassenger.com/library/</a> for the new documentation.</p></div>
1095
1077
  </div>
1096
1078
  </div>
1097
1079
  <div id="toc">
@@ -1133,14 +1115,11 @@ pre {
1133
1115
  <div class="foo toclevel3"><a href="#config_file">4.2. Configuration file</a></div>
1134
1116
  <div class="foo toclevel3"><a href="#advanced_configuration">4.3. Advanced configuration</a></div>
1135
1117
  <div class="foo toclevel2"><a href="#_using_passenger_standalone_in_production">5. Using Passenger Standalone in production</a></div>
1136
- <div class="foo toclevel3"><a href="#starting_at_system_boot">5.1. Starting Passenger Standalone at system boot</a></div>
1118
+ <div class="foo toclevel3"><a href="#_starting_passenger_standalone_at_system_boot">5.1. Starting Passenger Standalone at system boot</a></div>
1137
1119
  <div class="foo toclevel3"><a href="#sharing_port">5.2. Sharing the same port between multiple Passenger Standalone instances</a></div>
1138
1120
  <div class="foo toclevel3"><a href="#_installing_passenger_standalone_behind_nginx">5.3. Installing Passenger Standalone behind Nginx</a></div>
1139
1121
  <div class="foo toclevel2"><a href="#mass_deployment">6. Mass deployment</a></div>
1140
1122
  <div class="foo toclevel2"><a href="#troubleshooting">7. Troubleshooting</a></div>
1141
- <div class="foo toclevel3"><a href="#_generic_troubleshooting_tips">7.1. Generic troubleshooting tips</a></div>
1142
- <div class="foo toclevel3"><a href="#_upon_uploading_a_file_phusion_passenger_reports_client_body_temp_00000000xx_failed_2_no_such_file_or_directory">7.2. Upon uploading a file, Phusion Passenger reports "client_body_temp/00000000xx failed (2: No such file or directory)"</a></div>
1143
- <div class="foo toclevel3"><a href="#_i_get_command_not_found_when_running_a_phusion_passenger_command_through_sudo">7.3. I get "command not found" when running a Phusion Passenger command through sudo</a></div>
1144
1123
  <div class="foo toclevel2"><a href="#_under_the_hood">8. Under the hood</a></div>
1145
1124
  <div class="foo toclevel3"><a href="#relationship_with_ruby">8.1. Phusion Passenger and its relationship with Ruby</a></div>
1146
1125
  <div class="foo toclevel4"><a href="#_how_ruby_is_used">8.1.1. How Ruby is used</a></div>
@@ -1165,130 +1144,7 @@ pre {
1165
1144
  <div class="sectionbody">
1166
1145
  <div class="sect2">
1167
1146
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_supported_operating_systems_and_languages"></span><h3 data-comment-topic="supported-operating-systems-1387080" data-anchor="_supported_operating_systems_and_languages">1.1. Supported operating systems and languages</h3>
1168
- <div class="paragraph"><p>Phusion Passenger works on almost any POSIX-compliant operating system. In other
1169
- words: practically any operating system on earth, except Microsoft Windows.</p></div>
1170
- <div class="paragraph"><p>Supported operating systems:</p></div>
1171
- <table class="tableblock frame-all grid-all" style="
1172
- width:100%;
1173
- ">
1174
- <col style="width:50%;">
1175
- <col style="width:50%;">
1176
- <thead>
1177
- <tr>
1178
- <th class="tableblock halign-left valign-top"> OS </th>
1179
- <th class="tableblock halign-left valign-top"> Minimum version</th>
1180
- </tr>
1181
- </thead>
1182
- <tbody>
1183
- <tr>
1184
- <td class="tableblock halign-left valign-top"><p class="tableblock">Ubuntu</p></td>
1185
- <td class="tableblock halign-left valign-top"><p class="tableblock">10.04</p></td>
1186
- </tr>
1187
- <tr>
1188
- <td class="tableblock halign-left valign-top"><p class="tableblock">Debian</p></td>
1189
- <td class="tableblock halign-left valign-top"><p class="tableblock">6</p></td>
1190
- </tr>
1191
- <tr>
1192
- <td class="tableblock halign-left valign-top"><p class="tableblock">Red Hat, CentOS</p></td>
1193
- <td class="tableblock halign-left valign-top"><p class="tableblock">5</p></td>
1194
- </tr>
1195
- <tr>
1196
- <td class="tableblock halign-left valign-top"><p class="tableblock">Amazon Linux</p></td>
1197
- <td class="tableblock halign-left valign-top"><p class="tableblock">All versions supported</p></td>
1198
- </tr>
1199
- <tr>
1200
- <td class="tableblock halign-left valign-top"><p class="tableblock">Mac OS X</p></td>
1201
- <td class="tableblock halign-left valign-top"><p class="tableblock">10.8 Mountain Lion</p></td>
1202
- </tr>
1203
- <tr>
1204
- <td class="tableblock halign-left valign-top"><p class="tableblock">FreeBSD</p></td>
1205
- <td class="tableblock halign-left valign-top"><p class="tableblock">8</p></td>
1206
- </tr>
1207
- <tr>
1208
- <td class="tableblock halign-left valign-top"><p class="tableblock">OpenBSD</p></td>
1209
- <td class="tableblock halign-left valign-top"><p class="tableblock">5.2</p></td>
1210
- </tr>
1211
- <tr>
1212
- <td class="tableblock halign-left valign-top"><p class="tableblock">Other Unix</p></td>
1213
- <td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
1214
- </tr>
1215
- </tbody>
1216
- </table>
1217
- <div class="paragraph"><p>"Other Unix" is supported on a "best-effort" basis. We do not regularly check whether Phusion Passenger still works on other Unices, but if users report issues then we’ll try to address them.</p></div>
1218
- <div class="paragraph"><p>Supported architectures:</p></div>
1219
- <table class="tableblock frame-all grid-all" style="
1220
- width:100%;
1221
- ">
1222
- <col style="width:50%;">
1223
- <col style="width:50%;">
1224
- <thead>
1225
- <tr>
1226
- <th class="tableblock halign-left valign-top"> Architecture </th>
1227
- <th class="tableblock halign-left valign-top"> Notes</th>
1228
- </tr>
1229
- </thead>
1230
- <tbody>
1231
- <tr>
1232
- <td class="tableblock halign-left valign-top"><p class="tableblock">x86 (32-bit)</p></td>
1233
- <td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
1234
- </tr>
1235
- <tr>
1236
- <td class="tableblock halign-left valign-top"><p class="tableblock">x86_64 (64-bit)</p></td>
1237
- <td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
1238
- </tr>
1239
- <tr>
1240
- <td class="tableblock halign-left valign-top"><p class="tableblock">Other</p></td>
1241
- <td class="tableblock halign-left valign-top"><p class="tableblock">Supported on a "best-effort" basis.</p></td>
1242
- </tr>
1243
- </tbody>
1244
- </table>
1245
- <div class="paragraph"><p>Supported languages and frameworks:</p></div>
1246
- <table class="tableblock frame-all grid-all" style="
1247
- width:100%;
1248
- ">
1249
- <col style="width:50%;">
1250
- <col style="width:50%;">
1251
- <thead>
1252
- <tr>
1253
- <th class="tableblock halign-left valign-top"> Language/framework </th>
1254
- <th class="tableblock halign-left valign-top"> Minimum version</th>
1255
- </tr>
1256
- </thead>
1257
- <tbody>
1258
- <tr>
1259
- <td class="tableblock halign-left valign-top"><p class="tableblock">Ruby (MRI)</p></td>
1260
- <td class="tableblock halign-left valign-top"><p class="tableblock">1.8.5</p></td>
1261
- </tr>
1262
- <tr>
1263
- <td class="tableblock halign-left valign-top"><p class="tableblock">JRuby</p></td>
1264
- <td class="tableblock halign-left valign-top"><p class="tableblock">1.7.0</p></td>
1265
- </tr>
1266
- <tr>
1267
- <td class="tableblock halign-left valign-top"><p class="tableblock">Rubinius</p></td>
1268
- <td class="tableblock halign-left valign-top"><p class="tableblock">2.2.0</p></td>
1269
- </tr>
1270
- <tr>
1271
- <td class="tableblock halign-left valign-top"><p class="tableblock">Ruby on Rails</p></td>
1272
- <td class="tableblock halign-left valign-top"><p class="tableblock">2.3</p></td>
1273
- </tr>
1274
- <tr>
1275
- <td class="tableblock halign-left valign-top"><p class="tableblock">Python</p></td>
1276
- <td class="tableblock halign-left valign-top"><p class="tableblock">2.6</p></td>
1277
- </tr>
1278
- <tr>
1279
- <td class="tableblock halign-left valign-top"><p class="tableblock">Node.js/io.js</p></td>
1280
- <td class="tableblock halign-left valign-top"><p class="tableblock">0.10</p></td>
1281
- </tr>
1282
- <tr>
1283
- <td class="tableblock halign-left valign-top"><p class="tableblock">Meteor</p></td>
1284
- <td class="tableblock halign-left valign-top"><p class="tableblock">0.6</p></td>
1285
- </tr>
1286
- </tbody>
1287
- </table>
1288
- <div class="paragraph"><p>If you run into any issues, please
1289
- <a href="https://github.com/phusion/passenger/issues">report a bug</a>
1290
- or
1291
- <a href="http://groups.google.com/group/phusion-passenger">join our discussion forum</a>.</p></div>
1147
+ <div class="paragraph"><p>This documentation has moved. <a href="https://www.phusionpassenger.com/library/install/supported_operating_systems_and_languages.html">https://www.phusionpassenger.com/library/install/supported_operating_systems_and_languages.html</a></p></div>
1292
1148
  </div>
1293
1149
  <div class="sect2">
1294
1150
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="where_to_get_support"></span><h3 data-comment-topic="where-to-get-support-xkx7rx" data-anchor="where_to_get_support">1.2. Where to get support</h3>
@@ -1330,360 +1186,34 @@ Report security vulnerabilities to <a href="mailto:security@phusion.nl">security
1330
1186
  <div class="sectionbody">
1331
1187
  <div class="sect2">
1332
1188
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_synopsis"></span><h3 data-comment-topic="synopsis-92sr34" data-anchor="_synopsis">2.1. Synopsis</h3>
1333
- <div class="paragraph"><p>Because Phusion Passenger is designed to run in a wide variety of operating systems and configurations, there are multiple ways to install it. Most users  — especially first-time users — will prefer <em>OS-specific installation instructions</em>. These are not only the easiest, but also allow Phusion Passenger to integrate into the operating system in the best way possible. Other users should consult the <em>generic installation instructions</em>.</p></div>
1334
- <div class="paragraph"><p>The steps for upgrading or downgrading Phusion Passenger is almost the same as the steps for installing. All the installation guides in this section will also teach you how to upgrade and downgrade.</p></div>
1189
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/install/">https://www.phusionpassenger.com/library/install/</a></p></div>
1335
1190
  </div>
1336
1191
  <div class="sect2">
1337
1192
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="install_osx_homebrew"></span><h3 data-comment-topic="installing-or-upgrading-on-mac-os-x-with-homebrew-fxjdi1" data-anchor="install_osx_homebrew">2.2. Installing or upgrading on Mac OS X with Homebrew</h3>
1338
- <div class="dlist"><dl>
1339
- <dt class="hdlist1">
1340
- <strong>Open source</strong>
1341
- </dt>
1342
- <dd>
1343
- <p>
1344
- Every time we release a new Phusion Passenger version, we make it available through <a href="http://brew.sh/">Homebrew</a>. Please note that the Homebrew maintainers have to merge our pull requests manually, so it may take a day or two before a new version shows up in the official Homebrew repository.
1345
- </p>
1346
- <div class="olist arabic"><ol class="arabic">
1347
- <li>
1348
- <p>
1349
- Update the Homebrew recipes:
1350
- </p>
1351
- <div class="listingblock">
1352
- <div class="content monospaced">
1353
- <pre>brew update</pre>
1354
- </div>
1355
- </div>
1356
- </li>
1357
- <li>
1358
- <p>
1359
- Run one of the following, and follow the instructions:
1360
- </p>
1361
- <div class="listingblock">
1362
- <div class="content monospaced">
1363
- <pre>brew install passenger
1364
- -OR-
1365
- brew upgrade passenger</pre>
1366
- </div>
1367
- </div>
1368
- </li>
1369
- </ol></div>
1370
- </dd>
1371
- <dt class="hdlist1">
1372
- <strong>Enterprise</strong>
1373
- </dt>
1374
- <dd>
1375
- <p>
1376
- <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a> is currently not available through Homebrew. Please try one of the other installation methods instead.
1377
- </p>
1378
- </dd>
1379
- </dl></div>
1193
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/install/">https://www.phusionpassenger.com/library/install/</a></p></div>
1380
1194
  </div>
1381
1195
  <div class="sect2">
1382
1196
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="install_on_debian_ubuntu"></span><h3 data-comment-topic="installing-or-upgrading-on-debian-or-ubuntu-gme2a9" data-anchor="install_on_debian_ubuntu">2.3. Installing or upgrading on Debian or Ubuntu</h3>
1383
- <div class="paragraph"><p>We provide an official Phusion Passenger APT repository. This APT repository contains Phusion Passenger packages for multiple versions of Debian and Ubuntu. 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>
1384
- <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.</p></div>
1385
- <div class="paragraph"><p>Packages are available for the x86 and x86_64 architectures. Our policy is to support all Ubuntu LTS releases that are still supported by Canonical, plus the latest Ubuntu release, plus all Debian releases that are still supported by Debian.</p></div>
1197
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/install/apt_repo/">https://www.phusionpassenger.com/library/install/apt_repo/</a></p></div>
1386
1198
  <div class="sect3">
1387
1199
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="install_add_apt_repo"></span><h4 data-comment-topic="adding-our-apt-repository-1qu2se8" data-anchor="install_add_apt_repo">2.3.1. Adding our APT repository</h4>
1388
- <div class="olist arabic"><ol class="arabic">
1389
- <li>
1390
- <p>
1391
- Install our PGP key. Packages are signed by "Phusion Automated Software Signing (<a href="mailto:auto-software-signing@phusion.nl">auto-software-signing@phusion.nl</a>)", fingerprint 1637 8A33 A6EF 1676 2922 526E 561F 9B9C AC40 B2F7.
1392
- </p>
1393
- <div class="listingblock">
1394
- <div class="content monospaced">
1395
- <pre>sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7</pre>
1396
- </div>
1397
- </div>
1398
- </li>
1399
- <li>
1400
- <p>
1401
- Add HTTPS support for APT. Our APT repository is stored on an HTTPS server.
1402
- </p>
1403
- <div class="listingblock">
1404
- <div class="content monospaced">
1405
- <pre>sudo apt-get install apt-transport-https ca-certificates</pre>
1406
- </div>
1407
- </div>
1408
- </li>
1409
- <li>
1410
- <p>
1411
- Create a file <span class="monospaced">/etc/apt/sources.list.d/passenger.list</span> and insert <strong>one of</strong> the following lines, depending on your distribution.
1412
- </p>
1413
- <div class="dlist"><dl>
1414
- <dt class="hdlist1">
1415
- <strong>Open source</strong>
1416
- </dt>
1417
- <dd>
1418
- <div class="listingblock">
1419
- <div class="content">
1420
- <!-- Generator: GNU source-highlight 2.11.1
1421
- by Lorenzo Bettini
1422
- http://www.lorenzobettini.it
1423
- http://www.gnu.org/software/src-highlite -->
1424
- <pre><tt><span style="font-style: italic"><span style="color: #9A1900">##### !!!! Only add ONE of these lines, not all of them !!!! #####</span></span>
1425
- <span style="font-style: italic"><span style="color: #9A1900"># Ubuntu 15.04</span></span>
1426
- 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
1427
- <span style="font-style: italic"><span style="color: #9A1900"># Ubuntu 14.04</span></span>
1428
- 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
1429
- <span style="font-style: italic"><span style="color: #9A1900"># Ubuntu 12.04</span></span>
1430
- 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
1431
- <span style="font-style: italic"><span style="color: #9A1900"># Debian 8</span></span>
1432
- 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
1433
- <span style="font-style: italic"><span style="color: #9A1900"># Debian 7</span></span>
1434
- 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
1435
- <span style="font-style: italic"><span style="color: #9A1900"># Debian 6</span></span>
1436
- deb https<span style="color: #990000">:</span>//oss-binaries<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/apt/passenger squeeze main</tt></pre>
1437
- </div>
1438
- </div>
1439
- </dd>
1440
- <dt class="hdlist1">
1441
- <strong>Enterprise</strong>
1442
- </dt>
1443
- <dd>
1444
- <div class="listingblock">
1445
- <div class="content">
1446
- <!-- Generator: GNU source-highlight 2.11.1
1447
- by Lorenzo Bettini
1448
- http://www.lorenzobettini.it
1449
- http://www.gnu.org/software/src-highlite -->
1450
- <pre><tt><span style="font-style: italic"><span style="color: #9A1900">##### !!!! Only add ONE of these lines, not all of them !!!! #####</span></span>
1451
- <span style="font-style: italic"><span style="color: #9A1900"># Ubuntu 15.04</span></span>
1452
- 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
1453
- <span style="font-style: italic"><span style="color: #9A1900"># Ubuntu 14.04</span></span>
1454
- 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
1455
- <span style="font-style: italic"><span style="color: #9A1900"># Ubuntu 12.04</span></span>
1456
- 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
1457
- <span style="font-style: italic"><span style="color: #9A1900"># Debian 8</span></span>
1458
- 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
1459
- <span style="font-style: italic"><span style="color: #9A1900"># Debian 7</span></span>
1460
- 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
1461
- <span style="font-style: italic"><span style="color: #9A1900"># Debian 6</span></span>
1462
- 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 squeeze main</tt></pre>
1463
- </div>
1464
- </div>
1465
- <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>
1466
- </dd>
1467
- </dl></div>
1468
- </li>
1469
- <li>
1470
- <p>
1471
- Secure <span class="monospaced">passenger.list</span> and update your APT cache:
1472
- </p>
1473
- <div class="listingblock">
1474
- <div class="content monospaced">
1475
- <pre>sudo chown root: /etc/apt/sources.list.d/passenger.list
1476
- sudo chmod 600 /etc/apt/sources.list.d/passenger.list
1477
- sudo apt-get update</pre>
1478
- </div>
1479
- </div>
1480
- </li>
1481
- <li>
1482
- <p>
1483
- (Optional) If using <span class="monospaced">unattended-upgrades</span>, add our APT repository to the list of <span class="monospaced">Allowed-Origins</span> for upgrades, <span class="monospaced">/etc/apt/apt.conf.d/50unattended-upgrades</span>:
1484
- </p>
1485
- <div class="listingblock">
1486
- <div class="content">
1487
- <!-- Generator: GNU source-highlight 2.11.1
1488
- by Lorenzo Bettini
1489
- http://www.lorenzobettini.it
1490
- http://www.gnu.org/software/src-highlite -->
1491
- <pre><tt><span style="color: #990000">//</span> Automatically upgrade packages from these <span style="color: #990000">(</span>origin<span style="color: #990000">:</span>archive<span style="color: #990000">)</span> pairs
1492
- Unattended-Upgrade<span style="color: #990000">::</span>Allowed-Origins {
1493
- <span style="color: #990000">//</span> To check <span style="color: #FF0000">"Origin:"</span> and <span style="color: #FF0000">"Suite:"</span><span style="color: #990000">,</span> you could use e<span style="color: #990000">.</span>g<span style="color: #990000">.:</span>
1494
- <span style="color: #990000">//</span> grep <span style="color: #FF0000">"Origin</span><span style="color: #CC33CC">\|</span><span style="color: #FF0000">Suite"</span> /var/lib/apt/lists/oss-binaries<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com<span style="color: #990000">*</span>
1495
- <span style="color: #FF0000">"Phusion:stable"</span><span style="color: #990000">;</span>
1496
- }<span style="color: #990000">;</span></tt></pre>
1497
- </div>
1498
- </div>
1499
- </li>
1500
- </ol></div>
1200
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/install/apt_repo/">https://www.phusionpassenger.com/library/install/apt_repo/</a></p></div>
1501
1201
  </div>
1502
1202
  <div class="sect3">
1503
1203
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_installing_packages"></span><h4 data-comment-topic="installing-packages-k1zxbg" data-anchor="_installing_packages">2.3.2. Installing packages</h4>
1504
- <div class="dlist"><dl>
1505
- <dt class="hdlist1">
1506
- <strong>Open source</strong>
1507
- </dt>
1508
- <dd>
1509
- <div class="olist arabic"><ol class="arabic">
1510
- <li>
1511
- <p>
1512
- <a href="#install_add_apt_repo">Add our APT repository.</a>
1513
- </p>
1514
- </li>
1515
- <li>
1516
- <p>
1517
- Install the package:
1518
- </p>
1519
- <div class="listingblock">
1520
- <div class="content monospaced">
1521
- <pre>sudo apt-get install passenger</pre>
1522
- </div>
1523
- </div>
1524
- </li>
1525
- </ol></div>
1526
- </dd>
1527
- <dt class="hdlist1">
1528
- <strong>Enterprise</strong>
1529
- </dt>
1530
- <dd>
1531
- <div class="olist arabic"><ol class="arabic">
1532
- <li>
1533
- <p>
1534
- 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>.
1535
- </p>
1536
- </li>
1537
- <li>
1538
- <p>
1539
- <a href="#install_add_apt_repo">Add our APT repository.</a>
1540
- </p>
1541
- </li>
1542
- <li>
1543
- <p>
1544
- Install the packages:
1545
- </p>
1546
- <div class="listingblock">
1547
- <div class="content monospaced">
1548
- <pre>sudo apt-get install passenger-enterprise</pre>
1549
- </div>
1550
- </div>
1551
- </li>
1552
- </ol></div>
1553
- </dd>
1554
- </dl></div>
1555
- <div class="paragraph"><p>You can now proceed with a chapter for Deploying your (specific type of) application.</p></div>
1204
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/install/apt_repo/">https://www.phusionpassenger.com/library/install/apt_repo/</a></p></div>
1556
1205
  </div>
1557
1206
  </div>
1558
1207
  <div class="sect2">
1559
1208
  <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-16cek45" data-anchor="installing_or_upgrading_on_red_hat">2.4. Installing or upgrading on Red Hat or CentOS</h3>
1560
- <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>
1561
- <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>
1562
- <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>
1209
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/install/yum_repo/">https://www.phusionpassenger.com/library/install/yum_repo/</a></p></div>
1563
1210
  <div class="sect3">
1564
1211
  <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-7c3y3z" data-anchor="install_add_yum_repo">2.4.1. Adding our YUM repository</h4>
1565
- <div class="olist arabic"><ol class="arabic">
1566
- <li>
1567
- <p>
1568
- Install <a href="https://fedoraproject.org/wiki/EPEL">EPEL</a> and a few other prerequisites.
1569
- </p>
1570
- <div class="listingblock">
1571
- <div class="content monospaced">
1572
- <pre>sudo yum install epel-release pygpgme curl</pre>
1573
- </div>
1574
- </div>
1575
- </li>
1576
- <li>
1577
- <p>
1578
- Download the Passenger YUM repository definition.
1579
- </p>
1580
- <div class="dlist"><dl>
1581
- <dt class="hdlist1">
1582
- <strong>Open source</strong>
1583
- </dt>
1584
- <dd>
1585
- <div class="listingblock">
1586
- <div class="content monospaced">
1587
- <pre>sudo curl --fail -sSLo /etc/yum.repos.d/passenger.repo https://oss-binaries.phusionpassenger.com/yum/definitions/el-passenger.repo</pre>
1588
- </div>
1589
- </div>
1590
- </dd>
1591
- <dt class="hdlist1">
1592
- <strong>Enterprise</strong>
1593
- </dt>
1594
- <dd>
1595
- <div class="listingblock">
1596
- <div class="content monospaced">
1597
- <pre>unset HISTFILE
1598
- sudo curl --fail -sSL -u download:YOUR_DOWNLOAD_TOKEN -o /etc/yum.repos.d/passenger.repo https://www.phusionpassenger.com/enterprise_yum/el-passenger-enterprise.repo</pre>
1599
- </div>
1600
- </div>
1601
- <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>
1602
- <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>
1603
- </dd>
1604
- </dl></div>
1605
- </li>
1606
- <li>
1607
- <p>
1608
- Secure <span class="monospaced">passenger.repo</span>:
1609
- </p>
1610
- <div class="listingblock">
1611
- <div class="content monospaced">
1612
- <pre>sudo chown root: /etc/yum.repos.d/passenger.repo
1613
- sudo chmod 600 /etc/yum.repos.d/passenger.repo</pre>
1614
- </div>
1615
- </div>
1616
- </li>
1617
- </ol></div>
1212
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/install/yum_repo/">https://www.phusionpassenger.com/library/install/yum_repo/</a></p></div>
1618
1213
  </div>
1619
1214
  <div class="sect3">
1620
1215
  <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-1i5z60y" data-anchor="_installing_packages_2">2.4.2. Installing packages</h4>
1621
- <div class="admonitionblock">
1622
- <table><tr>
1623
- <td class="icon">
1624
- <img src="./images/icons/note.png" alt="Note">
1625
- </td>
1626
- <td class="content">
1627
- <div class="title">Notes about SELinux on Red Hat 6 and CentOS 6</div>
1628
- <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>
1629
- <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>
1630
- <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>
1631
- </td>
1632
- </tr></table>
1633
- </div>
1634
- <div class="paragraph"><p>You can install the Passenger packages as follows.</p></div>
1635
- <div class="dlist"><dl>
1636
- <dt class="hdlist1">
1637
- <strong>Open source</strong>
1638
- </dt>
1639
- <dd>
1640
- <div class="olist arabic"><ol class="arabic">
1641
- <li>
1642
- <p>
1643
- <a href="#install_add_yum_repo">Add our YUM repository.</a>
1644
- </p>
1645
- </li>
1646
- <li>
1647
- <p>
1648
- Install the package:
1649
- </p>
1650
- <div class="listingblock">
1651
- <div class="content monospaced">
1652
- <pre>sudo yum install passenger</pre>
1653
- </div>
1654
- </div>
1655
- </li>
1656
- </ol></div>
1657
- </dd>
1658
- <dt class="hdlist1">
1659
- <strong>Enterprise</strong>
1660
- </dt>
1661
- <dd>
1662
- <div class="olist arabic"><ol class="arabic">
1663
- <li>
1664
- <p>
1665
- 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>.
1666
- </p>
1667
- </li>
1668
- <li>
1669
- <p>
1670
- <a href="#install_add_yum_repo">Add our YUM repository.</a>
1671
- </p>
1672
- </li>
1673
- <li>
1674
- <p>
1675
- Install the packages:
1676
- </p>
1677
- <div class="listingblock">
1678
- <div class="content monospaced">
1679
- <pre>sudo yum install passenger-enterprise</pre>
1680
- </div>
1681
- </div>
1682
- </li>
1683
- </ol></div>
1684
- </dd>
1685
- </dl></div>
1686
- <div class="paragraph"><p>You can now proceed with a chapter for Deploying your (specific type of) application.</p></div>
1216
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/install/yum_repo/">https://www.phusionpassenger.com/library/install/yum_repo/</a></p></div>
1687
1217
  </div>
1688
1218
  </div>
1689
1219
  <div class="sect2">
@@ -1692,1290 +1222,125 @@ Install the packages:
1692
1222
  </div>
1693
1223
  <div class="sect2">
1694
1224
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="rubygems_generic_install"></span><h3 data-comment-topic="generic-installation-upgrade-and-downgrade-method-via-rubygems-1229ugi" data-anchor="rubygems_generic_install">2.6. Generic installation, upgrade and downgrade method: via RubyGems</h3>
1695
- <div class="paragraph"><p>RubyGems is only used as a method to obtain the Phusion Passenger files, so in case you have multiple Ruby versions it does not matter which Ruby’s RubyGems you use for installation. Once installed, Phusion Passenger can work with all other Ruby versions on your system. This is explained in <a href="#relationship_with_ruby">Phusion Passenger and its relationship with Ruby</a>.</p></div>
1696
- <span class="anchor_helper" id="is_ruby_home_or_system_wide_installed"></span><h4 class="float" data-anchor="is_ruby_home_or_system_wide_installed">Step 1: figuring out whether your Ruby is installed in the home directory or system-wide</h4>
1697
- <div class="paragraph"><p>Ruby may either be installed in the home directory, or system-wide. If it’s installed system-wide then we will want to install gems system-wide as well, so you need to switch to a root prompt first. If Ruby is installed in the home directory then we will want to install gems to the home directory as well, as a normal user.</p></div>
1698
- <div class="paragraph"><p>To find out which case applies, run the following command to find out where the <span class="monospaced">ruby</span> command is:</p></div>
1699
- <div class="listingblock">
1700
- <div class="content monospaced">
1701
- <pre>which ruby</pre>
1702
- </div>
1703
- </div>
1704
- <div class="paragraph"><p>Do you see a filename that references <em>/home</em> or <em>/Users</em>? If so then your Ruby interpreter is installed in your home directory and you can proceed to step 2. Otherwise, you need to switch to a root prompt by running one of the following commands:</p></div>
1705
- <div class="ulist"><ul>
1706
- <li>
1707
- <p>
1708
- Are you using RVM? Run <span class="monospaced">rvmsudo -H bash</span>
1709
- </p>
1710
- </li>
1711
- <li>
1712
- <p>
1713
- Are you not using RVM, or do you not know what RVM is? Run <span class="monospaced">sudo -H -s</span>
1714
- </p>
1715
- </li>
1716
- <li>
1717
- <p>
1718
- Is <em>sudo</em> not installed on your system? Run <span class="monospaced">su -c bash</span>
1719
- </p>
1720
- </li>
1721
- </ul></div>
1722
- <div class="paragraph"><p>You must maintain this root prompt throughout this installation guide.</p></div>
1723
- <span class="anchor_helper" id="_step_2_install_the_gem"></span><h4 class="float" data-anchor="_step_2_install_the_gem">Step 2: install the gem</h4>
1724
- <div class="dlist"><dl>
1725
- <dt class="hdlist1">
1726
- <strong>Open Source</strong>
1727
- </dt>
1728
- <dd>
1729
- <p>
1730
- Install the latest gem to obtain the files for the latest stable version of the open source Phusion Passenger:
1731
- </p>
1732
- <div class="listingblock">
1733
- <div class="content monospaced">
1734
- <pre>gem install passenger</pre>
1735
- </div>
1736
- </div>
1737
- <div class="sidebarblock">
1738
- <div class="content">
1739
- <div class="title">Previous versions and beta versions</div>
1740
- <div class="paragraph"><p>Sometimes you will want to obtain the latest beta version of Phusion Passenger. Beta versions are not normally selected by <span class="monospaced">gem install</span>, so to opt-in for beta versions you have to add the <span class="monospaced">--pre</span> argument:</p></div>
1741
- <div class="listingblock">
1742
- <div class="content monospaced">
1743
- <pre>gem install passenger --pre</pre>
1744
- </div>
1745
- </div>
1746
- <div class="paragraph"><p>If you want to obtain a specific version of Phusion Passenger, e.g. because you are downgrading, then specify the version number with <span class="monospaced">--version</span>:</p></div>
1747
- <div class="listingblock">
1748
- <div class="content monospaced">
1749
- <pre>gem install passenger --version 3.0.0</pre>
1750
- </div>
1751
- </div>
1752
- <div class="paragraph"><p>If you want to obtain a specific <strong>beta</strong> version of Phusion Passenger then you must also pass <span class="monospaced">--pre</span>:</p></div>
1753
- <div class="listingblock">
1754
- <div class="content monospaced">
1755
- <pre>gem install passenger --version 3.9.1.beta --pre</pre>
1756
- </div>
1757
- </div>
1758
- </div>
1759
- </div>
1760
- </dd>
1761
- <dt class="hdlist1">
1762
- <strong>Enterprise</strong>
1763
- </dt>
1764
- <dd>
1765
- <p>
1766
- First, download the <strong>license key</strong> from the <a href="https://www.phusionpassenger.com/orders">Customer Area</a> and save it as <span class="monospaced">/etc/passenger-enterprise-license</span>.
1767
- </p>
1768
- <div class="paragraph"><p>Next, add the Phusion Passenger Enterprise gem server to your RubyGems source list:</p></div>
1769
- <div class="listingblock">
1770
- <div class="content monospaced">
1771
- <pre>gem source --add https://download:YOUR_DOWNLOAD_TOKEN@www.phusionpassenger.com/enterprise_gems/</pre>
1772
- </div>
1773
- </div>
1774
- <div class="paragraph"><p>Substitute <em>YOUR_DOWNLOAD_TOKEN</em> with the one you find in the <a href="https://www.phusionpassenger.com/orders">Customer Area</a>. And notice the <strong>trailing slash</strong> in the URL! It is very important.</p></div>
1775
- <div class="paragraph"><p>Finally, install the latest gem to obtain the files for the latest stable version of Passenger Enterprise:</p></div>
1776
- <div class="listingblock">
1777
- <div class="content monospaced">
1778
- <pre>gem install passenger-enterprise-server</pre>
1779
- </div>
1780
- </div>
1781
- <div class="sidebarblock">
1782
- <div class="content">
1783
- <div class="title">Previous versions and beta versions</div>
1784
- <div class="paragraph"><p>Sometimes you will want to obtain the latest beta version of Phusion Passenger Enterprise. Beta versions are not normally selected by <span class="monospaced">gem install</span>, so to opt-in for beta versions you have to add the <span class="monospaced">--pre</span> argument:</p></div>
1785
- <div class="listingblock">
1786
- <div class="content monospaced">
1787
- <pre>gem install passenger-enterprise-server --pre</pre>
1788
- </div>
1789
- </div>
1790
- <div class="paragraph"><p>If you want to obtain a specific version of Phusion Passenger Enterprise, e.g. because you are downgrading, then specify the version number with <span class="monospaced">--version</span>:</p></div>
1791
- <div class="listingblock">
1792
- <div class="content monospaced">
1793
- <pre>gem install passenger-enterprise-server --version 3.0.0</pre>
1794
- </div>
1795
- </div>
1796
- <div class="paragraph"><p>If you want to obtain a specific <strong>beta</strong> version of Phusion Passenger then you must also pass <span class="monospaced">--pre</span>:</p></div>
1797
- <div class="listingblock">
1798
- <div class="content monospaced">
1799
- <pre>gem install passenger-enterprise-server --version 3.9.1.beta --pre</pre>
1800
- </div>
1801
- </div>
1802
- </div>
1803
- </div>
1804
- </dd>
1805
- </dl></div>
1225
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/install/">https://www.phusionpassenger.com/library/install/</a></p></div>
1806
1226
  </div>
1807
1227
  <div class="sect2">
1808
1228
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="tarball_generic_install"></span><h3 data-comment-topic="generic-installation-upgrade-and-downgrade-method-via-tarball-1rwvasy" data-anchor="tarball_generic_install">2.7. Generic installation, upgrade and downgrade method: via tarball</h3>
1809
- <span class="anchor_helper" id="_step_1_installing_ruby"></span><h4 class="float" data-anchor="_step_1_installing_ruby">Step 1: installing Ruby</h4>
1810
- <div class="paragraph"><p>Phusion Passenger supports multiple languages and its core is written in C++, but its installer and administration tools are written in Ruby, so you must install Ruby.</p></div>
1811
- <div class="paragraph"><p>Even though Ruby is required, Ruby will normally not be loaded during normal operation unless you deploy a Ruby web application on Phusion Passenger. Phusion Passenger’s dependency on Ruby is very minimal. See <a href="#relationship_with_ruby">Phusion Passenger and its relationship with Ruby</a> for details.</p></div>
1812
- <table class="tableblock frame-all grid-all" style="
1813
- width:100%;
1814
- ">
1815
- <col style="width:50%;">
1816
- <col style="width:50%;">
1817
- <tbody>
1818
- <tr>
1819
- <td class="tableblock halign-left valign-top"><p class="tableblock">Debian, Ubuntu</p></td>
1820
- <td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">sudo apt-get update</span><br>
1821
- <span class="monospaced">sudo apt-get install ruby rake</span></p></td>
1822
- </tr>
1823
- <tr>
1824
- <td class="tableblock halign-left valign-top"><p class="tableblock">Red Hat, CentOS, ScientificLinux, Amazon Linux</p></td>
1825
- <td class="tableblock halign-left valign-top"><p class="tableblock">Enable <a href="http://fedoraproject.org/wiki/EPEL">EPEL</a>, then run as root:<br>
1826
- <span class="monospaced">yum install ruby rubygem-rake</span></p></td>
1827
- </tr>
1828
- <tr>
1829
- <td class="tableblock halign-left valign-top"><p class="tableblock">Mac OS X</p></td>
1830
- <td class="tableblock halign-left valign-top"><p class="tableblock">No action needed. Ruby is installed by default.</p></td>
1831
- </tr>
1832
- <tr>
1833
- <td class="tableblock halign-left valign-top"><p class="tableblock">Other operating systems</p></td>
1834
- <td class="tableblock halign-left valign-top"><p class="tableblock">Install Ruby from <a href="http://www.ruby-lang.org/">the Ruby website</a>.</p></td>
1835
- </tr>
1836
- </tbody>
1837
- </table>
1838
- <span class="anchor_helper" id="_step_2_download_and_extract_the_tarball"></span><h4 class="float" data-anchor="_step_2_download_and_extract_the_tarball">Step 2: download and extract the tarball</h4>
1839
- <div class="dlist"><dl>
1840
- <dt class="hdlist1">
1841
- <strong>Open Source</strong>
1842
- </dt>
1843
- <dd>
1844
- <p>
1845
- Download the open source Phusion Passenger tarball from <a href="https://www.phusionpassenger.com/download#open_source">the Phusion Passenger website</a>.
1846
- </p>
1847
- <div class="paragraph"><p>Older versions can be found in <a href="https://www.phusionpassenger.com/file_releases">the release archive</a>.</p></div>
1848
- </dd>
1849
- <dt class="hdlist1">
1850
- <strong>Enterprise</strong>
1851
- </dt>
1852
- <dd>
1853
- <p>
1854
- <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a> customers can download the Phusion Passenger Enterprise tarball from the <a href="https://www.phusionpassenger.com/orders">Customer Area</a>.
1855
- </p>
1856
- <div class="paragraph"><p>Also be sure to download the <strong>license key</strong> and save it as <span class="monospaced">/etc/passenger-enterprise-license</span>.</p></div>
1857
- </dd>
1858
- </dl></div>
1859
- <div class="paragraph"><p>Once you have downloaded the tarball, pick a location to extract it to. You can pick any location. A good location is <em>/opt/passenger</em>. Create this directory and extract the tarball as follows:</p></div>
1860
- <div class="listingblock">
1861
- <div class="content monospaced">
1862
- <pre>mkdir /opt/passenger
1863
- cd /opt/passenger
1864
- tar xzvf /location-to/passenger-x.x.x.tar.gz
1865
- cd /opt/passenger/passenger-x.x.x</pre>
1866
- </div>
1867
- </div>
1868
- <div class="paragraph"><p>Note that <span class="monospaced">passenger-x.x.x</span> should be <span class="monospaced">passenger-enterprise-server-x.x.x</span> if you’re using Phusion Passenger Enterprise.</p></div>
1869
- <span class="anchor_helper" id="_step_3_adding_the_phusion_passenger_tools_to_path"></span><h4 class="float" data-anchor="_step_3_adding_the_phusion_passenger_tools_to_path">Step 3: adding the Phusion Passenger tools to PATH</h4>
1870
- <div class="paragraph"><p>Edit <span class="monospaced">/etc/bashrc</span> (or <span class="monospaced">/etc/bash.bashrc</span> on some systems) and append the following to the end of the file:</p></div>
1871
- <div class="listingblock">
1872
- <div class="content monospaced">
1873
- <pre>export PATH=/opt/passenger/passenger-x.x.x/bin:$PATH</pre>
1874
- </div>
1875
- </div>
1876
- <div class="paragraph"><p>Finally, restart all your shell sessions in order to activate this change. The installation is now complete.</p></div>
1229
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/install/">https://www.phusionpassenger.com/library/install/</a></p></div>
1877
1230
  </div>
1878
1231
  <div class="sect2">
1879
1232
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_upgrading_from_open_source_to_enterprise"></span><h3 data-comment-topic="upgrading-from-open-source-to-enterprise-1kezors" data-anchor="_upgrading_from_open_source_to_enterprise">2.8. Upgrading from open source to Enterprise</h3>
1880
- <div class="paragraph"><p>Phusion Passenger comes in two variants: an open source version, as well as an <a href="https://www.phusionpassenger.com/enterprise">Enterprise version</a> which introduces a myriad of useful features that can improve stability and performance and efficiency.</p></div>
1881
- <div class="paragraph"><p>Customers who have bought Phusion Passenger Enterprise can upgrade their open source installation to Enterprise as follows:</p></div>
1882
- <div class="olist arabic"><ol class="arabic">
1883
- <li>
1884
- <p>
1885
- <a href="#uninstalling">Uninstall the open source Phusion Passenger</a>.
1886
- </p>
1887
- </li>
1888
- <li>
1889
- <p>
1890
- Install the Enterprise version by following one of the installation guides in this section (e.g. <a href="#rubygems_generic_install">RubyGems generic installation</a> or <a href="#tarball_generic_install">tarball generic installation</a>).
1891
- </p>
1892
- </li>
1893
- </ol></div>
1894
- <div class="paragraph"><p>The uninstallation is necessary because the Enterprise Ruby gem has a different gem name (<em>passenger-enterprise-server</em> instead of <em>passenger</em>), but the same administration command names (e.g. <span class="monospaced">passenger-status</span>). Uninstalling the open source version avoids any conflicts.</p></div>
1233
+ <div class="paragraph"><p>This documentation has moved. <a href="https://www.phusionpassenger.com/library/install/standalone/upgrading_from_oss_to_enterprise.html">https://www.phusionpassenger.com/library/install/standalone/upgrading_from_oss_to_enterprise.html</a></p></div>
1895
1234
  </div>
1896
1235
  <div class="sect2">
1897
1236
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_cryptographic_verification_of_installation_files"></span><h3 data-comment-topic="cryptographic-verification-of-installation-files-85nwoi" data-anchor="_cryptographic_verification_of_installation_files">2.9. Cryptographic verification of installation files</h3>
1898
1237
  <div class="sect3">
1899
1238
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_synopsis_2"></span><h4 data-comment-topic="synopsis-1ij8j9r" data-anchor="_synopsis_2">2.9.1. Synopsis</h4>
1900
- <div class="paragraph"><p>We digitally sign various files with our GPG key so that you can check whether they’re legit, i.e. whether they really came from Phusion and haven’t been tampered with by a third party. We apply signing since the open source version 4.0.0 RC 4, or the Enterprise version 4.0.0 RC 1.</p></div>
1239
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/install/crypto_verify_install.html">https://www.phusionpassenger.com/library/install/crypto_verify_install.html</a></p></div>
1901
1240
  </div>
1902
1241
  <div class="sect3">
1903
1242
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_importing_the_phusion_software_signing_key"></span><h4 data-comment-topic="importing-the-phusion-software-signing-key-1u5hkcr" data-anchor="_importing_the_phusion_software_signing_key">2.9.2. Importing the Phusion Software Signing key</h4>
1904
- <div class="paragraph"><p>Phusion’s GPG key for signing software is as follows:</p></div>
1905
- <div class="literalblock">
1906
- <div class="content monospaced">
1907
- <pre>Phusion Software Signing (software-signing@phusion.nl)
1908
- Short key ID: 0x0A212A8C
1909
- Long key ID: 0x2AC745A50A212A8C
1910
- Fingerprint: D5F0 8514 2693 9232 F437 AB72 2AC7 45A5 0A21 2A8C</pre>
1911
- </div>
1912
- </div>
1913
- <div class="paragraph"><p>This key is stored at <a href="http://www.phusion.nl/about/gpg">the Phusion website</a> and at the key servers <a href="http://pool.sks-keyservers.net/pks/lookup?op=get&amp;search=0x2AC745A50A212A8C">sks-keyservers.net</a> and <a href="http://keyserver.ubuntu.com/pks/lookup?op=get&amp;search=0x2AC745A50A212A8C">keyserver.ubuntu.com</a>. You can import it to your keyring with one of these command:</p></div>
1914
- <div class="listingblock">
1915
- <div class="content monospaced">
1916
- <pre>gpg --keyserver pool.sks-keyservers.net --search-keys 0x2AC745A50A212A8C
1917
- # -OR-
1918
- gpg --keyserver keyserver.ubuntu.com --search-keys 0x2AC745A50A212A8C</pre>
1919
- </div>
1920
- </div>
1921
- <div class="paragraph"><p>The Phusion Software Signing key is only used for signing software. It’s never used for signing emails or for encrypting files, so please be suspicious if you encounter usage of this key outside the context of signing software, and alert us at <a href="mailto:support@phusion.nl">support@phusion.nl</a>. Include "notspam" in the message to bypass our spam filter.</p></div>
1922
- <div class="paragraph"><p>The email address <a href="mailto:software-signing@phusion.nl">software-signing@phusion.nl</a> redirects to <a href="mailto:info@phusion.nl">info@phusion.nl</a> so it’s safe to send email there.</p></div>
1243
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/install/crypto_verify_install.html">https://www.phusionpassenger.com/library/install/crypto_verify_install.html</a></p></div>
1923
1244
  </div>
1924
1245
  <div class="sect3">
1925
1246
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_verifying_the_phusion_software_signing_key"></span><h4 data-comment-topic="verifying-the-phusion-software-signing-key-qor1n1" data-anchor="_verifying_the_phusion_software_signing_key">2.9.3. Verifying the Phusion Software Signing key</h4>
1926
- <div class="paragraph"><p>The Phusion Software Signing key is also <strong>signed by the Phusion founders</strong>. Their keys are as follows:</p></div>
1927
- <div class="literalblock">
1928
- <div class="content monospaced">
1929
- <pre>Hongli Lai (hongli@phusion.nl)
1930
- Short key ID: 8C59158F
1931
- Long key ID: CD70085E8C59158F
1932
- Fingerprint: 218A 7255 83D0 2ECE F3A9 C2A7 CD70 085E 8C59 158F</pre>
1933
- </div>
1934
- </div>
1935
- <div class="literalblock">
1936
- <div class="content monospaced">
1937
- <pre>Ninh Bui (ninh@phusion.nl)
1938
- Short key ID: 69481265
1939
- Long key ID: AE405F7869481265
1940
- Fingerprint: A77C 9CEF 766D 0E7D A95B 8778 AE40 5F78 6948 1265</pre>
1941
- </div>
1942
- </div>
1943
- <div class="paragraph"><p>Both keys are stored at both sks-servers.net and keyserver.ubuntu.com. Import them with:</p></div>
1944
- <div class="listingblock">
1945
- <div class="content monospaced">
1946
- <pre>gpg --keyserver pool.sks-servers.net --search-keys 0xCD70085E8C59158F
1947
- gpg --keyserver pool.sks-servers.net --search-keys 0xAE405F7869481265
1948
- # -OR-
1949
- gpg --keyserver keyserver.ubuntu.com --search-keys 0xCD70085E8C59158F
1950
- gpg --keyserver keyserver.ubuntu.com --search-keys 0xAE405F7869481265</pre>
1951
- </div>
1952
- </div>
1247
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/install/crypto_verify_install.html">https://www.phusionpassenger.com/library/install/crypto_verify_install.html</a></p></div>
1953
1248
  </div>
1954
1249
  <div class="sect3">
1955
1250
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_verifying_the_gem_and_tarball"></span><h4 data-comment-topic="verifying-the-gem-and-tarball-i7tj7a" data-anchor="_verifying_the_gem_and_tarball">2.9.4. Verifying the gem and tarball</h4>
1956
- <div class="paragraph"><p>You can find the open source version’s gem and tarball GPG signatures at <a href="https://www.phusionpassenger.com/file_releases">https://www.phusionpassenger.com/file_releases</a>. The Enterprise version’s GPG signatures can be found in the <a href="https://www.phusionpassenger.com/orders">Customer Area</a>. All signatures have the <em>.asc</em> extension. Once you have imported our key, you can verify the validity of a file against its signature as follows:</p></div>
1957
- <div class="listingblock">
1958
- <div class="content monospaced">
1959
- <pre>$ gpg --verify passenger-x.x.x.tar.gz.asc passenger-x.x.x.tar.gz
1960
- gpg: Signature made Mon Mar 11 09:45:46 2013 CET using RSA key ID 0A212A8C
1961
- gpg: Good signature from "Phusion Software Signing &lt;software-signing@phusion.nl&gt;"</pre>
1962
- </div>
1963
- </div>
1251
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/install/crypto_verify_install.html">https://www.phusionpassenger.com/library/install/crypto_verify_install.html</a></p></div>
1964
1252
  </div>
1965
1253
  <div class="sect3">
1966
1254
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_verifying_git_signatures"></span><h4 data-comment-topic="verifying-git-signatures-dltpan" data-anchor="_verifying_git_signatures">2.9.5. Verifying Git signatures</h4>
1967
- <div class="paragraph"><p>Tags in the <a href="https://github.com/phusion/passenger">Git repository for the open source version</a> are also tagged. You can verify a Git tag as follows:</p></div>
1968
- <div class="listingblock">
1969
- <div class="content monospaced">
1970
- <pre>$ git tag --verify release-x.x.x
1971
- object d886f34b5705e4314feccaf0d77b9a38416e15e0
1972
- type commit
1973
- tag release-4.0.0.rc5
1974
- tagger Hongli Lai (Phusion) &lt;hongli@phusion.nl&gt; 1362993117 +0100
1975
-
1976
- This is a tag message.
1977
- gpg: Signature made Mon Mar 11 10:12:02 2013 CET using RSA key ID 0A212A8C
1978
- gpg: Good signature from "Phusion Software Signing &lt;software-signing@phusion.nl&gt;"</pre>
1979
- </div>
1980
- </div>
1255
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/install/crypto_verify_install.html">https://www.phusionpassenger.com/library/install/crypto_verify_install.html</a></p></div>
1981
1256
  </div>
1982
1257
  <div class="sect3">
1983
1258
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_verifying_debian_packages"></span><h4 data-comment-topic="verifying-deb-and-rpm-packages-uga0ho" data-anchor="_verifying_debian_packages">2.9.6. Verifying Debian packages</h4>
1984
- <div class="paragraph"><p>Our <a href="#install_on_debian_ubuntu">APT repository</a> is signed by Phusion Automated Software Signing (<a href="mailto:auto-software-signing@phusion.nl">auto-software-signing@phusion.nl</a>). Packages are automatically checked upon installation.</p></div>
1259
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/install/crypto_verify_install.html">https://www.phusionpassenger.com/library/install/crypto_verify_install.html</a></p></div>
1985
1260
  </div>
1986
1261
  <div class="sect3">
1987
1262
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_verifying_rpm_packages"></span><h4 data-comment-topic="verifying-rpm-packages-1m745i5" data-anchor="_verifying_rpm_packages">2.9.7. Verifying RPM packages</h4>
1988
- <div class="paragraph"><p>Our <a href="#installing_or_upgrading_on_red_hat">YUM repository</a> is signed by <a href="https://packagecloud.io">PackageCloud</a> (<a href="mailto:ops@packagecloud.io">ops@packagecloud.io</a>). PackageCloud is the RPM package hosting service that we use. You can find their key <a href="https://packagecloud.io/gpg.key">here</a>. Packages are automatically checked upon installation.</p></div>
1263
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/install/crypto_verify_install.html">https://www.phusionpassenger.com/library/install/crypto_verify_install.html</a></p></div>
1989
1264
  </div>
1990
1265
  <div class="sect3">
1991
1266
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_revocation"></span><h4 data-comment-topic="revocation-ukzeg9" data-anchor="_revocation">2.9.8. Revocation</h4>
1992
- <div class="paragraph"><p>In the event our key is compromised, we will revoke the key and upload the revocation information to sks-servers.net and keyserver.ubuntu.com. However your system will not know about the revocation until you update the keys from the keyservers. You should update your keys regularly (e.g. once a week) by invoking:</p></div>
1993
- <div class="listingblock">
1994
- <div class="content monospaced">
1995
- <pre>gpg --refresh-keys --keyserver pool.sks-servers.net
1996
- # -OR-
1997
- gpg --refresh-keys --keyserver keyserver.ubuntu.com</pre>
1998
- </div>
1999
- </div>
2000
- <div class="paragraph"><p>If you installed Phusion Passenger through our APT repository, then you should update APT’s keyring from time to time as well:</p></div>
2001
- <div class="listingblock">
2002
- <div class="content monospaced">
2003
- <pre>sudo apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com</pre>
2004
- </div>
2005
- </div>
1267
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/install/crypto_verify_install.html">https://www.phusionpassenger.com/library/install/crypto_verify_install.html</a></p></div>
2006
1268
  </div>
2007
1269
  </div>
2008
1270
  <div class="sect2">
2009
1271
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_customizing_the_compilation_process"></span><h3 data-comment-topic="customizing-the-compilation-process-j4xj2t" data-anchor="_customizing_the_compilation_process">2.10. Customizing the compilation process</h3>
2010
- <div class="paragraph"><p>The Phusion Passenger compilation process can be customized with environment variables. You can learn more about environment variables in <a href="#about_environment_variables">About environment variables</a>.</p></div>
2011
1272
  <div class="sect3">
2012
1273
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_setting_the_compiler"></span><h4 data-comment-topic="setting-the-compiler-1fxfulc" data-anchor="_setting_the_compiler">2.10.1. Setting the compiler</h4>
2013
- <div class="paragraph"><p>You can force the Phusion Passenger build system to use a specific C or C++ compiler by setting the <span class="monospaced">CC</span> and <span class="monospaced">CXX</span> environment variables. These may be set to any arbitrary shell commands.</p></div>
2014
- <div class="paragraph"><p>For example, contributors who want to hack on Phusion Passenger may want to use Clang for faster compilation and <a href="http://ccache.samba.org/">ccache</a> for faster recompilation, and may want to enable more error-catching compilation flags:</p></div>
2015
- <div class="listingblock">
2016
- <div class="content">
2017
- <!-- Generator: GNU source-highlight 2.11.1
2018
- by Lorenzo Bettini
2019
- http://www.lorenzobettini.it
2020
- http://www.gnu.org/software/src-highlite -->
2021
- <pre><tt><span style="font-weight: bold"><span style="color: #0000FF">export</span></span> <span style="color: #009900">CC</span><span style="color: #990000">=</span><span style="color: #FF0000">'ccache clang -fcolor-diagnostics -Qunused-arguments -fcatch-undefined-behavior -ftrapv'</span>
2022
- <span style="font-weight: bold"><span style="color: #0000FF">export</span></span> <span style="color: #009900">CXX</span><span style="color: #990000">=</span><span style="color: #FF0000">'ccache clang++ -fcolor-diagnostics -Qunused-arguments -fcatch-undefined-behavior -ftrapv'</span></tt></pre>
2023
- </div>
2024
- </div>
2025
- <div class="admonitionblock">
2026
- <table><tr>
2027
- <td class="icon">
2028
- <img src="./images/icons/note.png" alt="Note">
2029
- </td>
2030
- <td class="content">If you run the installer with <span class="monospaced">sudo</span> then environment variables may not be passed properly. Learn more at <a href="#env_vars_and_sudo">Environment variables and sudo</a>.</td>
2031
- </tr></table>
2032
- </div>
2033
1274
  </div>
2034
1275
  <div class="sect3">
2035
1276
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_adding_additional_compiler_or_linker_flags"></span><h4 data-comment-topic="adding-additional-compiler-or-linker-flags-nxfour" data-anchor="_adding_additional_compiler_or_linker_flags">2.10.2. Adding additional compiler or linker flags</h4>
2036
- <div class="paragraph"><p>On some systems, C/C++ libraries and headers that Phusion Passenger requires may be located in a non-standard directory. You can force the Phusion Passenger build system to look in those locations by injecting compiler and linker flags using the following environment variables:</p></div>
2037
- <div class="dlist"><dl>
2038
- <dt class="hdlist1">
2039
- <span class="monospaced">EXTRA_PRE_CFLAGS</span>
2040
- </dt>
2041
- <dd>
2042
- <p>
2043
- These flags are injected into all C compiler invocations that involve compiling C source files. This also covers compiler invocations that compile <strong>and</strong> link. The flags are injected at the beginning of the command string, even before <span class="monospaced">EXTRA_PRE_LDFLAGS</span>.
2044
- </p>
2045
- </dd>
2046
- <dt class="hdlist1">
2047
- <span class="monospaced">EXTRA_CFLAGS</span>
2048
- </dt>
2049
- <dd>
2050
- <p>
2051
- Similar to <span class="monospaced">EXTRA_PRE_CFLAGS</span>, but injected at the end of the command string, before <span class="monospaced">EXTRA_LDFLAGS</span>.
2052
- </p>
2053
- </dd>
2054
- <dt class="hdlist1">
2055
- <span class="monospaced">EXTRA_PRE_CXXFLAGS</span>
2056
- </dt>
2057
- <dd>
2058
- <p>
2059
- Similar to <span class="monospaced">EXTRA_PRE_CFLAGS</span>, but for C++ compiler invocations.
2060
- </p>
2061
- </dd>
2062
- <dt class="hdlist1">
2063
- <span class="monospaced">EXTRA_CXXFLAGS</span>
2064
- </dt>
2065
- <dd>
2066
- <p>
2067
- Similar to <span class="monospaced">EXTRA_CFLAGS</span>, but for C++ compiler invocations.
2068
- </p>
2069
- </dd>
2070
- <dt class="hdlist1">
2071
- <span class="monospaced">EXTRA_PRE_LDFLAGS</span>
2072
- </dt>
2073
- <dd>
2074
- <p>
2075
- These flags are injected into all C/C++ compiler invocations that involve linking. This includes compiler invocations that compile <strong>and</strong> link. The flags are injected at the beginning of the command string, but after <span class="monospaced">EXTRA_PRE_CFLAGS</span>/<span class="monospaced">EXTRA_PRE_CXXFLAGS</span>.
2076
- </p>
2077
- </dd>
2078
- <dt class="hdlist1">
2079
- <span class="monospaced">EXTRA_PRE_C_LDFLAGS</span>
2080
- </dt>
2081
- <dd>
2082
- <p>
2083
- These flags are injected into all C compiler invocations that involve linking, right after <span class="monospaced">EXTRA_PRE_LDFLAGS</span>.
2084
- </p>
2085
- </dd>
2086
- <dt class="hdlist1">
2087
- <span class="monospaced">EXTRA_PRE_CXX_LDFLAGS</span>
2088
- </dt>
2089
- <dd>
2090
- <p>
2091
- Similar to <span class="monospaced">EXTRA_PRE_CXX_LDFLAGS</span>, but for C++ compiler invocations.
2092
- </p>
2093
- </dd>
2094
- <dt class="hdlist1">
2095
- <span class="monospaced">EXTRA_LDFLAGS</span>
2096
- </dt>
2097
- <dd>
2098
- <p>
2099
- Similar to <span class="monospaced">EXTRA_PRE_LDFLAGS</span>, but injected at the very end of the command string, even after <span class="monospaced">EXTRA_CFLAGS</span> and <span class="monospaced">EXTRA_CXXFLAGS</span>.
2100
- </p>
2101
- </dd>
2102
- <dt class="hdlist1">
2103
- <span class="monospaced">EXTRA_C_LDFLAGS</span>
2104
- </dt>
2105
- <dd>
2106
- <p>
2107
- Similar to <span class="monospaced">EXTRA_LDFLAGS</span>, but only injected for C executable linking commands. Injected right after <span class="monospaced">EXTRA_LDFLAGS</span>.
2108
- </p>
2109
- </dd>
2110
- <dt class="hdlist1">
2111
- <span class="monospaced">EXTRA_CXX_LDFLAGS</span>
2112
- </dt>
2113
- <dd>
2114
- <p>
2115
- Similar to <span class="monospaced">EXTRA_LDFLAGS</span>, but only injected for C++ executable linking commands. Injected right after <span class="monospaced">EXTRA_LDFLAGS</span>.
2116
- </p>
2117
- </dd>
2118
- <dt class="hdlist1">
2119
- <span class="monospaced">PASSENGER_THREAD_LOCAL_STORAGE</span>
2120
- </dt>
2121
- <dd>
2122
- <p>
2123
- Setting this to 1 will enable the <span class="monospaced">PASSENGER_THREAD_LOCAL_STORAGE</span> macro, which forcefully disables the use of thread-local storage inside the Phusion Passenger codebase. Setting this environment variable is useful on systems that have broken support for thread-local storage, despite passing our build system’s check for proper thread-local storage support. At the time of writing, one user has reported that Ubuntu 12.04 32-bit has broken thread-local storage report although neither the reporter nor us were able to reproduce the problem on any other systems running Ubuntu 12.04 32-bit. Note that this flag has no effect on non-Phusion Passenger code.
2124
- </p>
2125
- </dd>
2126
- </dl></div>
2127
- <div class="admonitionblock">
2128
- <table><tr>
2129
- <td class="icon">
2130
- <img src="./images/icons/note.png" alt="Note">
2131
- </td>
2132
- <td class="content">If you run the installer with <span class="monospaced">sudo</span> then environment variables may not be passed properly. Learn more at <a href="#env_vars_and_sudo">Environment variables and sudo</a>.</td>
2133
- </tr></table>
2134
- </div>
2135
1277
  </div>
2136
1278
  <div class="sect3">
2137
1279
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="forcing_location_of_command_line_tools_and_dependencies"></span><h4 data-comment-topic="forcing-location-of-command-line-tools-and-dependencies-xajpg1" data-anchor="forcing_location_of_command_line_tools_and_dependencies">2.10.3. Forcing location of command line tools and dependencies</h4>
2138
- <div class="paragraph"><p>The Phusion Passenger build system attempts to autodetect many things by locating relevant helper tools. For example, to find out which compiler flags it should use for compiling Apache modules, it locates the <span class="monospaced">apxs2</span> command and queries it. To find out which compiler flags it should use for libcurl, it queries the <span class="monospaced">curl-config</span> command. These commands may not be in <span class="monospaced">$PATH</span>, or even when they are you may want to use a different one.</p></div>
2139
- <div class="paragraph"><p>You can force the build to find certain command line tools at certain locations by using the following environment variables:</p></div>
2140
- <div class="dlist"><dl>
2141
- <dt class="hdlist1">
2142
- <span class="monospaced">HTTPD</span>
2143
- </dt>
2144
- <dd>
2145
- <p>
2146
- The location of the <span class="monospaced">httpd</span> executable (the Apache server executable).
2147
- </p>
2148
- </dd>
2149
- <dt class="hdlist1">
2150
- <span class="monospaced">APXS2</span>
2151
- </dt>
2152
- <dd>
2153
- <p>
2154
- The location of the <span class="monospaced">apxs2</span> executable (the Apache module developer tool). Only used by <span class="monospaced">passenger-install-apache2-module</span>.
2155
- </p>
2156
- <div class="paragraph"><p>This environment variable, together with <span class="monospaced">HTTPD</span>, are what you need to customize if you have multiple Apache installations on your system, or if your Apache is located in a non-standard location which Phusion Passenger cannot detect. By setting <span class="monospaced">APXS2</span> and <span class="monospaced">HTTP</span> to the right paths, you can force Phusion Passenger to be compiled against that specific Apache installation.</p></div>
2157
- <div class="paragraph"><p>For example, if your Apache installation is located in <span class="monospaced">/opt/lamp/apache2</span>, then you can run the installer as follows:</p></div>
2158
- <div class="listingblock">
2159
- <div class="content monospaced">
2160
- <pre>$ sudo bash
2161
- # export HTTPD=/opt/lampp/apache2/bin/apache
2162
- # export APXS2=/opt/lampp/apache2/bin/apxs
2163
- # passenger-install-apache2-module</pre>
2164
- </div>
2165
1280
  </div>
2166
- </dd>
2167
- <dt class="hdlist1">
2168
- <span class="monospaced">APR_CONFIG</span>
2169
- </dt>
2170
- <dd>
2171
- <p>
2172
- The location of the <span class="monospaced">apr-config</span> executable (the Apache Portable Runtime developer tool).
2173
- </p>
2174
- </dd>
2175
- <dt class="hdlist1">
2176
- <span class="monospaced">APU_CONFIG</span>
2177
- </dt>
2178
- <dd>
2179
- <p>
2180
- The location of the <span class="monospaced">apu-config</span> executable (the Apache Portable Runtime Utility developer tool).
2181
- </p>
2182
- </dd>
2183
- <dt class="hdlist1">
2184
- <span class="monospaced">MAKE</span>
2185
- </dt>
2186
- <dd>
2187
- <p>
2188
- The location of a <span class="monospaced">make</span> tool. It does not matter which implementation of <span class="monospaced">make</span> this is.
2189
- </p>
2190
- </dd>
2191
- <dt class="hdlist1">
2192
- <span class="monospaced">GMAKE</span>
2193
- </dt>
2194
- <dd>
2195
- <p>
2196
- The location of the GNU-compatible <span class="monospaced">make</span> tool.
2197
- </p>
2198
- </dd>
2199
- </dl></div>
2200
- <div class="admonitionblock">
2201
- <table><tr>
2202
- <td class="icon">
2203
- <img src="./images/icons/tip.png" alt="Tip">
2204
- </td>
2205
- <td class="content">If you do not know what environment variables are, or how to use them, then please read <a href="#env_vars_and_sudo">Environment variables and sudo</a>.</td>
2206
- </tr></table>
2207
1281
  </div>
2208
- <div class="admonitionblock">
2209
- <table><tr>
2210
- <td class="icon">
2211
- <img src="./images/icons/note.png" alt="Note">
2212
- </td>
2213
- <td class="content">If you run the installer with <span class="monospaced">sudo</span> then environment variables may not be passed properly. Learn more at <a href="#env_vars_and_sudo">Environment variables and sudo</a>.</td>
2214
- </tr></table>
1282
+ <div class="sect2">
1283
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="uninstalling"></span><h3 data-comment-topic="uninstalling-3hpprb" data-anchor="uninstalling">2.11. Uninstalling</h3>
1284
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/install/standalone/uninstall/">https://www.phusionpassenger.com/library/install/standalone/uninstall/</a></p></div>
2215
1285
  </div>
2216
- </div>
2217
- </div>
2218
- <div class="sect2">
2219
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="uninstalling"></span><h3 data-comment-topic="uninstalling-3hpprb" data-anchor="uninstalling">2.11. Uninstalling</h3>
2220
- <div class="ulist"><ul>
2221
- <li>
2222
- <p>
2223
- If you installed Phusion Passenger through Homebrew, then run <span class="monospaced">brew uninstall passenger</span>.
2224
- </p>
2225
- </li>
2226
- <li>
2227
- <p>
2228
- If you installed Phusion Passenger via a Ruby gem, then run <span class="monospaced">gem uninstall passenger</span> (or, if you’re a <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a> user, <span class="monospaced">gem uninstall passenger-enterprise-server</span>).
2229
- You <a href="#is_ruby_home_or_system_wide_installed">might have to run this as root</a>.
2230
- </p>
2231
- </li>
2232
- <li>
2233
- <p>
2234
- If you installed Phusion Passenger via a source tarball, then remove the directory
2235
- in which you placed the extracted Phusion Passenger files. This directory is the
2236
- same as the one pointed to the by <span class="monospaced">PassengerRoot</span>/<span class="monospaced">passenger_root</span> configuration directive.
2237
- </p>
2238
- </li>
2239
- <li>
2240
- <p>
2241
- If you installed Phusion Passenger through APT or YUM, then use them to uninstall Phusion Passenger.
2242
- </p>
2243
- </li>
2244
- </ul></div>
2245
- </div>
2246
- <div class="sect2">
2247
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="moving_phusion_passenger"></span><h3 data-comment-topic="moving-to-a-different-directory-b3lpy1" data-anchor="moving_phusion_passenger">2.12. Moving to a different directory</h3>
2248
- <div class="paragraph"><p>If you installed Phusion Passenger through a tarball then you can move the Phusion Passenger directory to another location. This is not possible if you used any of the other installation methods.</p></div>
2249
- <div class="paragraph"><p>First, move the directory to whereever you like:</p></div>
2250
- <div class="listingblock">
2251
- <div class="content monospaced">
2252
- <pre>mv /opt/passenger/passenger-4.0.0 /usr/local/passenger-4.0.0</pre>
2253
- </div>
2254
- </div>
2255
- <div class="paragraph"><p>If you used <a href="#tarball_generic_install">the tarball installation method</a> and you added Phusion Passenger’s <span class="monospaced">bin</span> subdirectory to <span class="monospaced">PATH</span>, then you must update your PATH with the new location. Open <span class="monospaced">/etc/bashrc</span> (or <span class="monospaced">/etc/bash.bashrc</span> on some systems) and change:</p></div>
2256
- <div class="listingblock">
2257
- <div class="content monospaced">
2258
- <pre>export PATH=/opt/passenger/passenger-4.0.0/bin:$PATH</pre>
2259
- </div>
2260
- </div>
2261
- <div class="paragraph"><p>to:</p></div>
2262
- <div class="listingblock">
2263
- <div class="content monospaced">
2264
- <pre>export PATH=/usr/local/passenger-4.0.0/bin:$PATH</pre>
2265
- </div>
2266
- </div>
2267
- <div class="paragraph"><p>Finally, restart all your shell sessions to activate the PATH change.</p></div>
1286
+ <div class="sect2">
1287
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="moving_phusion_passenger"></span><h3 data-comment-topic="moving-to-a-different-directory-b3lpy1" data-anchor="moving_phusion_passenger">2.12. Moving to a different directory</h3>
1288
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/install/standalone/moving.html">https://www.phusionpassenger.com/library/install/standalone/moving.html</a></p></div>
2268
1289
  </div>
2269
1290
  </div>
2270
1291
  </div>
2271
1292
  <div class="sect1">
2272
1293
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_usage"></span><h2 data-comment-topic="usage-1eyt33o" data-anchor="_usage">3. Usage</h2>
2273
1294
  <div class="sectionbody">
2274
- <div class="paragraph"><p>Go to your application’s root directory, and run:</p></div>
2275
- <div class="listingblock">
2276
- <div class="content monospaced">
2277
- <pre>passenger start</pre>
2278
- </div>
2279
- </div>
1295
+ <div class="paragraph"><p>This documentation has moved. Please visit the walkthroughs at <a href="https://www.phusionpassenger.com/library/">https://www.phusionpassenger.com/library/</a> to learn how to use Passenger Standalone. Or visit <a href="https://www.phusionpassenger.com/library/deploy/standalone/deploy/">the new deployment documentation</a>.</p></div>
2280
1296
  </div>
2281
1297
  </div>
2282
1298
  <div class="sect1">
2283
1299
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_configuration"></span><h2 data-comment-topic="configuration-10trfau" data-anchor="_configuration">4. Configuration</h2>
2284
1300
  <div class="sectionbody">
1301
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/config/standalone/">https://www.phusionpassenger.com/library/config/standalone/</a></p></div>
2285
1302
  <div class="sect2">
2286
1303
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_command_line_options"></span><h3 data-comment-topic="command-line-options-1njv6kt" data-anchor="_command_line_options">4.1. Command line options</h3>
2287
- <div class="paragraph"><p>Most configuration is done by customizing the arguments passed to the <span class="monospaced">passenger</span> command. The most important ones are:</p></div>
2288
- <div class="dlist"><dl>
2289
- <dt class="hdlist1">
2290
- <span class="monospaced">--port NUMBER</span>
2291
- </dt>
2292
- <dd>
2293
- <p>
2294
- The port number that Phusion Passenger Standalone should listen on. If not given, port 3000 is assumed.
2295
- </p>
2296
- </dd>
2297
- <dt class="hdlist1">
2298
- <span class="monospaced">--environment NAME</span>
2299
- </dt>
2300
- <dd>
2301
- <p>
2302
- Customizes the value of the <span class="monospaced">RAILS_ENV</span>, <span class="monospaced">RACK_ENV</span>, <span class="monospaced">WSGI_ENV</span>, <span class="monospaced">NODE_ENV</span> and <span class="monospaced">PASSENGER_APP_ENV</span> environment variables. Some web frameworks, for example Rails and Connect.js, adjust their behavior according to the environment. The default value is <em>development</em>.
2303
- </p>
2304
- </dd>
2305
- <dt class="hdlist1">
2306
- <span class="monospaced">--max-pool-size NUMBER</span>
2307
- </dt>
2308
- <dd>
2309
- <p>
2310
- The maximum number of application processes to run. The maximum number that you can run depends on the amount of memory your server has. The article <a href="http://blog.phusion.nl/2013/03/12/tuning-phusion-passengers-concurrency-settings/">Tuning Phusion Passenger’s concurrency settings</a> explains how you can infer a good number for this option.
2311
- </p>
2312
- </dd>
2313
- <dt class="hdlist1">
2314
- <span class="monospaced">--min-instances NUMBER</span>
2315
- </dt>
2316
- <dd>
2317
- <p>
2318
- If you don’t want the number of application processes to scale dynamically, then use this option to set it to a value equal to <span class="monospaced">--max-pool-size</span>.
2319
- </p>
2320
- </dd>
2321
- <dt class="hdlist1">
2322
- <span class="monospaced">--spawn-method NAME</span>
2323
- </dt>
2324
- <dd>
2325
- <p>
2326
- When set to "smart" (the default), Phusion Passenger preloads your app and utilizes copy-on-write in order to save memory. You can disable this by setting this option to "direct". Preloading is only supported for Ruby apps. For apps written in other languages, it is as if "direct" is always used.
2327
- </p>
2328
- </dd>
2329
- <dt class="hdlist1">
2330
- <span class="monospaced">--friendly-error-pages</span>
2331
- </dt>
2332
- <dd>
2333
- <p>
2334
- Phusion Passenger can display a friendly error page whenever your application fails to start. The friendly error page presents the startup error message, some suggestions for solving the problem, a backtrace, and a dump of the environment variables. This feature is very useful during application development and useful for less experienced system administrators, but the page might reveal potentially sensitive information, depending on the application. For this reason, friendly error pages are turned off by default when <span class="monospaced">--environment</span> is set to <em>staging</em> or <em>production</em>, but enabled by default otherwise.
2335
- </p>
2336
- <div class="paragraph"><p>You can use <span class="monospaced">--friendly-error-pages</span> and <span class="monospaced">--no-friendly-error-pages</span> to explicitly enable or disable this feature, respectively.</p></div>
2337
- </dd>
2338
- <dt class="hdlist1">
2339
- <span class="monospaced">--sticky-sessions</span>
2340
- </dt>
2341
- <dd>
2342
- <p>
2343
- Enables <a href="Users%20guide%20Nginx.html#PassengerStickySessions">sticky sessions</a>. Required for SockJS, Socket.io, faye-websocket and Meteor JS applications.
2344
- </p>
2345
- </dd>
2346
- <dt class="hdlist1">
2347
- <span class="monospaced">--sticky-sessions-cookie-name NAME</span>
2348
- </dt>
2349
- <dd>
2350
- <p>
2351
- Allows customizing the sticky session cookie name.
2352
- </p>
2353
- </dd>
2354
- <dt class="hdlist1">
2355
- <span class="monospaced">--ssl</span>
2356
- </dt>
2357
- <dd>
2358
- <p>
2359
- Enables SSL support. If this is set, you must also set <span class="monospaced">--ssl-certificate</span> and <span class="monospaced">--ssl-certificate-key</span> to the SSL certificate and key files, respectively.
2360
- </p>
2361
- </dd>
2362
- <dt class="hdlist1">
2363
- <span class="monospaced">--ssl-port</span>
2364
- </dt>
2365
- <dd>
2366
- <p>
2367
- If <span class="monospaced">--ssl</span> is given, and you set this option, then Phusion Passenger Standalone will listen for HTTP on the regular <span class="monospaced">--port</span> number, <strong>as well as</strong> listen for HTTPS on the port you specified with this option. For example:
2368
- </p>
2369
- <div class="listingblock">
2370
- <div class="content monospaced">
2371
- <pre># Listen for HTTP on port 3000, HTTPS on port 3001.
2372
- passenger start --ssl --ssl-certificate ... --ssl-certificate-key ... --ssl-port 3001</pre>
2373
- </div>
2374
- </div>
2375
- </dd>
2376
- <dt class="hdlist1">
2377
- <span class="monospaced">--nginx-config-template</span>
2378
- </dt>
2379
- <dd>
2380
- <p>
2381
- Specifies the Nginx configuration template file to use. See <a href="#advanced_configuration">Advanced configuration</a>.
2382
- </p>
2383
- </dd>
2384
- </dl></div>
2385
- <div class="paragraph"><p>See <span class="monospaced">--help</span> for all available options.</p></div>
1304
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/config/standalone/reference/">https://www.phusionpassenger.com/library/config/standalone/reference/</a></p></div>
2386
1305
  </div>
2387
1306
  <div class="sect2">
2388
1307
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="config_file"></span><h3 data-comment-topic="configuration-file-xng7yp" data-anchor="config_file">4.2. Configuration file</h3>
2389
- <div class="paragraph"><p><strong>Introduced in version 4.0.24.</strong></p></div>
2390
- <div class="paragraph"><p>It is possible to store some options in a configuration file <span class="monospaced">Passengerfile.json</span> in the application directory. Configuration in this file overrides command line options. The configuration file format is JSON.</p></div>
2391
- <div class="paragraph"><p>In case Passenger Standalone is in <a href="#mass_deployment">mass deployment mode</a>, such a configuration file allows customizing options on a per-application basis.</p></div>
2392
- <div class="paragraph"><p>The following configuration options are supported:</p></div>
2393
- <div class="dlist"><dl>
2394
- <dt class="hdlist1">
2395
- <span class="monospaced">port</span>
2396
- </dt>
2397
- <dd>
2398
- <p>
2399
- Equivalent to the <span class="monospaced">--port</span> command line option.
2400
- </p>
2401
- </dd>
2402
- <dt class="hdlist1">
2403
- <span class="monospaced">environment</span>
2404
- </dt>
2405
- <dd>
2406
- <p>
2407
- Equivalent to the <span class="monospaced">--environment</span> command line option.
2408
- </p>
2409
- </dd>
2410
- <dt class="hdlist1">
2411
- <span class="monospaced">max_pool_size</span>
2412
- </dt>
2413
- <dd>
2414
- <p>
2415
- Equivalent to the <span class="monospaced">--max-pool-size</span> command line option. But when in mass deployment mode, this option in the configuration file has no effect; the command line option should be used to customize this.
2416
- </p>
2417
- </dd>
2418
- <dt class="hdlist1">
2419
- <span class="monospaced">min_instances</span>
2420
- </dt>
2421
- <dd>
2422
- <p>
2423
- Equivalent to the <span class="monospaced">--min-instances</span> command line option.
2424
- </p>
2425
- </dd>
2426
- <dt class="hdlist1">
2427
- <span class="monospaced">spawn_method</span>
2428
- </dt>
2429
- <dd>
2430
- <p>
2431
- Equivalent to the <span class="monospaced">--spawn-method</span> command line option.
2432
- </p>
2433
- </dd>
2434
- <dt class="hdlist1">
2435
- <span class="monospaced">sticky_sessions</span>
2436
- </dt>
2437
- <dd>
2438
- <p>
2439
- Equivalent to the <span class="monospaced">--sticky-sessions</span> command line option.
2440
- </p>
2441
- </dd>
2442
- <dt class="hdlist1">
2443
- <span class="monospaced">sticky_sessions_cookie_name</span>
2444
- </dt>
2445
- <dd>
2446
- <p>
2447
- Equivalent to the <span class="monospaced">--sticky-sessions-cookie-name</span> command line option.
2448
- </p>
2449
- </dd>
2450
- <dt class="hdlist1">
2451
- <span class="monospaced">ssl</span>
2452
- </dt>
2453
- <dd>
2454
- <p>
2455
- Equivalent to the <span class="monospaced">--ssl</span> command line option. When given, you must also set <span class="monospaced">ssl_certificate</span> and <span class="monospaced">ssl_certificate_key</span> in the configuration file.
2456
- </p>
2457
- </dd>
2458
- <dt class="hdlist1">
2459
- <span class="monospaced">ssl_port</span>
2460
- </dt>
2461
- <dd>
2462
- <p>
2463
- Equivalent to the <span class="monospaced">--ssl-port</span> command line option.
2464
- </p>
2465
- <div class="paragraph"><p>When in <a href="#mass_deployment">mass deployment mode</a>, you will probably want to set a different <span class="monospaced">port</span> too. If you don’t, and you end up in a situation in which a port is used for both HTTP and HTTPS traffic, then the builtin Nginx core will abort with an error.</p></div>
2466
- </dd>
2467
- <dt class="hdlist1">
2468
- <span class="monospaced">server_names</span> (Enterprise only)
2469
- </dt>
2470
- <dd>
2471
- <p>
2472
- Only relevant in <a href="#mass_deployment">mass deployment mode</a>. This option specifies which server names (host names) should be routed to this application. This option must be an array of names, e.g. <span class="monospaced">"server_names": ["foo.com", "bar.com"]</span>. By default, the name of the application directory is used as the server name. For example, for an application located in /webapps/foobar.com, "foobar.com" is used as the server name.
2473
- </p>
2474
- </dd>
2475
- <dt class="hdlist1">
2476
- <span class="monospaced">envvars</span> (since 5.0.0 RC 1)
2477
- </dt>
2478
- <dd>
2479
- <p>
2480
- Environment variables to pass to the application. This option must be a key-value map, e.g. <span class="monospaced">"envvars": { "ADMIN_EMAIL": "root@phusion.nl", "SECRET_KEY": "12345" }</span>.
2481
- </p>
2482
- </dd>
2483
- <dt class="hdlist1">
2484
- <span class="monospaced">nginx_config_template</span>
2485
- </dt>
2486
- <dd>
2487
- <p>
2488
- Equivalent to the <span class="monospaced">--nginx-config-template</span> command line option.
2489
- </p>
2490
- </dd>
2491
- </dl></div>
2492
- <div class="paragraph"><p>Here is an example configuration file:</p></div>
2493
- <div class="listingblock">
2494
- <div class="content">
2495
- <!-- Generator: GNU source-highlight 2.11.1
2496
- by Lorenzo Bettini
2497
- http://www.lorenzobettini.it
2498
- http://www.gnu.org/software/src-highlite -->
2499
- <pre><tt><span style="color: #FF0000">{</span>
2500
- <span style="color: #FF0000">"port"</span><span style="color: #990000">:</span> <span style="color: #993399">8000</span><span style="color: #990000">,</span>
2501
- <span style="color: #FF0000">"environment"</span><span style="color: #990000">:</span> <span style="color: #FF0000">"production"</span><span style="color: #990000">,</span>
2502
- <span style="color: #FF0000">"ssl"</span><span style="color: #990000">:</span> <span style="font-weight: bold"><span style="color: #0000FF">true</span></span><span style="color: #990000">,</span>
2503
- <span style="color: #FF0000">"ssl_certificate"</span><span style="color: #990000">:</span> <span style="color: #FF0000">"/path-to-cert.crt"</span><span style="color: #990000">,</span>
2504
- <span style="color: #FF0000">"ssl_certificate_key"</span><span style="color: #990000">:</span> <span style="color: #FF0000">"/path-to-cert.key"</span>
2505
- <span style="color: #FF0000">}</span></tt></pre>
2506
- </div>
2507
- </div>
1308
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/config/standalone/reference/">the new configuration reference</a> or <a href="https://www.phusionpassenger.com/library/config/standalone/intro.html">the new configuration introduction document</a>.</p></div>
2508
1309
  </div>
2509
1310
  <div class="sect2">
2510
1311
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="advanced_configuration"></span><h3 data-comment-topic="advanced-configuration-e3v4pk" data-anchor="advanced_configuration">4.3. Advanced configuration</h3>
2511
- <div class="paragraph"><p><strong>Introduced in version 4.0.39.</strong></p></div>
2512
- <div class="paragraph"><p>Phusion Passenger Standalone is built on the same technology that powers <a href="Users%20guide%20Nginx.html">Phusion Passenger for Nginx</a>, so any configuration option supported by Phusion Passenger for Nginx can be applied to Standalone as well. You can do this by editing the Standalone configuration template directly.</p></div>
2513
- <div class="paragraph"><p>First, create a copy of the default Phusion Passenger Nginx configuration template file:</p></div>
2514
- <div class="listingblock">
2515
- <div class="content monospaced">
2516
- <pre>cp $(passenger-config about resourcesdir)/templates/standalone/config.erb nginx.conf.erb</pre>
2517
- </div>
2518
- </div>
2519
- <div class="paragraph"><p>Then open <span class="monospaced">nginx.conf.erb</span> and modify it as you see fit. The file is a normal Nginx configuration file, in the ERB template format.</p></div>
2520
- <div class="paragraph"><p>Every time you start Standalone, you must pass the <span class="monospaced">--nginx-config-template</span> parameter, which tells Standalone to use your specific Nginx configuration template file. For example:</p></div>
2521
- <div class="listingblock">
2522
- <div class="content">
2523
- <!-- Generator: GNU source-highlight 2.11.1
2524
- by Lorenzo Bettini
2525
- http://www.lorenzobettini.it
2526
- http://www.gnu.org/software/src-highlite -->
2527
- <pre><tt>passenger start --nginx-config-template nginx<span style="color: #990000">.</span>conf<span style="color: #990000">.</span>erb</tt></pre>
2528
- </div>
2529
- </div>
2530
- <div class="paragraph"><p>Alternatively, if you don’t want to pass this parameter every time, you can also set the <span class="monospaced">nginx_config_template</span> option in <a href="#config_file">Passengerfile.json</a>.</p></div>
2531
- <div class="admonitionblock">
2532
- <table><tr>
2533
- <td class="icon">
2534
- <img src="./images/icons/note.png" alt="Note">
2535
- </td>
2536
- <td class="content">The original configuration template file may change from time to time, e.g. because new features are introduced into Phusion Passenger. If your configuration template file does not contain the required changes, then these new features may not work properly. In the worst case, Standalone might even malfunction. Therefore, every time you upgrade Phusion Passenger, you should check whether the original configuration template file has changed, and merge back any changes into your own file.</td>
2537
- </tr></table>
2538
- </div>
1312
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/config/standalone/intro.html#nginx-configuration-template">https://www.phusionpassenger.com/library/config/standalone/intro.html#nginx-configuration-template</a></p></div>
2539
1313
  </div>
2540
1314
  </div>
2541
1315
  </div>
2542
1316
  <div class="sect1">
2543
1317
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_using_passenger_standalone_in_production"></span><h2 data-comment-topic="using-passenger-standalone-in-production-1i7yjcz" data-anchor="_using_passenger_standalone_in_production">5. Using Passenger Standalone in production</h2>
2544
1318
  <div class="sectionbody">
1319
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/deploy/standalone/">https://www.phusionpassenger.com/library/deploy/standalone/</a></p></div>
2545
1320
  <div class="sect2">
2546
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="starting_at_system_boot"></span><h3 data-comment-topic="starting-passenger-standalone-at-system-boot-jpem2b" data-anchor="starting_at_system_boot">5.1. Starting Passenger Standalone at system boot</h3>
2547
- <div class="paragraph"><p>The easiest way to have Passenger Standalone started during system boot is add it to the file <span class="monospaced">/etc/rc.local</span>. This script is called during system boot.</p></div>
2548
- <div class="paragraph"><p>Here’s an example of what you may want to add to <span class="monospaced">/etc/rc.local</span>. If there is an <span class="monospaced">exit</span> command in <span class="monospaced">rc.local</span>, make sure you add these <em>before</em> the <span class="monospaced">exit</span> command.</p></div>
2549
- <div class="listingblock">
2550
- <div class="content">
2551
- <!-- Generator: GNU source-highlight 2.11.1
2552
- by Lorenzo Bettini
2553
- http://www.lorenzobettini.it
2554
- http://www.gnu.org/software/src-highlite -->
2555
- <pre><tt><span style="font-style: italic"><span style="color: #9A1900"># If you installed Phusion Passenger from tarball, add its `bin` directory to PATH.</span></span>
2556
- <span style="font-style: italic"><span style="color: #9A1900">#export PATH=/path-to-passenger/bin:$PATH</span></span>
2557
-
2558
- <span style="font-style: italic"><span style="color: #9A1900"># Change working directory to your webapp.</span></span>
2559
- cd /path-to-your-webapp
2560
-
2561
- <span style="font-style: italic"><span style="color: #9A1900"># Start Passenger Standalone in daemonized mode. Passenger will be started as</span></span>
2562
- <span style="font-style: italic"><span style="color: #9A1900"># root when run from this file, so we also tell it to drop its privileges to a</span></span>
2563
- <span style="font-style: italic"><span style="color: #9A1900"># normal user. Replace 'someusername' with the user you want to run your</span></span>
2564
- <span style="font-style: italic"><span style="color: #9A1900"># application under.</span></span>
2565
- passenger start --daemonize --port <span style="color: #993399">80</span> --user someusername</tt></pre>
2566
- </div>
2567
- </div>
2568
- <div class="paragraph"><p>To stop Passenger Standalone, run:</p></div>
2569
- <div class="listingblock">
2570
- <div class="content">
2571
- <!-- Generator: GNU source-highlight 2.11.1
2572
- by Lorenzo Bettini
2573
- http://www.lorenzobettini.it
2574
- http://www.gnu.org/software/src-highlite -->
2575
- <pre><tt>cd /path-to-your-webapp
2576
-
2577
- <span style="font-style: italic"><span style="color: #9A1900"># If you use RVM, use 'rvmsudo' instead of 'sudo'</span></span>
2578
- sudo passenger stop</tt></pre>
2579
- </div>
2580
- </div>
1321
+ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_starting_passenger_standalone_at_system_boot"></span><h3 data-comment-topic="starting-passenger-standalone-at-system-boot-jpem2b" data-anchor="_starting_passenger_standalone_at_system_boot">5.1. Starting Passenger Standalone at system boot</h3>
1322
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/deploy/standalone/deploy/ruby/#step-4-make-sure-passenger-standalone-starts-on-system-boot">https://www.phusionpassenger.com/library/deploy/standalone/deploy/ruby/#step-4-make-sure-passenger-standalone-starts-on-system-boot</a></p></div>
2581
1323
  </div>
2582
1324
  <div class="sect2">
2583
1325
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="sharing_port"></span><h3 data-comment-topic="sharing-the-same-port-between-multiple-passenger-standalone-instances-3lcmc5" data-anchor="sharing_port">5.2. Sharing the same port between multiple Passenger Standalone instances</h3>
2584
- <div class="paragraph"><p>If you have multiple applications on your server then it is desirable to have all of them listen on the same port (e.g. port 80), with the HTTP request’s host name determining which Passenger Standalone instance should handle the request. There are three ways to achieve this.</p></div>
2585
- <div class="olist arabic"><ol class="arabic">
2586
- <li>
2587
- <p>
2588
- The first way is to use the <a href="#mass_deployment">Mass deployment</a> feature, which allows Passenger Standalone to directly host multiple applications at the same time. Please refer to that section to learn more.
2589
- </p>
2590
- </li>
2591
- <li>
2592
- <p>
2593
- The second way is to run multiple Passenger Standalone instances — one for each application — and to put all of them behind a <strong>reverse proxy</strong> or <strong>load balancer</strong>. The reverse proxy/load balancer can for example be Nginx, Apache or HAProxy. The reverse proxy/load balancer listens on port 80, determines which Passenger Standalone instance should handle the request, and forwards the request to that instance.
2594
- </p>
2595
- </li>
2596
- <li>
2597
- <p>
2598
- The third way is to use <a href="Users%20guide%20Nginx.html">Phusion Passenger for Nginx</a> or <a href="Users%20guide%20Apache.html">Phusion Passenger for Apache</a>. These are two modes of Phusion Passenger that are distinct from the Standalone mode, which this document describes. In the Nginx and Apache modes, Phusion Passenger integrates directly into Nginx and Apache, and makes it very easy to host multiple applications directly on Nginx or Apache.
2599
- </p>
2600
- <div class="paragraph"><p>Compared method 2 — putting Passenger Standalone behind a reverse proxy or load balancer — the Nginx or Apache modes are easier to use and require less configuration. On the other hand, the Nginx modes requires reinstalling or recompiling Nginx, while the Apache mode requires that the Phusion Passenger Apache module is installed.</p></div>
2601
- </li>
2602
- </ol></div>
2603
- <div class="paragraph"><p><strong>The rest of this subsection describes method 2.</strong></p></div>
2604
- <span class="anchor_helper" id="_step_1_starting_all_applications"></span><h4 class="float" data-anchor="_step_1_starting_all_applications">Step 1: starting all applications</h4>
2605
- <div class="paragraph"><p>Putting Passenger Standalone behind a reverse proxy requires three steps. First, you must start all Passenger Standalone instances that you want. Each one must be listening on a different port, because two applications can’t listen on the same port. Suppose that you have two applications, <span class="monospaced">/webapps/foo</span> and <span class="monospaced">/webapps/bar</span>. Here’s how you may start them:</p></div>
2606
- <div class="listingblock">
2607
- <div class="content">
2608
- <!-- Generator: GNU source-highlight 2.11.1
2609
- by Lorenzo Bettini
2610
- http://www.lorenzobettini.it
2611
- http://www.gnu.org/software/src-highlite -->
2612
- <pre><tt><span style="font-style: italic"><span style="color: #9A1900"># Start foo on port 4000</span></span>
2613
- cd /webapps/foo
2614
- passenger start --daemonize --address <span style="color: #993399">127.0</span><span style="color: #990000">.</span><span style="color: #993399">0.1</span> --port <span style="color: #993399">4000</span>
2615
-
2616
- <span style="font-style: italic"><span style="color: #9A1900"># Start bar on port 4010</span></span>
2617
- cd /webapps/bar
2618
- passenger start --daemonize --address <span style="color: #993399">127.0</span><span style="color: #990000">.</span><span style="color: #993399">0.1</span> --port <span style="color: #993399">4010</span></tt></pre>
2619
- </div>
2620
- </div>
2621
- <div class="paragraph"><p>Notice the fact that we pass <span class="monospaced">--address 127.0.0.1</span>, which tells Passenger Standalone to only listen for requests that originate from the local machine. This is because the reverse proxy/load balancer, not Passenger Standalone, is supposed to be responsible for receiving external HTTP requests. The reverse proxy/load balancer will be running on the same machine only, so limiting Passenger Standalone in this manner improves security.</p></div>
2622
- <span class="anchor_helper" id="_step_2_install_and_configure_the_reverse_proxy_load_balancer"></span><h4 class="float" data-anchor="_step_2_install_and_configure_the_reverse_proxy_load_balancer">Step 2: install and configure the reverse proxy/load balancer</h4>
2623
- <div class="paragraph"><p>The next step is to <strong>install a reverse proxy/load balancer</strong>, and to <strong>configure</strong> it to do the following:</p></div>
2624
- <div class="ulist"><ul>
2625
- <li>
2626
- <p>
2627
- To listen on port 80.
2628
- </p>
2629
- </li>
2630
- <li>
2631
- <p>
2632
- To forward requests to either <em>foo</em> or <em>bar</em>, depending on the request’s HTTP host name.
2633
- </p>
2634
- </li>
2635
- </ul></div>
2636
- <div class="paragraph"><p>You can use any reverse proxy/load balancer you want, but we’re going to show an example using <a href="http://www.nginx.org/">Nginx</a> because it’s a pretty popular choice. Install Nginx as follows:</p></div>
2637
- <table class="tableblock frame-all grid-all" style="
2638
- width:100%;
2639
- ">
2640
- <col style="width:50%;">
2641
- <col style="width:50%;">
2642
- <tbody>
2643
- <tr>
2644
- <td class="tableblock halign-left valign-top"><p class="tableblock">Debian, Ubuntu</p></td>
2645
- <td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">sudo apt-get update</span><br>
2646
- <span class="monospaced">sudo apt-get install nginx-extras</span></p></td>
2647
- </tr>
2648
- <tr>
2649
- <td class="tableblock halign-left valign-top"><p class="tableblock">Red Hat, CentOS, ScientificLinux, Amazon Linux</p></td>
2650
- <td class="tableblock halign-left valign-top"><p class="tableblock">Enable <a href="http://fedoraproject.org/wiki/EPEL">EPEL</a>, then run as root:<br>
2651
- <span class="monospaced">yum install nginx</span></p></td>
2652
- </tr>
2653
- <tr>
2654
- <td class="tableblock halign-left valign-top"><p class="tableblock">Mac OS X (Homebrew)</p></td>
2655
- <td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">brew install nginx</span></p></td>
2656
- </tr>
2657
- <tr>
2658
- <td class="tableblock halign-left valign-top"><p class="tableblock">Other operating systems</p></td>
2659
- <td class="tableblock halign-left valign-top"><p class="tableblock">Install Nginx from <a href="http://www.nginx.org/">the Nginx website</a>.</p></td>
2660
- </tr>
2661
- </tbody>
2662
- </table>
2663
- <div class="paragraph"><p>Open the Nginx configuration file:</p></div>
2664
- <table class="tableblock frame-all grid-all" style="
2665
- width:100%;
2666
- ">
2667
- <col style="width:50%;">
2668
- <col style="width:50%;">
2669
- <tbody>
2670
- <tr>
2671
- <td class="tableblock halign-left valign-top"><p class="tableblock">Debian, Ubuntu</p></td>
2672
- <td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">/etc/nginx/nginx.conf</span></p></td>
2673
- </tr>
2674
- <tr>
2675
- <td class="tableblock halign-left valign-top"><p class="tableblock">Red Hat, CentOS, ScientificLinux, Amazon Linux</p></td>
2676
- <td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">/etc/nginx/nginx.conf</span></p></td>
2677
- </tr>
2678
- <tr>
2679
- <td class="tableblock halign-left valign-top"><p class="tableblock">Mac OS X (Homebrew)</p></td>
2680
- <td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">/usr/local/etc/nginx/nginx.conf</span></p></td>
2681
- </tr>
2682
- <tr>
2683
- <td class="tableblock halign-left valign-top"><p class="tableblock">Other operating systems</p></td>
2684
- <td class="tableblock halign-left valign-top"><p class="tableblock">It depends on how you installed Nginx, but it’s usually <span class="monospaced">$PREFIX/conf/nginx.conf</span>, where <span class="monospaced">$PREFIX</span> is the prefix you installed Nginx to.</p></td>
2685
- </tr>
2686
- </tbody>
2687
- </table>
2688
- <div class="paragraph"><p>Add virtual host entries for your applications foo and bar. While making the virtual host entries, you must determine what host names foo and bar should respond to. Let’s say that foo should respond to <em>www.foo.com</em> and bar should respond to <em>www.bar.com</em>. Then the following entries will tell Nginx to listen on port 80, and to handle requests for the domains <em>www.foo.com</em> and <em>www.bar.com</em> differently.</p></div>
2689
- <div class="listingblock">
2690
- <div class="content monospaced">
2691
- <pre>http {
2692
- ...
2693
-
2694
- # These are some "magic" Nginx configuration options that aid in making
2695
- # WebSockets work properly with Passenger Standalone. Please learn more
2696
- # at http://nginx.org/en/docs/http/websocket.html
2697
- map $http_upgrade $connection_upgrade {
2698
- default upgrade;
2699
- '' close;
2700
- }
2701
-
2702
- server {
2703
- listen 80;
2704
- server_name www.foo.com;
2705
-
2706
- # Tells Nginx to serve static assets from this directory.
2707
- root /webapps/foo/public;
2708
-
2709
- location / {
2710
- # Tells Nginx to forward all requests for www.foo.com
2711
- # to the Passenger Standalone instance listening on port 4000.
2712
- proxy_pass http://127.0.0.1:4000;
2713
-
2714
- # These are "magic" Nginx configuration options that
2715
- # should be present in order to make the reverse proxying
2716
- # work properly. Also contains some options that make WebSockets
2717
- # work properly with Passenger Standalone. Please learn more at
2718
- # http://nginx.org/en/docs/http/ngx_http_proxy_module.html
2719
- proxy_http_version 1.1;
2720
- proxy_set_header Host $http_host;
2721
- proxy_set_header Upgrade $http_upgrade;
2722
- proxy_set_header Connection $connection_upgrade;
2723
- proxy_buffering off;
2724
- }
2725
- }
2726
-
2727
- # We handle bar in a similar manner.
2728
- server {
2729
- listen 80;
2730
- server_name www.bar.com;
2731
-
2732
- root /webapps/bar/public;
2733
-
2734
- location / {
2735
- # bar is listening on port 4010 instead of 4000, we
2736
- # change the URL here.
2737
- proxy_pass http://127.0.0.1:4010;
2738
-
2739
- proxy_http_version 1.1;
2740
- proxy_set_header Host $http_host;
2741
- proxy_set_header Upgrade $http_upgrade;
2742
- proxy_set_header Connection $connection_upgrade;
2743
- proxy_buffering off;
2744
- }
2745
- }
2746
- }</pre>
2747
- </div>
2748
- </div>
2749
- <div class="paragraph"><p>Once you’re done editing the Nginx configuration file, restart Nginx:</p></div>
2750
- <table class="tableblock frame-all grid-all" style="
2751
- width:100%;
2752
- ">
2753
- <col style="width:50%;">
2754
- <col style="width:50%;">
2755
- <tbody>
2756
- <tr>
2757
- <td class="tableblock halign-left valign-top"><p class="tableblock">Debian, Ubuntu</p></td>
2758
- <td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">sudo /etc/init.d/nginx restart</span></p></td>
2759
- </tr>
2760
- <tr>
2761
- <td class="tableblock halign-left valign-top"><p class="tableblock">Red Hat, CentOS, ScientificLinux, Amazon Linux</p></td>
2762
- <td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">sudo service nginx restart</span></p></td>
2763
- </tr>
2764
- <tr>
2765
- <td class="tableblock halign-left valign-top"><p class="tableblock">Mac OS X (Homebrew)</p></td>
2766
- <td class="tableblock halign-left valign-top"><p class="tableblock">1. Run <span class="monospaced">sudo kill $(cat /usr/local/var/run/nginx.pid)</span><br>
2767
- 2. You you installed the Nginx launchd plist that Homebrew provides (see <span class="monospaced">brew info nginx</span> to learn more), then you don’t have to do anything, and launchd will automatically restart Nginx. Otherwise, you have to manually start Nginx again: <span class="monospaced">sudo /usr/local/bin/nginx</span>.</p></td>
2768
- </tr>
2769
- <tr>
2770
- <td class="tableblock halign-left valign-top"><p class="tableblock">Other operating systems</p></td>
2771
- <td class="tableblock halign-left valign-top">
2772
- <p class="tableblock">It depends on how you installed Nginx, but it’s usually as follows:</p>
2773
- <p class="tableblock"> 1. Lookup the PID of the Nginx master process using <span class="monospaced">ps aux</span>.<br>
2774
- 2. Run <span class="monospaced">sudo kill &lt;PID&gt;</span><br>
2775
- 3. Start Nginx again: <span class="monospaced">sudo $PREFIX/sbin/nginx</span>, where <span class="monospaced">$PREFIX</span> is the prefix you installed Nginx to.</p>
2776
- </td>
2777
- </tr>
2778
- </tbody>
2779
- </table>
2780
- <span class="anchor_helper" id="_step_3_testing"></span><h4 class="float" data-anchor="_step_3_testing">Step 3: testing</h4>
2781
- <div class="paragraph"><p>Nginx should now be listening on port 80, and should forward requests to foo and bar respectively. Let’s test it out by accessing <a href="http://www.foo.com">http://www.foo.com</a> and <a href="http://www.bar.com">http://www.bar.com</a>. But first, we need to ensure that any requests to <em>www.foo.com</em> and <em>www.bar.com</em>, that originate from the local machine, actually end up at the local host, and not at the IP address specified in the DNS records. To do this, edit <span class="monospaced">/etc/hosts</span> and add:</p></div>
2782
- <div class="listingblock">
2783
- <div class="content monospaced">
2784
- <pre>127.0.0.1 www.foo.com www.bar.com</pre>
2785
- </div>
2786
- </div>
2787
- <div class="paragraph"><p>Now visit <a href="http://www.foo.com">http://www.foo.com</a> and <a href="http://www.bar.com">http://www.bar.com</a>, and verify that it works.</p></div>
2788
- <span class="anchor_helper" id="_step_4_making_all_apps_start_at_system_boot"></span><h4 class="float" data-anchor="_step_4_making_all_apps_start_at_system_boot">Step 4: making all apps start at system boot</h4>
2789
- <div class="paragraph"><p>Once you restart the server, the reverse proxy/load balancer will no longer be able to serve <em>www.foo.com</em> or <em>www.bar.com</em> because the Passenger Standalone instances that host them are no longer running. You must therefore configure the system to start Passenger Standalone at system boot. Please refer to <a href="#starting_at_system_boot">Starting Passenger Standalone at system boot</a> for more information.</p></div>
2790
- <div class="paragraph"><p>For example, you can put this in <span class="monospaced">/etc/rc.local</span> to make the system start foo and bar at system boot:</p></div>
2791
- <div class="listingblock">
2792
- <div class="content">
2793
- <!-- Generator: GNU source-highlight 2.11.1
2794
- by Lorenzo Bettini
2795
- http://www.lorenzobettini.it
2796
- http://www.gnu.org/software/src-highlite -->
2797
- <pre><tt><span style="font-style: italic"><span style="color: #9A1900"># If you installed Phusion Passenger from tarball, add its `bin` directory to PATH.</span></span>
2798
- <span style="font-style: italic"><span style="color: #9A1900">#export PATH=/path-to-passenger/bin:$PATH</span></span>
2799
-
2800
- cd /webapps/foo
2801
- passenger start --daemonize --port <span style="color: #993399">4000</span> --user someusername1
2802
-
2803
- cd /webapps/bar
2804
- passenger start --daemonize --port <span style="color: #993399">4010</span> --user someusername2</tt></pre>
2805
- </div>
2806
- </div>
2807
- <span class="anchor_helper" id="_step_5_wrapping_up"></span><h4 class="float" data-anchor="_step_5_wrapping_up">Step 5: wrapping up</h4>
2808
- <div class="paragraph"><p>Edit <span class="monospaced">/etc/hosts</span> and remove the entry that you added in step 3.</p></div>
1326
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/deploy/standalone/reverse_proxy.html">https://www.phusionpassenger.com/library/deploy/standalone/reverse_proxy.html</a></p></div>
2809
1327
  </div>
2810
1328
  <div class="sect2">
2811
1329
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_installing_passenger_standalone_behind_nginx"></span><h3 data-comment-topic="installing-passenger-standalone-behind-nginx-1xylsfk" data-anchor="_installing_passenger_standalone_behind_nginx">5.3. Installing Passenger Standalone behind Nginx</h3>
2812
- <div class="paragraph"><p>This is described in <a href="#sharing_port">Sharing the same port between multiple Passenger Standalone instances</a>.</p></div>
1330
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/deploy/standalone/reverse_proxy.html">https://www.phusionpassenger.com/library/deploy/standalone/reverse_proxy.html</a></p></div>
2813
1331
  </div>
2814
1332
  </div>
2815
1333
  </div>
2816
1334
  <div class="sect1">
2817
1335
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="mass_deployment"></span><h2 data-comment-topic="mass-deployment-1xqriy4" data-anchor="mass_deployment">6. Mass deployment</h2>
2818
1336
  <div class="sectionbody">
2819
- <div class="paragraph"><p><strong>This feature is only available in <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a>. It was introduced in version 3.0.0. <a href="https://www.phusionpassenger.com/download">Buy Phusion Passenger Enterprise here.</a></strong></p></div>
2820
- <div class="paragraph"><p>Mass deployment is a special mode in Phusion Passenger Standalone that allows you to deploy multiple web applications without having to create configuration entries for each one of them. Given a directory with multiple web applications, Passenger Standalone will automatically give each web application its own virtual host entry, and serve all of them from a single server. The virtual host’s server name is equal to the web application’s directory name. Whenever a new web application is added or removed, Passenger Standalone automatically reconfigures itself without administrator intervention. This makes the mass deployment mode especially useful when there are a large number of web applications.</p></div>
2821
- <div class="paragraph"><p>For example, suppose we have a directory <span class="monospaced">/webapps</span> with three web applications: Ruby app, a Python app and a Node.js app.</p></div>
2822
- <div class="listingblock">
2823
- <div class="content monospaced">
2824
- <pre>/webapps
2825
- |
2826
- +-- rubyapp.com
2827
- | |
2828
- | +-- config.ru
2829
- |
2830
- +-- pythonapp.com
2831
- | |
2832
- | +-- passenger_wsgi.py
2833
- |
2834
- +-- nodeapp.com
2835
- |
2836
- +-- app.js</pre>
2837
- </div>
2838
- </div>
2839
- <div class="paragraph"><p>You can activate Passenger Standalone in mass deployment mode by changing the working directory to <span class="monospaced">/webapps</span> and running <span class="monospaced">passenger start</span>:</p></div>
2840
- <div class="listingblock">
2841
- <div class="content monospaced">
2842
- <pre>$ cd /webapps
2843
- $ passenger start
2844
- =============== Phusion Passenger Standalone web server started ===============
2845
- PID file: /webapps/passenger.3000.pid
2846
- Log file: /webapps/passenger.3000.log
2847
- Environment: development
2848
-
2849
- Serving these applications on 0.0.0.0 port 3000:
2850
- Host name Directory
2851
- .-----------------------------------------------------------
2852
- rubyapp.com /webapps/rubyapp.com
2853
- pythonapp.com /webapps/pythonapp.com
2854
- nodeapp.com /webapps/nodeapp.com
2855
- .-----------------------------------------------------------</pre>
2856
- </div>
2857
- </div>
2858
- <div class="paragraph"><p>If you for example remove <span class="monospaced">/webapps/rubyapp.com</span>, Passenger Standalone will reconfigure itself without that web application. Or if you add a new web applications <span class="monospaced">/webapps/newapp.org</span>, Passenger Standalone will reconfigure itself with that web application.</p></div>
2859
- <div class="paragraph"><p>Any options that you pass to the <span class="monospaced">passenger</span> command will affect all deployed web applications. It is also possible to change options on a per-application basis through the use of <a href="#config_file">a <span class="monospaced">Passengerfile.json</span> file inside each application’s directory</a>.</p></div>
1337
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/deploy/standalone/mass_deployment.html">https://www.phusionpassenger.com/library/deploy/standalone/mass_deployment.html</a></p></div>
2860
1338
  </div>
2861
1339
  </div>
2862
1340
  <div class="sect1">
2863
1341
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="troubleshooting"></span><h2 data-comment-topic="troubleshooting-o7g75o" data-anchor="troubleshooting">7. Troubleshooting</h2>
2864
1342
  <div class="sectionbody">
2865
- <div class="sect2">
2866
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_generic_troubleshooting_tips"></span><h3 data-comment-topic="generic-troubleshooting-tips-2vokcr" data-anchor="_generic_troubleshooting_tips">7.1. Generic troubleshooting tips</h3>
2867
- <div class="paragraph"><p>One of the first things you should do upon encountering a problem, is to check
2868
- Phusion Passenger Standalone log file. This is typically located in <span class="monospaced">log/passenger.[PORT NUMBER].log</span>. Most problems are logged to this log file.</p></div>
2869
- <div class="paragraph"><p>If neither the logs nor this troubleshooting guide can help you, then please check out our <a href="#where_to_get_support">support resources</a>.</p></div>
2870
- </div>
2871
- <div class="sect2">
2872
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_upon_uploading_a_file_phusion_passenger_reports_client_body_temp_00000000xx_failed_2_no_such_file_or_directory"></span><h3 data-comment-topic="upon-uploading-a-file-phusion-passenger-reports-client-body-temp-00000000xx-failed-2-no-such-file-or-directory--d01goe" data-anchor="_upon_uploading_a_file_phusion_passenger_reports_client_body_temp_00000000xx_failed_2_no_such_file_or_directory">7.2. Upon uploading a file, Phusion Passenger reports "client_body_temp/00000000xx failed (2: No such file or directory)"</h3>
2873
- <div class="dlist"><dl>
2874
- <dt class="hdlist1">
2875
- <strong>Symptoms</strong>
2876
- </dt>
2877
- <dd>
2878
- <p>
2879
- When performing an HTTP POST call, the request sometimes fails, with Phusion Passenger reporting an error along the lines of:
2880
- </p>
2881
- <div class="listingblock">
2882
- <div class="content monospaced">
2883
- <pre>/tmp/passenger-standalone.8583/client_body_temp/0000000022" failed (2: No such
2884
- file or directory), client: 127.0.0.1, server: www.foo.com</pre>
2885
- </div>
2886
- </div>
2887
- </dd>
2888
- <dt class="hdlist1">
2889
- <strong>Cause</strong>
2890
- </dt>
2891
- <dd>
2892
- <p>
2893
- Phusion Passenger buffers HTTP POST bodies (file uploads) to a temporary directory, by default <span class="monospaced">/tmp/passenger-standalone.xxx</span>. This error means that Phusion Passenger that that directory has been removed, probably by some other program.
2894
- </p>
2895
- </dd>
2896
- <dt class="hdlist1">
2897
- <strong>Solution</strong>
2898
- </dt>
2899
- <dd>
2900
- <p>
2901
- Tell Phusion Passenger to use a different directory to store its temporary files passing the <span class="monospaced">--temp-dir</span> command line option. For example:
2902
- </p>
2903
- <div class="listingblock">
2904
- <div class="content monospaced">
2905
- <pre>mkdir $HOME/tmp
2906
- cd /path-to-your-app
2907
- passenger start --temp-dir=$HOME/tmp</pre>
2908
- </div>
2909
- </div>
2910
- </dd>
2911
- </dl></div>
2912
- </div>
2913
- <div class="sect2">
2914
- <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_i_get_command_not_found_when_running_a_phusion_passenger_command_through_sudo"></span><h3 data-comment-topic="i-get-command-not-found-when-running-a-phusion-passenger-command-through-sudo-14k8kde" data-anchor="_i_get_command_not_found_when_running_a_phusion_passenger_command_through_sudo">7.3. I get "command not found" when running a Phusion Passenger command through sudo</h3>
2915
- <div class="dlist"><dl>
2916
- <dt class="hdlist1">
2917
- <strong>Symptoms</strong>
2918
- </dt>
2919
- <dd>
2920
- <p>
2921
- Phusion Passenger commands can be found as a normal user, but not when run through sudo:
2922
- </p>
2923
- <div class="listingblock">
2924
- <div class="content monospaced">
2925
- <pre>$ passenger-status
2926
- ...some output, but no "command not found" error...
2927
- $ passenger-install-apache2-module
2928
- ...some output, but no "command not found" error...
2929
- $ sudo passenger-status
2930
- sudo: passenger-status: command not found
2931
- $ sudo passenger-install-apache2-module
2932
- sudo: passenger-install-apache2-module: command not found</pre>
2933
- </div>
2934
- </div>
2935
- </dd>
2936
- <dt class="hdlist1">
2937
- <strong>Cause</strong>
2938
- </dt>
2939
- <dd>
2940
- <p>
2941
- The operating system looks up commands using <a href="#the_path_env_var">the PATH environment variable</a>. However, sudo resets all environment variables to a default value, dictated by sudo. If Phusion Passenger was installed to a location that is not in the default sudo PATH value, then sudo will not be able to find the Phusion Passenger commands.
2942
- </p>
2943
- <div class="paragraph"><p>In addition, if you installed Phusion Passenger using a Ruby interpreter that was installed through RVM, then you <strong>must</strong> use rvmsudo instead of sudo. As a rule, when you’re an RVM user, always use rvmsudo instead of sudo.</p></div>
2944
- </dd>
2945
- <dt class="hdlist1">
2946
- <strong>Solution</strong>
2947
- </dt>
2948
- <dd>
2949
- <p>
2950
- Execute the command using its full path. You can use <span class="monospaced">which</span> as a normal user to lookup the full path:
2951
- </p>
2952
- <div class="listingblock">
2953
- <div class="content monospaced">
2954
- <pre>$ which passenger-status
2955
- /somewhere/bin/passenger-status</pre>
2956
- </div>
2957
- </div>
2958
- <div class="paragraph"><p>Next, run full path of the command using either sudo or rvmsudo:</p></div>
2959
- <div class="listingblock">
2960
- <div class="content monospaced">
2961
- <pre>$ sudo /somewhere/bin/passenger-status
2962
-
2963
- # -OR, if you're using RVM:-
2964
-
2965
- $ rvmsudo /somewhere/bin/passenger-status</pre>
2966
- </div>
2967
- </div>
2968
- </dd>
2969
- <dt class="hdlist1">
2970
- <strong>Recommended reading</strong>
2971
- </dt>
2972
- <dd>
2973
- <p>
2974
- When using sudo, you will probably run into similar "command not found" issues in the future, with components other than Phusion Passenger. We <strong>strongly recommend</strong> you to <a href="#about_environment_variables">learn about environment variables</a> so that you know what to do in the future.
2975
- </p>
2976
- </dd>
2977
- </dl></div>
2978
- </div>
1343
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/admin/standalone/">https://www.phusionpassenger.com/library/admin/standalone/</a></p></div>
2979
1344
  </div>
2980
1345
  </div>
2981
1346
  <div class="sect1">
@@ -2985,141 +1350,11 @@ $ rvmsudo /somewhere/bin/passenger-status</pre>
2985
1350
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="relationship_with_ruby"></span><h3 data-comment-topic="phusion-passenger-and-its-relationship-with-ruby-1usvd0o" data-anchor="relationship_with_ruby">8.1. Phusion Passenger and its relationship with Ruby</h3>
2986
1351
  <div class="sect3">
2987
1352
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_how_ruby_is_used"></span><h4 data-comment-topic="how-ruby-is-used-1saha86" data-anchor="_how_ruby_is_used">8.1.1. How Ruby is used</h4>
2988
- <div class="paragraph"><p>Phusion Passenger’s core is written in C++ for performance and memory efficiency. It supports web applications written in any language. Phusion Passenger requires Ruby, its usage of Ruby is minimal in order to maximize performance and to minimize memory usage.</p></div>
2989
- <div class="ulist"><ul>
2990
- <li>
2991
- <p>
2992
- Phusion Passenger’s installer, build system and administration tools are written in Ruby.
2993
- </p>
2994
- </li>
2995
- <li>
2996
- <p>
2997
- Certain internally used tools, such as the crash handler (which generates a backtrace in case Phusion Passenger crash) and the prespawn script (used to implement
2998
- <a href="#PassengerPreStart">passenger_pre_start</a>)
2999
- are written in Ruby as well.
3000
- </p>
3001
- </li>
3002
- <li>
3003
- <p>
3004
- Ruby web application support is implemented in Ruby.
3005
- </p>
3006
- </li>
3007
- <li>
3008
- <p>
3009
- If you use <a href="#flying_passenger">Flying Passenger</a>, then the Flying Passenger daemon is written in Ruby. The daemon is a small (less than 500 lines of code) and offloads most tasks to the C++ core.
3010
- </p>
3011
- </li>
3012
- <li>
3013
- <p>
3014
- If you use <a href="Users%20guide%20Standalone.html">Phusion Passenger Standalone</a>, then the frontend (the <span class="monospaced">passenger</span> command) is written in Ruby. The frontend is small (less than 1500 lines of code) and offloads most tasks to the C++ core.
3015
- </p>
3016
- </li>
3017
- </ul></div>
3018
- <div class="paragraph"><p>Other than the aforementioned aspects, Phusion Passenger does not use Ruby during normal operation. For example, if you run Python WSGI web applications on Phusion Passenger, then there will be (almost) no Ruby code running on the system.</p></div>
1353
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/indepth/lightweight_ruby_dependency.html">https://www.phusionpassenger.com/library/indepth/lightweight_ruby_dependency.html</a></p></div>
3019
1354
  </div>
3020
1355
  <div class="sect3">
3021
1356
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_when_the_system_has_multiple_ruby_interpreters"></span><h4 data-comment-topic="when-the-system-has-multiple-ruby-interpreters-acf6d" data-anchor="_when_the_system_has_multiple_ruby_interpreters">8.1.2. When the system has multiple Ruby interpreters</h4>
3022
- <div class="paragraph"><p>Phusion Passenger may be installed with any Ruby interpreter. Once installed, you can run Phusion Passenger’s Ruby parts under any Ruby interpreter you want, even if that Ruby interpreter was not the one you originally installed Phusion Passenger with.</p></div>
3023
- <div class="paragraph"><p>The reason for this is that Phusion Passenger does not dynamically link to Ruby: Phusion Passenger uses Ruby entirely out-of-process. Thus you can switch to any Ruby interpreter you want during runtime, without recompiling Phusion Passenger, and without worrying about what Ruby you used to install Phusion Passenger.</p></div>
3024
- <div class="paragraph"><p>Phusion Passenger is also capable of running Ruby web applications under any Ruby interpreter you want. So it is not important which Ruby you use to install Phusion Passenger: it will work regardless. Please refer to the documentation for the
3025
- <a href="#PassengerRuby">passenger_ruby</a>
3026
- directive to learn how run different web applications under different Ruby interpreters.</p></div>
3027
- <div class="paragraph">
3028
- <div class="title">Caveat: RVM and RVM gemsets</div>
3029
- <p>There is however one caveat if you happen to be using RVM or RVM gemsets. When you <span class="monospaced">gem install</span> Phusion Passenger using RVM, then RVM will install Phusion Passenger into the <strong>currently active RVM Ruby and gemset</strong>. This means that Phusion Passenger commands - such as <span class="monospaced">passenger</span>, <span class="monospaced">passenger-install-xxx-module</span> and <span class="monospaced">passenger-status</span> - are available in that same RVM Ruby and gemset only. When you switch Ruby interpreter, or when you switch gemset, the Phusion Passenger commands will no longer be available, and you will get a <span class="monospaced">command not found</span> error. Here’s an example which demonstrates the problem.</p>
3030
- </div>
3031
- <div class="listingblock">
3032
- <div class="title">"Command not found" problem demonstration</div>
3033
- <div class="content">
3034
- <!-- Generator: GNU source-highlight 2.11.1
3035
- by Lorenzo Bettini
3036
- http://www.lorenzobettini.it
3037
- http://www.gnu.org/software/src-highlite -->
3038
- <pre><tt><span style="font-style: italic"><span style="color: #9A1900">## Install Phusion Passenger (open source edition) using Ruby 1.9.3</span></span>
3039
- <span style="font-style: italic"><span style="color: #9A1900">## and the 'business' gemset</span></span>
3040
- $ rvm use <span style="color: #993399">1.9</span><span style="color: #990000">.</span><span style="color: #993399">3</span>
3041
- Using /home/phusion<span style="color: #990000">/.</span>rvm/gems/ruby-<span style="color: #993399">1.9</span><span style="color: #990000">.</span><span style="color: #993399">3</span>-p<span style="color: #993399">429</span>
3042
- $ rvm gemset create business
3043
- $ rvm gemset use business
3044
- Using ruby-<span style="color: #993399">1.9</span><span style="color: #990000">.</span><span style="color: #993399">3</span>-p<span style="color: #993399">429</span> with gemset business
3045
- $ curl -O https<span style="color: #990000">:</span>//s<span style="color: #993399">3</span><span style="color: #990000">.</span>amazonaws<span style="color: #990000">.</span>com/phusion-passenger/releases/gem_bootstrap<span style="color: #990000">.</span>sh
3046
- $ <span style="font-weight: bold"><span style="color: #0000FF">eval</span></span> <span style="color: #FF0000">"`sh gem_bootstrap.sh`"</span>
3047
- $ gem install passenger
3048
-
3049
- <span style="font-style: italic"><span style="color: #9A1900">## Verify that passenger works</span></span>
3050
- $ passenger --version
3051
- Phusion Passenger version <span style="color: #993399">4.0</span><span style="color: #990000">.</span><span style="color: #993399">14</span>
3052
-
3053
- <span style="font-style: italic"><span style="color: #9A1900">## Switch to a different RVM gemset. You will get a `command not found`</span></span>
3054
- $ rvm gemset use default
3055
- Using ruby-<span style="color: #993399">1.9</span><span style="color: #990000">.</span><span style="color: #993399">3</span>-p<span style="color: #993399">429</span> with gemset default
3056
- $ passenger --version
3057
- bash<span style="color: #990000">:</span> passenger<span style="color: #990000">:</span> <span style="font-weight: bold"><span style="color: #0000FF">command</span></span> not found
3058
-
3059
- <span style="font-style: italic"><span style="color: #9A1900">## Switch to a different Ruby interpreter. You will also get</span></span>
3060
- <span style="font-style: italic"><span style="color: #9A1900">## a `command not found`</span></span>
3061
- $ rvm use <span style="color: #993399">2.0</span><span style="color: #990000">.</span><span style="color: #993399">0</span>
3062
- Using /home/phusion<span style="color: #990000">/.</span>rvm/gems/ruby-<span style="color: #993399">2.0</span><span style="color: #990000">.</span><span style="color: #993399">0</span>-p<span style="color: #993399">195</span>
3063
- $ passenger --version
3064
- bash<span style="color: #990000">:</span> passenger<span style="color: #990000">:</span> <span style="font-weight: bold"><span style="color: #0000FF">command</span></span> not found
3065
-
3066
- <span style="font-style: italic"><span style="color: #9A1900">## Switch back to the Ruby and gemset that you installed Phusion</span></span>
3067
- <span style="font-style: italic"><span style="color: #9A1900">## Passenger with, and verify that it works again</span></span>
3068
- $ rvm use <span style="color: #993399">1.9</span><span style="color: #990000">.</span><span style="color: #993399">3</span>
3069
- Using /home/phusion<span style="color: #990000">/.</span>rvm/gems/ruby-<span style="color: #993399">2.0</span><span style="color: #990000">.</span><span style="color: #993399">0</span>-p<span style="color: #993399">195</span>
3070
- $ rvm gemset use business
3071
- Using ruby-<span style="color: #993399">1.9</span><span style="color: #990000">.</span><span style="color: #993399">3</span>-p<span style="color: #993399">429</span> with gemset business
3072
- $ passenger --version
3073
- Phusion Passenger version <span style="color: #993399">4.0</span><span style="color: #990000">.</span><span style="color: #993399">14</span></tt></pre>
3074
- </div>
3075
- </div>
3076
- <div class="paragraph">
3077
- <div class="title">Solutions</div>
3078
- <p>There are several ways to solve this problem:</p>
3079
- </div>
3080
- <div class="olist arabic"><ol class="arabic">
3081
- <li>
3082
- <p>
3083
- Permanently add Phusion Passenger’s command directory to your PATH, so that your shell can always find them even when you switch RVM Ruby or gemset. If you don’t know what PATH means, please read <a href="#about_environment_variable">About environment variables</a> first.
3084
- </p>
3085
- <div class="paragraph"><p>The drawback is that you have to redo this every time you upgrade Phusion Passenger, because the Phusion Passenger directory filename is dependent on the version number.</p></div>
3086
- <div class="paragraph"><p>First, identify the location of the Phusion Passenger command directory, like this:</p></div>
3087
- <div class="listingblock">
3088
- <div class="content monospaced">
3089
- <pre>$ echo `passenger-config --root`/bin
3090
- /home/phusion/.rvm/gems/ruby-1.9.3-p429/gems/passenger-4.0.15/bin</pre>
3091
- </div>
3092
- </div>
3093
- <div class="paragraph"><p>Next, add the directory that you’ve found to your current shell’s PATH:</p></div>
3094
- <div class="listingblock">
3095
- <div class="content monospaced">
3096
- <pre>$ export PATH=/home/phusion/.rvm/gems/ruby-1.9.3-p429/gems/passenger-4.0.15/bin:$PATH</pre>
3097
- </div>
3098
- </div>
3099
- <div class="paragraph"><p>Finally, make the change permanent by appending the above command to your bash startup file:</p></div>
3100
- <div class="listingblock">
3101
- <div class="content monospaced">
3102
- <pre>$ echo 'export PATH=/home/phusion/.rvm/gems/ruby-1.9.3-p429/gems/passenger-4.0.15/bin:$PATH' &gt;&gt; ~/.bashrc</pre>
3103
- </div>
3104
- </div>
3105
- </li>
3106
- <li>
3107
- <p>
3108
- Switch back to the RVM Ruby and gemset that you installed Phusion Passenger with, before running any Phusion Passenger command.
3109
- </p>
3110
- </li>
3111
- <li>
3112
- <p>
3113
- Prepend any Phusion Passenger command with <span class="monospaced">rvm-exec RUBY_NAME@GEMSET_NAME ruby -S</span>. If the relevant Phusion Passenger command also needs root privileges, then prepend <span class="monospaced">rvmsudo</span> before that. For example:
3114
- </p>
3115
- <div class="listingblock">
3116
- <div class="content monospaced">
3117
- <pre>rvm-exec 1.9.3@business ruby -S passenger --version
3118
- rvmsudo rvm-exec 1.9.3@business ruby -S passenger-install-apache2-module</pre>
3119
- </div>
3120
- </div>
3121
- </li>
3122
- </ol></div>
1357
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/indepth/ruby/multiple_rubies.html">https://www.phusionpassenger.com/library/indepth/ruby/multiple_rubies.html</a></p></div>
3123
1358
  </div>
3124
1359
  </div>
3125
1360
  </div>
@@ -3127,411 +1362,46 @@ rvmsudo rvm-exec 1.9.3@business ruby -S passenger-install-apache2-module</pre>
3127
1362
  <div class="sect1">
3128
1363
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="about_environment_variables"></span><h2 data-comment-topic="appendix-about-environment-variables-1ct91x3" data-anchor="about_environment_variables">9. Appendix: About environment variables</h2>
3129
1364
  <div class="sectionbody">
3130
- <div class="paragraph"><p>Environment variables are named values that affect how the system works. For example they tell the system where to look for commands (the <span class="monospaced">PATH</span> variable) or where to look for libraries (<span class="monospaced">LD_LIBRARY_PATH</span>). Their names are often in all-uppercase. Sometimes people refer to an environment variable with a dollar sign <span class="monospaced">$</span> in front, but that’s the same thing: when people say "the $PATH environment variable" they mean "the PATH environment variable". This is because the dollar sign <span class="monospaced">$</span> is a shell syntax for refering to an environment variable, as you will learn later.</p></div>
3131
- <div class="paragraph"><p>Environment variables are set on a <strong>per-process</strong> basis, but they are <strong>inherited</strong> by child processes. This means that if you set environment variables in process A, another already running process B will not see these new environment variables. But if A spawns a child process C, then C will have all environment variables that A had. If you once again change the environment variables in A, then C will not see the changes.</p></div>
3132
- <div class="paragraph"><p>The per-process nature of environment variables some implications. When you set environment variables in your <span class="monospaced">bashrc</span> or other bash startup files…</p></div>
3133
- <div class="ulist"><ul>
3134
- <li>
3135
- <p>
3136
- …only newly spawned bash shells see them.
3137
- </p>
3138
- </li>
3139
- <li>
3140
- <p>
3141
- …the web server usually does not see them, because the web server tends to be started from init scripts, not from bash.
3142
- </p>
3143
- </li>
3144
- <li>
3145
- <p>
3146
- …cron jobs do not see them, because cron jobs' environment variables are entirely dictated by their crontabs.
3147
- </p>
3148
- </li>
3149
- </ul></div>
3150
- <div class="admonitionblock">
3151
- <table><tr>
3152
- <td class="icon">
3153
- <img src="./images/icons/note.png" alt="Note">
3154
- </td>
3155
- <td class="content">Because this chapter is meant for beginners, it assumes that the reader uses the bash shell. This chapter does not describe instructions for zsh, csh or other shells. We assume that users of other shells are familiar with the Bourne shell syntax, and know how to apply the instructions in this chapter in their shells' native syntaxes.</td>
3156
- </tr></table>
3157
- </div>
1365
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/indepth/environment_variables.html">https://www.phusionpassenger.com/library/indepth/environment_variables.html</a></p></div>
3158
1366
  <div class="sect2">
3159
1367
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_working_with_environment_variables"></span><h3 data-comment-topic="working-with-environment-variables-11cmwlv" data-anchor="_working_with_environment_variables">9.1. Working with environment variables</h3>
3160
- <div class="paragraph"><p>You can see all environment variables in your shell by running the following command:</p></div>
3161
- <div class="listingblock">
3162
- <div class="content">
3163
- <!-- Generator: GNU source-highlight 2.11.1
3164
- by Lorenzo Bettini
3165
- http://www.lorenzobettini.it
3166
- http://www.gnu.org/software/src-highlite -->
3167
- <pre><tt>env</tt></pre>
3168
- </div>
3169
- </div>
3170
- <div class="paragraph"><p>You can set an evironment variable with the syntax <span class="monospaced">export &lt;NAME&gt;=&lt;VALUE&gt;</span>. For example, to set the <span class="monospaced">APXS2</span> variable to the value <span class="monospaced">/usr/sbin/apxs2</span>:</p></div>
3171
- <div class="listingblock">
3172
- <div class="content">
3173
- <!-- Generator: GNU source-highlight 2.11.1
3174
- by Lorenzo Bettini
3175
- http://www.lorenzobettini.it
3176
- http://www.gnu.org/software/src-highlite -->
3177
- <pre><tt><span style="font-weight: bold"><span style="color: #0000FF">export</span></span> <span style="color: #009900">APXS2</span><span style="color: #990000">=</span>/usr/sbin/apxs<span style="color: #993399">2</span></tt></pre>
3178
- </div>
3179
- </div>
3180
- <div class="paragraph"><p>Any process that you run from your shell from that point on will have said environment variable:</p></div>
3181
- <div class="listingblock">
3182
- <div class="content">
3183
- <!-- Generator: GNU source-highlight 2.11.1
3184
- by Lorenzo Bettini
3185
- http://www.lorenzobettini.it
3186
- http://www.gnu.org/software/src-highlite -->
3187
- <pre><tt><span style="font-weight: bold"><span style="color: #0000FF">export</span></span> <span style="color: #009900">APXS2</span><span style="color: #990000">=</span>/usr/sbin/apxs<span style="color: #993399">2</span>
3188
- ruby -e <span style="color: #FF0000">'p ENV["APXS2"]'</span>
3189
- <span style="font-style: italic"><span style="color: #9A1900"># =&gt; "/usr/sbin/apxs2"</span></span></tt></pre>
3190
- </div>
3191
- </div>
3192
- <div class="admonitionblock">
3193
- <table><tr>
3194
- <td class="icon">
3195
- <img src="./images/icons/note.png" alt="Note">
3196
- </td>
3197
- <td class="content">
3198
- <div class="title">The "export" keyword is important</div>
3199
- <div class="paragraph"><p>You <strong>must</strong> set the <span class="monospaced">export</span> keyword. If you omit the <span class="monospaced">export</span> keyword then the environment variable will not be visible to other processes:</p></div>
3200
- <div class="listingblock">
3201
- <div class="content">
3202
- <!-- Generator: GNU source-highlight 2.11.1
3203
- by Lorenzo Bettini
3204
- http://www.lorenzobettini.it
3205
- http://www.gnu.org/software/src-highlite -->
3206
- <pre><tt><span style="color: #009900">APXS2</span><span style="color: #990000">=</span>/usr/sbin/apxs<span style="color: #993399">2</span>
3207
- ruby -e <span style="color: #FF0000">'p ENV["APXS2"]'</span>
3208
- <span style="font-style: italic"><span style="color: #9A1900"># =&gt; nil</span></span></tt></pre>
3209
- </div>
3210
- </div>
3211
- </td>
3212
- </tr></table>
3213
- </div>
3214
- <div class="paragraph"><p>You can reference an environment variable in your shell by typing the <span class="monospaced">$</span> sign followed by the environment variable’s name. For example, to see the value of the <span class="monospaced">PATH</span> variable:</p></div>
3215
- <div class="listingblock">
3216
- <div class="content">
3217
- <!-- Generator: GNU source-highlight 2.11.1
3218
- by Lorenzo Bettini
3219
- http://www.lorenzobettini.it
3220
- http://www.gnu.org/software/src-highlite -->
3221
- <pre><tt>echo <span style="color: #009900">$PATH</span></tt></pre>
3222
- </div>
3223
- </div>
3224
- <div class="paragraph"><p>You can also use this trick to extend the value of an environment variable:</p></div>
3225
- <div class="listingblock">
3226
- <div class="content">
3227
- <!-- Generator: GNU source-highlight 2.11.1
3228
- by Lorenzo Bettini
3229
- http://www.lorenzobettini.it
3230
- http://www.gnu.org/software/src-highlite -->
3231
- <pre><tt><span style="font-weight: bold"><span style="color: #0000FF">export</span></span> <span style="color: #009900">PATH</span><span style="color: #990000">=</span>/usr/bin
3232
-
3233
- <span style="font-style: italic"><span style="color: #9A1900"># Prepends '/opt/local/bin', so that it becomes /opt/local/bin:/usr/bin</span></span>
3234
- <span style="font-weight: bold"><span style="color: #0000FF">export</span></span> <span style="color: #009900">PATH</span><span style="color: #990000">=</span>/opt/local/bin<span style="color: #990000">:</span><span style="color: #009900">$PATH</span>
3235
- <span style="font-style: italic"><span style="color: #9A1900"># Appends '/usr/local/bin', so that it becomes /opt/local/bin:/usr/bin:/usr/local/bin</span></span>
3236
- <span style="font-weight: bold"><span style="color: #0000FF">export</span></span> <span style="color: #009900">PATH</span><span style="color: #990000">=</span><span style="color: #009900">$PATH</span><span style="color: #990000">:</span>/usr/local/bin</tt></pre>
3237
- </div>
3238
- </div>
1368
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/indepth/environment_variables.html#working-with-environment-variables">https://www.phusionpassenger.com/library/indepth/environment_variables.html#working-with-environment-variables</a></p></div>
3239
1369
  </div>
3240
1370
  <div class="sect2">
3241
1371
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="the_path_env_var"></span><h3 data-comment-topic="the-path-environment-variable-yzfn3k" data-anchor="the_path_env_var">9.2. The PATH environment variable</h3>
3242
- <div class="paragraph"><p>The <span class="monospaced">PATH</span> environment variable dictates where the system looks for command. It is a colon-separated list of directories. If you get a "command not found" error while you know that the command is installed, then setting <span class="monospaced">PATH</span> will help. For example suppose that the command <span class="monospaced">frobnicator</span> is in <span class="monospaced">/opt/local/bin</span>:</p></div>
3243
- <div class="listingblock">
3244
- <div class="content">
3245
- <!-- Generator: GNU source-highlight 2.11.1
3246
- by Lorenzo Bettini
3247
- http://www.lorenzobettini.it
3248
- http://www.gnu.org/software/src-highlite -->
3249
- <pre><tt>user@localhost bash$ frobnicator
3250
- bash<span style="color: #990000">:</span> frobnicator<span style="color: #990000">:</span> <span style="font-weight: bold"><span style="color: #0000FF">command</span></span> not found</tt></pre>
3251
- </div>
3252
- </div>
3253
- <div class="paragraph"><p>We verify that <span class="monospaced">/opt/local/bin</span> is not in <span class="monospaced">PATH</span>:</p></div>
3254
- <div class="listingblock">
3255
- <div class="content">
3256
- <!-- Generator: GNU source-highlight 2.11.1
3257
- by Lorenzo Bettini
3258
- http://www.lorenzobettini.it
3259
- http://www.gnu.org/software/src-highlite -->
3260
- <pre><tt>user@localhost bash$ echo <span style="color: #009900">$PATH</span>
3261
- /bin<span style="color: #990000">:</span>/usr/bin<span style="color: #990000">:</span>/usr/local/bin</tt></pre>
3262
- </div>
3263
- </div>
3264
- <div class="paragraph"><p>We can run <span class="monospaced">frobnicator</span> through it’s full path…</p></div>
3265
- <div class="listingblock">
3266
- <div class="content">
3267
- <!-- Generator: GNU source-highlight 2.11.1
3268
- by Lorenzo Bettini
3269
- http://www.lorenzobettini.it
3270
- http://www.gnu.org/software/src-highlite -->
3271
- <pre><tt>user@localhost bash$ /opt/local/bin/frobnicator
3272
- <span style="font-style: italic"><span style="color: #9A1900"># =&gt; success!</span></span></tt></pre>
3273
- </div>
3274
- </div>
3275
- <div class="paragraph"><p>…or we can add <span class="monospaced">/opt/local/bin</span> to <span class="monospaced">PATH</span>.</p></div>
3276
- <div class="listingblock">
3277
- <div class="content">
3278
- <!-- Generator: GNU source-highlight 2.11.1
3279
- by Lorenzo Bettini
3280
- http://www.lorenzobettini.it
3281
- http://www.gnu.org/software/src-highlite -->
3282
- <pre><tt>user@localhost bash$ <span style="font-weight: bold"><span style="color: #0000FF">export</span></span> <span style="color: #009900">PATH</span><span style="color: #990000">=</span><span style="color: #009900">$PATH</span><span style="color: #990000">:</span>/opt/local/bin
3283
- user@localhost bash$ frobnicator
3284
- <span style="font-style: italic"><span style="color: #9A1900"># =&gt; success!</span></span></tt></pre>
3285
- </div>
3286
- </div>
1372
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/indepth/environment_variables.html#the-path-environment-variable">https://www.phusionpassenger.com/library/indepth/environment_variables.html#the-path-environment-variable</a></p></div>
3287
1373
  <div class="sect3">
3288
1374
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_adding_phusion_passenger_8217_s_administration_tools_to_path"></span><h4 data-comment-topic="adding-phusion-passenger-s-administration-tools-to-path-d7k5mh" data-anchor="_adding_phusion_passenger_8217_s_administration_tools_to_path">9.2.1. Adding Phusion Passenger’s administration tools to PATH</h4>
3289
- <div class="paragraph"><p>If you get a "command not found" error when invoking one of the Phusion Passenger administration tools (e.g. <span class="monospaced">passenger-status</span> or <span class="monospaced">passenger-memory-stats</span> then that means the tools are not in <span class="monospaced">PATH</span>, so you need to add them.</p></div>
3290
- <div class="ulist"><ul>
3291
- <li>
3292
- <p>
3293
- If you <a href="#rubygems_generic_install">installed Phusion Passenger with RubyGems</a>, then the tools are in your RubyGems executable path. You can view the gem path using the command <span class="monospaced">gem env</span>:
3294
- </p>
3295
- <div class="listingblock">
3296
- <div class="content monospaced">
3297
- <pre>$ gem env
3298
- RubyGems Environment:
3299
- - RUBYGEMS VERSION: 1.8.15
3300
- - RUBY VERSION: 1.8.7 (2011-12-28 patchlevel 357) [i686-darwin10.8.0]
3301
- - INSTALLATION DIRECTORY: /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8
3302
- - RUBY EXECUTABLE: /opt/ruby-enterprise-1.8.7-2010.01/bin/ruby
3303
- - EXECUTABLE DIRECTORY: /opt/ruby-enterprise-1.8.7-2010.01/bin &lt;--------- !!
3304
- - RUBYGEMS PLATFORMS:
3305
- - ruby
3306
- - x86-darwin-10
3307
- - GEM PATHS:
3308
- - /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8
3309
- - /Users/hongli/.gem/ruby/1.8
3310
- - GEM CONFIGURATION:
3311
- - :update_sources =&gt; true
3312
- - :verbose =&gt; true
3313
- - :benchmark =&gt; false
3314
- - :backtrace =&gt; false
3315
- - :bulk_threshold =&gt; 1000
3316
- - "gem" =&gt; "--no-ri --no-rdoc"
3317
- - REMOTE SOURCES:
3318
- - http://rubygems.org/</pre>
3319
- </div>
3320
- </div>
3321
- <div class="paragraph"><p>As you can see, the RubyGems executable path in the example happens to be <span class="monospaced">/opt/ruby-enterprise-1.8.7-2010.01/bin</span>. So that directory must be added to <span class="monospaced">PATH</span>.</p></div>
3322
- </li>
3323
- <li>
3324
- <p>
3325
- If you <a href="#tarball_generic_install">installed Phusion Passenger using the tarball</a>, then the tools are in the <span class="monospaced">bin</span> subdirectory of the Phusion Passenger tarball directory that you extracted. For example, if you extracted <span class="monospaced">passenger-4.9.0.tar.gz</span> inside <span class="monospaced">/opt</span>, then the tools are located in <span class="monospaced">/opt/passenger-4.0.9/bin</span>. In that case, you need to add <span class="monospaced">/opt/passenger-4.0.9/bin</span> to your <span class="monospaced">PATH</span>.
3326
- </p>
3327
- </li>
3328
- <li>
3329
- <p>
3330
- If you installed Phusion Passenger using native OS packages, then some Phusion Passenger administration tools are in <span class="monospaced">/usr/bin</span>, while others are in <span class="monospaced">/usr/sbin</span>. If you are not logged in as root, then <span class="monospaced">/usr/sbin</span> may not be in <span class="monospaced">PATH</span>, which would explain why you get a "command not found" when trying to invoke some of the tools. You should <span class="monospaced">/usr/sbin</span> to <span class="monospaced">PATH</span>.
3331
- </p>
3332
- </li>
3333
- <li>
3334
- <p>
3335
- If you are unsure where your Phusion Passenger directory is then you can use the <span class="monospaced">find</span> command to look them up. Go to the root directory and invoke <span class="monospaced">find</span> with <span class="monospaced">sudo</span>:
3336
- </p>
3337
- <div class="listingblock">
3338
- <div class="content monospaced">
3339
- <pre>$ cd /
3340
- $ sudo find . -name passenger-status
3341
- /usr/local/passenger/bin/passenger-status</pre>
3342
- </div>
3343
- </div>
3344
- <div class="paragraph"><p>In this example, the administration tools happen to be in <span class="monospaced">/usr/local/passenger/bin</span>, so you must add that to <span class="monospaced">PATH</span>.</p></div>
3345
- </li>
3346
- </ul></div>
3347
- <div class="admonitionblock">
3348
- <table><tr>
3349
- <td class="icon">
3350
- <img src="./images/icons/note.png" alt="Note">
3351
- </td>
3352
- <td class="content">You may still get a "command not found" when invoking the tools through sudo, even after you’ve added the relevant directory to <span class="monospaced">PATH</span>. Please read <a href="#env_vars_and_sudo">Environment variables and sudo</a> to learn more.</td>
3353
- </tr></table>
3354
- </div>
1375
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/indepth/environment_variables.html#adding-passenger-s-administration-tools-to-path">https://www.phusionpassenger.com/library/indepth/environment_variables.html#adding-passenger-s-administration-tools-to-path</a></p></div>
3355
1376
  </div>
3356
1377
  </div>
3357
1378
  <div class="sect2">
3358
1379
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_making_environment_variables_permanent"></span><h3 data-comment-topic="making-environment-variables-permanent-mkq46d" data-anchor="_making_environment_variables_permanent">9.3. Making environment variables permanent</h3>
3359
- <div class="paragraph"><p>When you exit your shell, the evironment variable changes are lost. There is no standard method to set environment variables system-wide, so you have to set them in different configuration files for different services.</p></div>
1380
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/indepth/environment_variables.html#making-environment-variables-permanent">https://www.phusionpassenger.com/library/indepth/environment_variables.html#making-environment-variables-permanent</a></p></div>
3360
1381
  <div class="sect3">
3361
1382
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_bash"></span><h4 data-comment-topic="bash-hmcscc" data-anchor="_bash">9.3.1. bash</h4>
3362
- <div class="paragraph"><p>To make environment variables permanent for future bash sessions <strong>for the current user</strong>, add them to your <span class="monospaced">~/.bashrc</span>:</p></div>
3363
- <div class="listingblock">
3364
- <div class="content">
3365
- <!-- Generator: GNU source-highlight 2.11.1
3366
- by Lorenzo Bettini
3367
- http://www.lorenzobettini.it
3368
- http://www.gnu.org/software/src-highlite -->
3369
- <pre><tt>echo <span style="color: #FF0000">'export FOO=bar'</span> <span style="color: #990000">&gt;&gt;</span> <span style="color: #990000">~/.</span>bashrc
3370
- echo <span style="color: #FF0000">'export PATH=/usr/local/bin:$PATH'</span> <span style="color: #990000">&gt;&gt;</span> <span style="color: #990000">~/.</span>bashrc</tt></pre>
3371
- </div>
3372
- </div>
3373
- <div class="paragraph"><p>To make them permanent for future bash sessions <strong>for all users</strong>, add them to <span class="monospaced">/etc/bashrc</span>.</p></div>
3374
- <div class="admonitionblock">
3375
- <table><tr>
3376
- <td class="icon">
3377
- <img src="./images/icons/note.png" alt="Note">
3378
- </td>
3379
- <td class="content">Depending on the system, the bashrc file may have a different filename. On Debian and Ubuntu, it’s <span class="monospaced">/etc/bash.bashrc</span>.
3380
- NOTE: Make sure your <span class="monospaced">~/.bashrc</span> is actually included by your <span class="monospaced">~/.profile</span>, which might not be the case if you created the user with <span class="monospaced">useradd</span> instead of <span class="monospaced">adduser</span> for example</td>
3381
- </tr></table>
3382
- </div>
1383
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/indepth/environment_variables.html#bash">https://www.phusionpassenger.com/library/indepth/environment_variables.html#bash</a></p></div>
3383
1384
  </div>
3384
1385
  <div class="sect3">
3385
1386
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_apache"></span><h4 data-comment-topic="apache-15y3bm0" data-anchor="_apache">9.3.2. Apache</h4>
3386
- <div class="admonitionblock">
3387
- <table><tr>
3388
- <td class="icon">
3389
- <img src="./images/icons/note.png" alt="Note">
3390
- </td>
3391
- <td class="content">This subsection describes how to set environment variables on Apache itself, not on apps served through Phusion Passenger for Apache. The environment variables you set here will be passed to all apps, but you cannot customize them on a per-app basis. See also <a href="#env_vars_passenger_apps">Setting environment variables on Phusion Passenger-served apps</a>.</td>
3392
- </tr></table>
3393
- </div>
3394
- <div class="paragraph"><p>On Debian and Ubuntu, with an Apache installed through apt, Apache environment variables are defined in the file <span class="monospaced">/etc/apache2/envvars</span>. This is a shell script so environment variables must be specified with the shell syntax.</p></div>
3395
- <div class="paragraph"><p>On Red Hat, Fedora, CentOS and ScientificLinux, with an Apache installed through YUM, Apache environment variables are defined in <span class="monospaced">/etc/sysconfig/httpd</span>.</p></div>
3396
- <div class="paragraph"><p>On OS X they are defined in <span class="monospaced">/System/Library/LaunchDaemons/org.apache.httpd.plist</span>, as explained <a href="http://stackoverflow.com/questions/6833939/path-environment-variable-for-apache2-on-mac">here on Stack Overflow</a>.</p></div>
3397
- <div class="paragraph"><p>On other systems, or if you did not install Apache through the system’s package manager, the configuration file for environment variables is specific to the vendor that supplied Apache. There may not even be such a configuration file. You should contact the vendor for support.</p></div>
1387
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/indepth/environment_variables.html#apache">https://www.phusionpassenger.com/library/indepth/environment_variables.html#apache</a></p></div>
3398
1388
  </div>
3399
1389
  <div class="sect3">
3400
1390
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_nginx"></span><h4 data-comment-topic="nginx-uarf27" data-anchor="_nginx">9.3.3. Nginx</h4>
3401
- <div class="admonitionblock">
3402
- <table><tr>
3403
- <td class="icon">
3404
- <img src="./images/icons/note.png" alt="Note">
3405
- </td>
3406
- <td class="content">This subsection describes how to set environment variables on Nginx itself, not on apps served through Phusion Passenger for Nginx. The environment variables you set here will be passed to all apps, but you cannot customize them on a per-app basis. See also <a href="#env_vars_passenger_apps">Setting environment variables on Phusion Passenger-served apps</a>.</td>
3407
- </tr></table>
3408
- </div>
3409
- <div class="paragraph"><p>If you installed Nginx through <a href="#install_on_debian_ubuntu">the Debian or Ubuntu packages</a>, then you can define environment variables in <span class="monospaced">/etc/default/nginx</span>. This is a shell script so you must use the <span class="monospaced">export FOO=bar</span> syntax.</p></div>
3410
- <div class="paragraph"><p>Otherwise, environment variables are best set through the script which starts Nginx. For example, if you installed Nginx from source and you used
3411
- then you should edit that script to define the environment variables. Those init scripts are regular shell scripts, so use the <span class="monospaced">export FOO=bar</span> syntax. Just make sure your set your environment variables before the script starts Nginx.</p></div>
3412
- <div class="admonitionblock">
3413
- <table><tr>
3414
- <td class="icon">
3415
- <img src="./images/icons/note.png" alt="Note">
3416
- </td>
3417
- <td class="content">Setting environment variables on Nginx has no effect on the <a href="#flying_passenger">Flying Passenger daemon</a> because the daemon is started seperately. You should set the environment variables in the shell right before starting the daemon.</td>
3418
- </tr></table>
3419
- </div>
1391
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/indepth/environment_variables.html#nginx">https://www.phusionpassenger.com/library/indepth/environment_variables.html#nginx</a></p></div>
3420
1392
  </div>
3421
1393
  <div class="sect3">
3422
1394
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_cron"></span><h4 data-comment-topic="cron-6272ar" data-anchor="_cron">9.3.4. cron</h4>
3423
- <div class="paragraph"><p>To make environment variables permanent for cron jobs, add those variables to the relevant crontab. But note that inside crontabs you cannot refer to existing environment variables with the <span class="monospaced">$</span> syntax because crontabs are not shell scripts. You have to specify the entire value.</p></div>
3424
- <div class="listingblock">
3425
- <div class="title">What to put in "crontab -e"</div>
3426
- <div class="content monospaced">
3427
- <pre># Environment variable definitions
3428
- FOO=bar
3429
- APXS2=/usr/sbin/apxs2
3430
-
3431
- # **WRONG!** You cannot refer to existing variables with the `$` syntax!
3432
- PATH=/usr/bin:$PATH
3433
- # **WRONG!** You cannot use the 'export' keyword!
3434
- export PATH=/usr/bin:/usr/local/bin
3435
- # Correct:
3436
- PATH=/usr/bin:/usr/local/bin
3437
-
3438
- # Jobs:
3439
- # m h dom mon dow command
3440
- * * * * * frobnicator</pre>
3441
- </div>
3442
- </div>
1395
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/indepth/environment_variables.html#cron">https://www.phusionpassenger.com/library/indepth/environment_variables.html#cron</a></p></div>
3443
1396
  </div>
3444
1397
  <div class="sect3">
3445
1398
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="env_vars_passenger_apps"></span><h4 data-comment-topic="phusion-passenger-served-apps-127wbl2" data-anchor="env_vars_passenger_apps">9.3.5. Phusion Passenger-served apps</h4>
3446
- <div class="paragraph"><p>You can pass environment variables to Phusion Passenger-served apps through various methods:</p></div>
3447
- <div class="ulist"><ul>
3448
- <li>
3449
- <p>
3450
- When running Apache, use the <span class="monospaced">PassEnv</span> and <span class="monospaced">SetEnv</span> directives of <a href="http://httpd.apache.org/docs/2.4/mod/mod_env.html">mod_env</a>. This is supported starting from Phusion Passenger 4.0.
3451
- </p>
3452
- </li>
3453
- <li>
3454
- <p>
3455
- When running Nginx, use the <a href="#PassengerEnvVar">passenger_env_var</a> directive.
3456
- </p>
3457
- </li>
3458
- <li>
3459
- <p>
3460
- Through your <span class="monospaced">bashrc</span>. Starting from version 4.0, Phusion Passenger 4.0 spawns applications through bash and inherit all bash environment variables. Phusion Passenger Standalone tends to be started from the shell and thus inherits all environment variables set by the shell.
3461
- </p>
3462
- </li>
3463
- <li>
3464
- <p>
3465
- Through Apache and Nginx, as described earlier in this chapter. Any environment variables that you set on Apache and Nginx itself are inherited by Phusion Passenger, and thus by Phusion Passenger-served apps as well.
3466
- </p>
3467
- </li>
3468
- <li>
3469
- <p>
3470
- Through the application itself. Most programming languages provide APIs for setting environment variables. For example in Ruby you can write:
3471
- </p>
3472
- <div class="listingblock">
3473
- <div class="content">
3474
- <!-- Generator: GNU source-highlight 2.11.1
3475
- by Lorenzo Bettini
3476
- http://www.lorenzobettini.it
3477
- http://www.gnu.org/software/src-highlite -->
3478
- <pre><tt>ENV<span style="color: #990000">[</span><span style="color: #FF0000">'FOO'</span><span style="color: #990000">]</span> <span style="color: #990000">=</span> <span style="color: #FF0000">'bar'</span></tt></pre>
3479
- </div>
3480
- </div>
3481
- <div class="paragraph"><p>In Python you can write:</p></div>
3482
- <div class="listingblock">
3483
- <div class="content">
3484
- <!-- Generator: GNU source-highlight 2.11.1
3485
- by Lorenzo Bettini
3486
- http://www.lorenzobettini.it
3487
- http://www.gnu.org/software/src-highlite -->
3488
- <pre><tt><span style="font-weight: bold"><span style="color: #000080">import</span></span> os
3489
- os<span style="color: #990000">.</span>environ<span style="color: #990000">[</span><span style="color: #FF0000">'FOO'</span><span style="color: #990000">]</span> <span style="color: #990000">=</span> <span style="color: #FF0000">'bar'</span></tt></pre>
3490
- </div>
3491
- </div>
3492
- </li>
3493
- </ul></div>
1399
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/indepth/environment_variables.html#passenger-served-apps">https://www.phusionpassenger.com/library/indepth/environment_variables.html#passenger-served-apps</a></p></div>
3494
1400
  </div>
3495
1401
  </div>
3496
1402
  <div class="sect2">
3497
1403
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="env_vars_and_sudo"></span><h3 data-comment-topic="environment-variables-and-sudo-znzmif" data-anchor="env_vars_and_sudo">9.4. Environment variables and sudo</h3>
3498
- <div class="admonitionblock">
3499
- <table><tr>
3500
- <td class="icon">
3501
- <img src="./images/icons/note.png" alt="Note">
3502
- </td>
3503
- <td class="content">RVM users should always use the <span class="monospaced">rvmsudo</span> command instead of <span class="monospaced">sudo</span>. However all information in this section apply to <span class="monospaced">rvmsudo</span> as well.</td>
3504
- </tr></table>
3505
- </div>
3506
- <div class="paragraph"><p>The <span class="monospaced">sudo</span> command resets all environment variables before running the specified command, for security reasons. So if you set environment variables before running <span class="monospaced">sudo passenger-install-xxx-module</span>, <span class="monospaced">sudo passenger-status</span> or any other commands, then the environment variables are not correctly passed to the command. You can solve this by running sudo with <span class="monospaced">-E</span> (preserve environment variables):</p></div>
3507
- <div class="listingblock">
3508
- <div class="content">
3509
- <!-- Generator: GNU source-highlight 2.11.1
3510
- by Lorenzo Bettini
3511
- http://www.lorenzobettini.it
3512
- http://www.gnu.org/software/src-highlite -->
3513
- <pre><tt>user@localhost bash$ <span style="font-weight: bold"><span style="color: #0000FF">export</span></span> <span style="color: #009900">APXS2</span><span style="color: #990000">=</span>/usr/sbin/apxs<span style="color: #993399">2</span>
3514
- user@localhost bash$ sudo -E passenger-install-apache<span style="color: #993399">2</span>-module</tt></pre>
3515
- </div>
3516
- </div>
3517
- <div class="paragraph"><p>Alternatively, you can obtain a root prompt with sudo first, and <strong>then</strong> set the environment variables, before running any further commands:</p></div>
3518
- <div class="listingblock">
3519
- <div class="content monospaced">
3520
- <pre>user@localhost bash$ sudo -s
3521
- Password: ...
3522
- root@localhost bash# export APXS2=/usr/sbin/apxs2
3523
- root@localhost bash# passenger-install-apache2-module</pre>
3524
- </div>
3525
- </div>
3526
- <div class="paragraph"><p>Note that for security reasons, <span class="monospaced">sudo</span> <strong>always resets the <span class="monospaced">PATH</span> environment variable</strong>, even if you pass <span class="monospaced">-E</span>! You can get around this problem by obtaining a root prompt first, and then set the environment variables:</p></div>
3527
- <div class="listingblock">
3528
- <div class="content monospaced">
3529
- <pre>user@localhost bash$ sudo -s
3530
- Password: ...
3531
- root@localhost bash# export PATH=$PATH:/opt/myruby/bin
3532
- root@localhost bash# passenger-install-apache2-module</pre>
3533
- </div>
3534
- </div>
1404
+ <div class="paragraph"><p>This documentation has moved. Please visit <a href="https://www.phusionpassenger.com/library/indepth/environment_variables.html#environment-variables-and-sudo">https://www.phusionpassenger.com/library/indepth/environment_variables.html#environment-variables-and-sudo</a></p></div>
3535
1405
  </div>
3536
1406
  </div>
3537
1407
  </div>