passenger 4.0.1 → 4.0.2

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.

data.tar.gz.asc CHANGED
@@ -2,11 +2,11 @@
2
2
  Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
3
3
  Comment: GPGTools - http://gpgtools.org
4
4
 
5
- iQEcBAABAgAGBQJRh4ZKAAoJECrHRaUKISqMQrAH/ArZX43iOQnjFVQTgEq7+Ahg
6
- F77N/r0lg4ZUs8e+cYx9YNa3ZoLCuD2Jm+tbvKpEcGJZZYVLMK0Ji0CslB0fKVSJ
7
- 4yCm0lr1gOGESqvbsrqHNfMxEWgcJExTMKd+StvYNw1Qx9wmeK/yu4Yy0NMUtoQO
8
- quBLMoRbtjeBVTLixgb00QOtqux7AckP3j7jDJg0HPpqaf4ThWgNCfRv2kBEjcPC
9
- 0aZ3e28pXzL75Bhf8ctowxAr6O5M5K9l9roRNBTBvP1GF4ggC9cG5ScB/jYSfBrY
10
- JoQVG8ugRGCdUyBVORULfWWQhGCjY+TWvNCrOXCZylXtEBK3YSE4rEXPevroz2k=
11
- =bnGf
5
+ iQEcBAABAgAGBQJRiUovAAoJECrHRaUKISqM9g0H/jqfZM4QCAVVtppUhGTjv1xi
6
+ jBtKy1/47H9KpU7xwsFtEViyfV6oyKdnTCUonJ8o7wZdlTu+g8mB2jE5zPVU7Lor
7
+ M4BwvpfBPjser/E/MYAuXOdMHAA3DlSQko3ogVkENdzLsNk7zxnmt821zwSM9xr0
8
+ 6LUG2mZqFA6RWChzPqAh49+w+BezAPj5XA+eUTlbITxoSWGLpJbbcmTTDu9ud7sU
9
+ FeplAmxKsVUc+C2zLAeUck1VIdYjbrppQ/DIAt62BTNPbku2hzGh/qK6QMTBSfI9
10
+ 1yKYWGWe/DQ9BHzH7T7Rhh2GvbHaoLpaQLyxZUce1rr+pKZ71AznubBrZAjPQJQ=
11
+ =WyCF
12
12
  -----END PGP SIGNATURE-----
data/NEWS CHANGED
@@ -1,3 +1,11 @@
1
+ Release 4.0.2
2
+ -------------
3
+
4
+ * Bumped the preferred Nginx version to 1.4.1 because of a critical
5
+ Nginx security vulnerability, CVE-2013-2028. Users are advised to
6
+ upgrade immediately.
7
+
8
+
1
9
  Release 4.0.1
2
10
  -------------
3
11
 
@@ -1,9 +1,9 @@
1
1
  <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
- <meta name="generator" content="AsciiDoc 8.6.7">
6
- <title>Phusion Passenger design &amp; architecture</title>
2
+ <html lang="en">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <meta name="generator" content="AsciiDoc 8.6.7">
6
+ <title>Phusion Passenger design &amp; architecture</title>
7
7
  <style type="text/css">
8
8
  /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
9
9
 
@@ -603,7 +603,7 @@ div.exampleblock > div.content, div.sidebarblock > div.content, div.listingblock
603
603
  div.verseblock { border-left-width: 0; margin-left: 3em; }
604
604
  div.quoteblock { border-left-width: 3px; margin-left: 0; margin-right: 0;}
605
605
  div.admonitionblock td.content { border-left: 3px solid #E8E8E8; }
606
- </style>
606
+ </style>
607
607
  <script type="text/javascript">
608
608
  /*<![CDATA[*/
609
609
  var asciidoc = { // Namespace.
@@ -797,7 +797,8 @@ install: function(toclevels) {
797
797
  }
798
798
  asciidoc.install();
799
799
  /*]]>*/
800
- </script><style type="text/css">
800
+ </script>
801
+ <style type="text/css">
801
802
  body {
802
803
  margin: 1em auto 1em auto;
803
804
  padding: 0 1em 0 1em;
@@ -1054,11 +1055,12 @@ pre {
1054
1055
  }
1055
1056
 
1056
1057
  </style>
1057
- </head>
1058
+ </head>
1058
1059
  <body class="article">
1059
1060
  <div id="topbar" style="display: none">
1060
1061
  <div class="title">
1061
- <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAKCAYAAAEV95QVAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sGCRMSACDxkZwAAAAidEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVAgb24gYSBNYWOHqHdDAAAAZUlEQVQY032PSxbAIAjEIlfygL6ePF3UUvpzNjgSYWwqAMEhUQnANnsC7TQPeJpsVWzMuh2sog4vDTUbqP081zECrW4dtdaQGSIKlWluPyjK+VXxAz5XfcKufCzA130AfQHWB30HZxlPaP080xsAAAAASUVORK5CYII=" width="11" height="10" alt=""><a href="javascript:void(Mizuho.smoothlyScrollToToc())">Phusion Passenger design &amp; architecture</a>
1062
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAKCAYAAAEV95QVAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sGCRMSACDxkZwAAAAidEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVAgb24gYSBNYWOHqHdDAAAAZUlEQVQY032PSxbAIAjEIlfygL6ePF3UUvpzNjgSYWwqAMEhUQnANnsC7TQPeJpsVWzMuh2sog4vDTUbqP081zECrW4dtdaQGSIKlWluPyjK+VXxAz5XfcKufCzA130AfQHWB30HZxlPaP080xsAAAAASUVORK5CYII=" width="11" height="10" alt="">
1063
+ <a href="javascript:void(Mizuho.smoothlyScrollToToc())">Phusion Passenger design &amp; architecture</a>
1062
1064
  </div>
1063
1065
  <a href="javascript:void(0)" id="current_section"></a>
1064
1066
  </div>
@@ -1068,7 +1070,8 @@ pre {
1068
1070
  <div class="sectionbody">
1069
1071
  <div class="paragraph"><p><span class="image">
1070
1072
  <a class="image" href="http://www.phusion.nl/">
1071
- <img src="images/phusion_banner.png" alt="images/phusion_banner.png"></a>
1073
+ <img src="images/phusion_banner.png" alt="images/phusion_banner.png">
1074
+ </a>
1072
1075
  </span></p></div>
1073
1076
  <div class="paragraph"><p>Last updated: June 5, 2012.</p></div>
1074
1077
  <div class="paragraph"><p>This document describes Phusion Passenger’s design and architure in a global way.
@@ -1111,10 +1114,11 @@ to exit. This does not necessarily mean that the web application speaks HTTP
1111
1114
  directly: it just means that the web application accepts some kind of
1112
1115
  representation of an HTTP request.</p></div>
1113
1116
  <div class="paragraph"><p><span class="image">
1114
- <img src="images/typical_isolated_web_application.png" alt="Architecture of a typical web application in isolation"></span></p></div>
1117
+ <img src="images/typical_isolated_web_application.png" alt="Architecture of a typical web application in isolation">
1118
+ </span></p></div>
1115
1119
  <div class="paragraph"><p>Few web applications are accessible directly by HTTP clients. Common models
1116
1120
  are:</p></div>
1117
- <div class="olist arabic"><ol class="arabic">
1121
+ <div class="olist arabic"><ol class="arabic">
1118
1122
  <li>
1119
1123
  <p>
1120
1124
  The web application is contained in an application server. This application
@@ -1128,7 +1132,7 @@ sent to the application server, which in turn sends them to the web server,
1128
1132
  and eventually to the HTTP client.
1129
1133
  </p>
1130
1134
  <div class="paragraph"><p>Typical examples of such a model:</p></div>
1131
- <div class="ulist"><ul>
1135
+ <div class="ulist"><ul>
1132
1136
  <li>
1133
1137
  <p>
1134
1138
  A J2EE application, contained in the Tomcat application server, proxied
@@ -1239,12 +1243,14 @@ This interface covers HTTP request and response handling, and is not dependent o
1239
1243
  any particular application server. The idea is that any Rack-compliant application
1240
1244
  server can implement the Rack specification and work with all Rack-compliant web applications.</p></div>
1241
1245
  <div class="paragraph"><p><span class="image">
1242
- <img src="images/rack.png" alt="images/rack.png"></span></p></div>
1246
+ <img src="images/rack.png" alt="images/rack.png">
1247
+ </span></p></div>
1243
1248
  <div class="paragraph"><p>In the distant past, each Ruby web framework had its own interface, so application
1244
1249
  servers needed to explicitly add support for each web framework. Nowadays application
1245
1250
  servers just support Rack.</p></div>
1246
1251
  <div class="paragraph"><p><span class="image">
1247
- <img src="images/many_web_framework_protocols.png" alt="images/many_web_framework_protocols.png"></span></p></div>
1252
+ <img src="images/many_web_framework_protocols.png" alt="images/many_web_framework_protocols.png">
1253
+ </span></p></div>
1248
1254
  <div class="paragraph"><p>Ruby on Rails has been fully Rack compliant since version 3.0. Rails 2.3 was partially
1249
1255
  Rack-compliant while earlier versions were not Rack-compliant at all. Phusion Passenger
1250
1256
  supports Rack as well as all Rails 1.x and 2.x versions.</p></div>
@@ -1294,9 +1300,10 @@ dynamic module system: all modules must be statically compiled into Nginx.</p></
1294
1300
  Phusion Passenger extends Apache/Nginx and allows it to act like an
1295
1301
  application server. This is shown in the following diagram:</p></div>
1296
1302
  <div class="paragraph"><p><span class="image">
1297
- <img src="images/passenger_architecture.png" alt="Passenger’s architecture"></span></p></div>
1303
+ <img src="images/passenger_architecture.png" alt="Passenger’s architecture">
1304
+ </span></p></div>
1298
1305
  <div class="paragraph"><p>Phusion Passenger consists of:</p></div>
1299
- <div class="ulist"><ul>
1306
+ <div class="ulist"><ul>
1300
1307
  <li>
1301
1308
  <p>
1302
1309
  an Apache module, <em>mod_passenger</em>. This is written in C++, and can be found in the directory <em>ext/apache2</em>.
@@ -1331,7 +1338,7 @@ seconds on a modern computer, and possibly much longer on a heavily loaded serve
1331
1338
  A less naive implementation would keep spawned application processes alive,
1332
1339
  similar to how Lighttpd’s FastCGI implementation works.
1333
1340
  However, this still has several problems:</p></div>
1334
- <div class="olist arabic"><ol class="arabic">
1341
+ <div class="olist arabic"><ol class="arabic">
1335
1342
  <li>
1336
1343
  <p>
1337
1344
  The first request to a Rails website will be slow, and subsequent requests
@@ -1398,7 +1405,7 @@ idle for an extended period of time.</p></div>
1398
1405
  <a href="rdoc/index.html">The spawn server’s RDoc documentation</a> documents the
1399
1406
  implementation in detail.</p></div>
1400
1407
  <div class="paragraph"><p>The spawn server consists of 3 logical layers:</p></div>
1401
- <div class="olist arabic"><ol class="arabic">
1408
+ <div class="olist arabic"><ol class="arabic">
1402
1409
  <li>
1403
1410
  <p>
1404
1411
  <strong>The spawn manager.</strong> This is the topmost layer, and acts like a fascade for
@@ -1428,7 +1435,8 @@ implementation in detail.</p></div>
1428
1435
  </li>
1429
1436
  </ol></div>
1430
1437
  <div class="paragraph"><p><span class="image">
1431
- <img src="images/spawn_server_architecture.png" alt="The spawn server’s architecture"></span></p></div>
1438
+ <img src="images/spawn_server_architecture.png" alt="The spawn server’s architecture">
1439
+ </span></p></div>
1432
1440
  <div class="paragraph"><p>As you can see, we have two layers of code caching: when the spawn server
1433
1441
  receives a request to spawn a new application instance, it will forward the
1434
1442
  request to the correct framework spawner server (and will spawn that framework
@@ -1460,9 +1468,9 @@ haven’t been written to. This means that all spawned Rails applications will
1460
1468
  application code, with each other. This results in a dramatic reduction in
1461
1469
  memory usage.</p></div>
1462
1470
  <div class="admonitionblock">
1463
- <table><tr>
1471
+ <table><tr>
1464
1472
  <td class="icon">
1465
- <img src="./images/icons/note.png" alt="Note">
1473
+ <img src="./images/icons/note.png" alt="Note">
1466
1474
  </td>
1467
1475
  <td class="content">
1468
1476
  <div class="paragraph"><p>Sharing memory only works if <a href="http://www.rubyenterpriseedition.com/">Ruby
@@ -1472,7 +1480,7 @@ Enterprise Edition website for technical details.</p></div>
1472
1480
  <div class="paragraph"><p>Passenger works fine with standard Ruby. You still get to enjoy reduced Rails
1473
1481
  startup times. You just won’t be able to benefit from memory sharing.</p></div>
1474
1482
  </td>
1475
- </tr></table>
1483
+ </tr></table>
1476
1484
  </div>
1477
1485
  <div class="paragraph"><p>Note that <a href="http://rubini.us/">Rubinius</a>'s garbage collector is already
1478
1486
  copy-on-write friendly.</p></div>
@@ -1485,7 +1493,7 @@ single request at the same time. This is obviously undesirable. But before we
1485
1493
  dive into the solution, let us take a look how the “competition” solves this
1486
1494
  problem. PHP has similar problems: a single PHP script can also process only
1487
1495
  one HTTP request at a time.</p></div>
1488
- <div class="ulist"><ul>
1496
+ <div class="ulist"><ul>
1489
1497
  <li>
1490
1498
  <p>
1491
1499
  mod_php “solves” this problem by using Apache’s MPM. In other words,
@@ -1523,7 +1531,8 @@ algorithm, which is non-trivial. The algorithm is documented in detail in
1523
1531
  Attribution-Share Alike 3.0 Unported License</a>.</p></div>
1524
1532
  <div class="paragraph"><p><span class="image">
1525
1533
  <a class="image" href="link:http://creativecommons.org/licenses/by-sa/3.0/">
1526
- <img src="images/by_sa.png" alt="images/by_sa.png"></a>
1534
+ <img src="images/by_sa.png" alt="images/by_sa.png">
1535
+ </a>
1527
1536
  </span></p></div>
1528
1537
  </div>
1529
1538
  </div>
@@ -2041,5 +2050,5 @@ Mizuho.initializeTopBar = $.proxy(function() {
2041
2050
  $(document).ready(Mizuho.initializeTopBar);
2042
2051
 
2043
2052
  </script>
2044
- </body>
2053
+ </body>
2045
2054
  </html>
@@ -1,9 +1,9 @@
1
1
  <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
- <meta name="generator" content="AsciiDoc 8.6.7">
6
- <title>Security of user switching support in Passenger</title>
2
+ <html lang="en">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <meta name="generator" content="AsciiDoc 8.6.7">
6
+ <title>Security of user switching support in Passenger</title>
7
7
  <style type="text/css">
8
8
  /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
9
9
 
@@ -603,7 +603,7 @@ div.exampleblock > div.content, div.sidebarblock > div.content, div.listingblock
603
603
  div.verseblock { border-left-width: 0; margin-left: 3em; }
604
604
  div.quoteblock { border-left-width: 3px; margin-left: 0; margin-right: 0;}
605
605
  div.admonitionblock td.content { border-left: 3px solid #E8E8E8; }
606
- </style>
606
+ </style>
607
607
  <script type="text/javascript">
608
608
  /*<![CDATA[*/
609
609
  var asciidoc = { // Namespace.
@@ -797,7 +797,8 @@ install: function(toclevels) {
797
797
  }
798
798
  asciidoc.install();
799
799
  /*]]>*/
800
- </script><style type="text/css">
800
+ </script>
801
+ <style type="text/css">
801
802
  body {
802
803
  margin: 1em auto 1em auto;
803
804
  padding: 0 1em 0 1em;
@@ -1054,11 +1055,12 @@ pre {
1054
1055
  }
1055
1056
 
1056
1057
  </style>
1057
- </head>
1058
+ </head>
1058
1059
  <body class="article">
1059
1060
  <div id="topbar" style="display: none">
1060
1061
  <div class="title">
1061
- <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAKCAYAAAEV95QVAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sGCRMSACDxkZwAAAAidEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVAgb24gYSBNYWOHqHdDAAAAZUlEQVQY032PSxbAIAjEIlfygL6ePF3UUvpzNjgSYWwqAMEhUQnANnsC7TQPeJpsVWzMuh2sog4vDTUbqP081zECrW4dtdaQGSIKlWluPyjK+VXxAz5XfcKufCzA130AfQHWB30HZxlPaP080xsAAAAASUVORK5CYII=" width="11" height="10" alt=""><a href="javascript:void(Mizuho.smoothlyScrollToToc())">Security of user switching support in Passenger</a>
1062
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAKCAYAAAEV95QVAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sGCRMSACDxkZwAAAAidEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVAgb24gYSBNYWOHqHdDAAAAZUlEQVQY032PSxbAIAjEIlfygL6ePF3UUvpzNjgSYWwqAMEhUQnANnsC7TQPeJpsVWzMuh2sog4vDTUbqP081zECrW4dtdaQGSIKlWluPyjK+VXxAz5XfcKufCzA130AfQHWB30HZxlPaP080xsAAAAASUVORK5CYII=" width="11" height="10" alt="">
1063
+ <a href="javascript:void(Mizuho.smoothlyScrollToToc())">Security of user switching support in Passenger</a>
1062
1064
  </div>
1063
1065
  <a href="javascript:void(0)" id="current_section"></a>
1064
1066
  </div>
@@ -1083,13 +1085,13 @@ pre {
1083
1085
  <span class="anchor_helper" id="_problem_description"></span><h2 data-anchor="_problem_description">1. Problem description</h2>
1084
1086
  <div class="sectionbody">
1085
1087
  <div class="admonitionblock">
1086
- <table><tr>
1088
+ <table><tr>
1087
1089
  <td class="icon">
1088
- <img src="./images/icons/tip.png" alt="Tip">
1090
+ <img src="./images/icons/tip.png" alt="Tip">
1089
1091
  </td>
1090
1092
  <td class="content">It is strongly recommended that you first read our
1091
1093
  <a href="Architectural%20overview.html">Architectural Overview</a>.</td>
1092
- </tr></table>
1094
+ </tr></table>
1093
1095
  </div>
1094
1096
  <div class="paragraph"><p>A straightforward implementation of Passenger will spawn Rails applications in
1095
1097
  the same user context as Apache itself. On server machines which host multiple
@@ -1109,7 +1111,7 @@ Passenger’s security may be peer reviewed.</p></div>
1109
1111
  <div class="paragraph"><p>It seems that the only way to solve this problem on Unix, is to run each Rails
1110
1112
  application server as its owner’s user and group. Passenger can make use of
1111
1113
  one of the following methods to implement this:</p></div>
1112
- <div class="olist arabic"><ol class="arabic">
1114
+ <div class="olist arabic"><ol class="arabic">
1113
1115
  <li>
1114
1116
  <p>
1115
1117
  Apache (and thus Passenger) must already be running as root.
@@ -1192,7 +1194,7 @@ a password file, which only Apache and the wrapper can read, through
1192
1194
  the use of proper file permissions. The password file must never be world
1193
1195
  readable or writable.</p></div>
1194
1196
  <div class="paragraph"><p>It works as follows:</p></div>
1195
- <div class="olist arabic"><ol class="arabic">
1197
+ <div class="olist arabic"><ol class="arabic">
1196
1198
  <li>
1197
1199
  <p>
1198
1200
  Passenger runs the wrapper.
@@ -1269,7 +1271,7 @@ or (on Linux) by reading the file <span class="monospaced">/proc/$PID/cmdline</s
1269
1271
  <span class="anchor_helper" id="_common_security_issues"></span><h3 data-anchor="_common_security_issues">2.7. Common security issues</h3>
1270
1272
  <div class="paragraph"><p>Whatever method Passenger will use, the following security principles must be
1271
1273
  honored:</p></div>
1272
- <div class="ulist"><ul>
1274
+ <div class="ulist"><ul>
1273
1275
  <li>
1274
1276
  <p>
1275
1277
  Rails applications must never be run as root.
@@ -1278,7 +1280,7 @@ Rails applications must never be run as root.
1278
1280
  </ul></div>
1279
1281
  <div class="paragraph"><p>It might also be worthy to look into suEXEC’s security model for inspiration.</p></div>
1280
1282
  <div class="paragraph"><p>Also, the following questions remain:</p></div>
1281
- <div class="ulist"><ul>
1283
+ <div class="ulist"><ul>
1282
1284
  <li>
1283
1285
  <p>
1284
1286
  Is there a need for a user whitelist/blacklist? That is, is there a need for
@@ -1827,5 +1829,5 @@ Mizuho.initializeTopBar = $.proxy(function() {
1827
1829
  $(document).ready(Mizuho.initializeTopBar);
1828
1830
 
1829
1831
  </script>
1830
- </body>
1832
+ </body>
1831
1833
  </html>
@@ -1,9 +1,9 @@
1
1
  <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
- <meta name="generator" content="AsciiDoc 8.6.7">
6
- <title>Phusion Passenger users guide, Apache version</title>
2
+ <html lang="en">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <meta name="generator" content="AsciiDoc 8.6.7">
6
+ <title>Phusion Passenger users guide, Apache version</title>
7
7
  <style type="text/css">
8
8
  /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
9
9
 
@@ -603,7 +603,7 @@ div.exampleblock > div.content, div.sidebarblock > div.content, div.listingblock
603
603
  div.verseblock { border-left-width: 0; margin-left: 3em; }
604
604
  div.quoteblock { border-left-width: 3px; margin-left: 0; margin-right: 0;}
605
605
  div.admonitionblock td.content { border-left: 3px solid #E8E8E8; }
606
- </style>
606
+ </style>
607
607
  <script type="text/javascript">
608
608
  /*<![CDATA[*/
609
609
  var asciidoc = { // Namespace.
@@ -797,7 +797,8 @@ install: function(toclevels) {
797
797
  }
798
798
  asciidoc.install();
799
799
  /*]]>*/
800
- </script><style type="text/css">
800
+ </script>
801
+ <style type="text/css">
801
802
  body {
802
803
  margin: 1em auto 1em auto;
803
804
  padding: 0 1em 0 1em;
@@ -1054,11 +1055,12 @@ pre {
1054
1055
  }
1055
1056
 
1056
1057
  </style>
1057
- </head>
1058
+ </head>
1058
1059
  <body class="article">
1059
1060
  <div id="topbar" style="display: none">
1060
1061
  <div class="title">
1061
- <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAKCAYAAAEV95QVAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sGCRMSACDxkZwAAAAidEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVAgb24gYSBNYWOHqHdDAAAAZUlEQVQY032PSxbAIAjEIlfygL6ePF3UUvpzNjgSYWwqAMEhUQnANnsC7TQPeJpsVWzMuh2sog4vDTUbqP081zECrW4dtdaQGSIKlWluPyjK+VXxAz5XfcKufCzA130AfQHWB30HZxlPaP080xsAAAAASUVORK5CYII=" width="11" height="10" alt=""><a href="javascript:void(Mizuho.smoothlyScrollToToc())">Phusion Passenger users guide, Apache version</a>
1062
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAKCAYAAAEV95QVAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sGCRMSACDxkZwAAAAidEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVAgb24gYSBNYWOHqHdDAAAAZUlEQVQY032PSxbAIAjEIlfygL6ePF3UUvpzNjgSYWwqAMEhUQnANnsC7TQPeJpsVWzMuh2sog4vDTUbqP081zECrW4dtdaQGSIKlWluPyjK+VXxAz5XfcKufCzA130AfQHWB30HZxlPaP080xsAAAAASUVORK5CYII=" width="11" height="10" alt="">
1063
+ <a href="javascript:void(Mizuho.smoothlyScrollToToc())">Phusion Passenger users guide, Apache version</a>
1062
1064
  </div>
1063
1065
  <a href="javascript:void(0)" id="current_section"></a>
1064
1066
  </div>
@@ -1068,12 +1070,13 @@ pre {
1068
1070
  <div class="sectionbody">
1069
1071
  <div class="paragraph"><p><span class="image">
1070
1072
  <a class="image" href="http://www.phusion.nl/">
1071
- <img src="images/phusion_banner.png" alt="images/phusion_banner.png"></a>
1073
+ <img src="images/phusion_banner.png" alt="images/phusion_banner.png">
1074
+ </a>
1072
1075
  </span></p></div>
1073
1076
  <div class="paragraph"><p>Phusion Passenger is an application server which can directly integrate into Apache. It is designed to be easy to use, fast, stable and reliable and is used by <a href="http://trends.builtwith.com/Web-Server/Phusion-Passenger">hundreds of thousands of websites</a> all over the world.</p></div>
1074
1077
  <div class="paragraph"><p>Phusion Passenger is a so-called polyglot application server because it supports applications written in multiple programming languages. At this time, Ruby and Python are supported.</p></div>
1075
1078
  <div class="paragraph"><p>This users guide will teach you:</p></div>
1076
- <div class="ulist"><ul>
1079
+ <div class="ulist"><ul>
1077
1080
  <li>
1078
1081
  <p>
1079
1082
  How to install Phusion Passenger.
@@ -1289,7 +1292,7 @@ if it doesn’t work on your POSIX-compliant operating system.</p></div>
1289
1292
  </div>
1290
1293
  <div class="sect2">
1291
1294
  <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-f3pbrb" data-anchor="_where_to_get_support">1.2. Where to get support</h3>
1292
- <div class="ulist"><ul>
1295
+ <div class="ulist"><ul>
1293
1296
  <li>
1294
1297
  <p>
1295
1298
  <a href="http://code.google.com/p/phusion-passenger/issues/list">Issue tracker</a> - report
@@ -1328,7 +1331,7 @@ Report security vulnerabilities to <a href="mailto:support@phusion.nl">support@p
1328
1331
  <div class="sect2">
1329
1332
  <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-l0om5d" data-anchor="_synopsis">2.1. Synopsis</h3>
1330
1333
  <div class="paragraph"><p>The Phusion Passenger installation process consists of two steps:</p></div>
1331
- <div class="olist arabic"><ol class="arabic">
1334
+ <div class="olist arabic"><ol class="arabic">
1332
1335
  <li>
1333
1336
  <p>
1334
1337
  The <strong>obtainment step</strong>, where you download the Phusion Passenger files puts them somewhere on your system. This can be done through downloading the source tarball, installing the Ruby gem or installing a native OS package via APT or YUM.
@@ -1356,7 +1359,7 @@ The <strong>integration step</strong>, where you configure Phusion Passenger so
1356
1359
  </div>
1357
1360
  </div>
1358
1361
  <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>
1359
- <div class="ulist"><ul>
1362
+ <div class="ulist"><ul>
1360
1363
  <li>
1361
1364
  <p>
1362
1365
  Are you using RVM? Run <span class="monospaced">rvmsudo -s</span>
@@ -1415,7 +1418,7 @@ Is <em>sudo</em> not installed on your system? Run <span class="monospaced">su -
1415
1418
  </div>
1416
1419
  <span class="anchor_helper" id="add_rubygems_bin_dir_to_path"></span><h4 class="float" data-anchor="add_rubygems_bin_dir_to_path">Step 3: add the RubyGems bin directory to your $PATH</h4>
1417
1420
  <div class="paragraph"><p>If you all of the following are applicable to you:</p></div>
1418
- <div class="ulist"><ul>
1421
+ <div class="ulist"><ul>
1419
1422
  <li>
1420
1423
  <p>
1421
1424
  You are on Debian or Ubuntu,
@@ -1489,7 +1492,7 @@ configuration file. However, it doesn’t copy any files to outside the Phusion
1489
1492
  <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="installing-via-the-source-tarball-1cgxrqc" data-anchor="tarball_generic_install">2.3. Generic installation, upgrade and downgrade method: via tarball</h3>
1490
1493
  <span class="anchor_helper" id="_step_1_download_and_extract_the_tarball"></span><h4 class="float" data-anchor="_step_1_download_and_extract_the_tarball">Step 1: download and extract the tarball</h4>
1491
1494
  <div class="paragraph"><p>Download the open source Phusion Passenger tarball from <a href="https://www.phusionpassenger.com/download#open_source">the Phusion Passenger website</a>. Specific older versions are not found on the Phusion Passenger website, but are found in the following places:</p></div>
1492
- <div class="ulist"><ul>
1495
+ <div class="ulist"><ul>
1493
1496
  <li>
1494
1497
  <p>
1495
1498
  All versions starting from 4.0.0 can be found on <a href="https://code.google.com/p/phusion-passenger/downloads/list">Google Code</a>.
@@ -1764,7 +1767,7 @@ sudo apt-get update</pre>
1764
1767
  <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-b17h8g" data-anchor="_upgrading_from_open_source_to_enterprise">2.6. Upgrading from open source to Enterprise</h3>
1765
1768
  <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>
1766
1769
  <div class="paragraph"><p>Customers who have bought Phusion Passenger Enterprise can upgrade their open source installation to Enterprise as follows:</p></div>
1767
- <div class="olist arabic"><ol class="arabic">
1770
+ <div class="olist arabic"><ol class="arabic">
1768
1771
  <li>
1769
1772
  <p>
1770
1773
  <a href="#uninstalling">Uninstall the open source Phusion Passenger</a>.
@@ -1900,7 +1903,7 @@ export CXX='ccache clang++ -fcolor-diagnostics -Qunused-arguments -fcatch-undefi
1900
1903
  <div class="sect3">
1901
1904
  <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-wzu0ey" data-anchor="_adding_additional_compiler_or_linker_flags">2.9.2. Adding additional compiler or linker flags</h4>
1902
1905
  <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>
1903
- <div class="dlist"><dl>
1906
+ <div class="dlist"><dl>
1904
1907
  <dt class="hdlist1">
1905
1908
  <span class="monospaced">EXTRA_PRE_CFLAGS</span>
1906
1909
  </dt>
@@ -1955,7 +1958,7 @@ export CXX='ccache clang++ -fcolor-diagnostics -Qunused-arguments -fcatch-undefi
1955
1958
  <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_certain_command_line_tools"></span><h4 data-comment-topic="forcing-location-of-certain-command-line-tools-1hym30u" data-anchor="_forcing_location_of_certain_command_line_tools">2.9.3. Forcing location of certain command line tools</h4>
1956
1959
  <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>
1957
1960
  <div class="paragraph"><p>You can often force the build to find certain command line tools at certain locations by using the following environment variables:</p></div>
1958
- <div class="dlist"><dl>
1961
+ <div class="dlist"><dl>
1959
1962
  <dt class="hdlist1">
1960
1963
  <span class="monospaced">HTTPD</span>
1961
1964
  </dt>
@@ -2012,7 +2015,7 @@ export CXX='ccache clang++ -fcolor-diagnostics -Qunused-arguments -fcatch-undefi
2012
2015
  <div class="paragraph"><p>On most systems the Apache configuration file is located in either <em>/etc/apache2/httpd.conf</em> or <em>/etc/apache2/apache2.conf</em>. However, to allow better organization, many operating systems and Apache distributions also read configuration files in the <em>conf.d</em>, <em>mods-enabled</em> and <em>sites-enabled</em> subdirectories.</p></div>
2013
2016
  <div class="paragraph"><p><em>mods-enabled</em> contains symlinks to files in <em>mods-available</em>. This latter subdirectory contains config files for all available modules, while <em>mods-enabled</em> contains only a subset, namely the modules that should actually be enabled. The symlinks are created using the <span class="monospaced">a2enmod</span> tool. <em><strong>.load</strong></em> files contain <span class="monospaced">LoadModule</span> directives, while <em>.conf</em> files contain all other configuration directives.</p></div>
2014
2017
  <div class="paragraph"><p>Use <em>mods-enabled</em>/<em>mods-available</em> to store Phusion Passenger configuration if you can:</p></div>
2015
- <div class="ulist"><ul>
2018
+ <div class="ulist"><ul>
2016
2019
  <li>
2017
2020
  <p>
2018
2021
  Create <em>/etc/apache2/mods-available/passenger.load</em> and paste the <span class="monospaced">LoadModule ...</span> directive that <span class="monospaced">passenger-install-apache2-module</span> outputs.
@@ -2044,7 +2047,7 @@ Phusion Passenger will not occupy any memory or CPU or otherwise interfere with
2044
2047
  the web server.</p></div>
2045
2048
  <div class="paragraph"><p>To unload Phusion Passenger from the web server, edit your Apache configuration file(s)
2046
2049
  and comment out:</p></div>
2047
- <div class="ulist"><ul>
2050
+ <div class="ulist"><ul>
2048
2051
  <li>
2049
2052
  <p>
2050
2053
  all Phusion Passenger configuration directives.
@@ -2103,7 +2106,7 @@ NameVirtualHosts *:80
2103
2106
  <div class="paragraph"><p>To uninstall Phusion Passenger, please first remove all Phusion Passenger
2104
2107
  configuration directives from your web server configuration file(s). After you’ve
2105
2108
  done this, you need to remove the Phusion Passenger files.</p></div>
2106
- <div class="ulist"><ul>
2109
+ <div class="ulist"><ul>
2107
2110
  <li>
2108
2111
  <p>
2109
2112
  If you installed Phusion Passenger via a Ruby gem, then run <span class="monospaced">gem uninstall passenger</span> (or, if you’re an <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a> user, <span class="monospaced">gem uninstall passenger-enterprise-server</span>).
@@ -2153,20 +2156,20 @@ virtual host’s root (i.e. the application will be accessible from the root URL
2153
2156
  <em>http://www.mycook.com/</em>), or in a sub URI (i.e. the application will be
2154
2157
  accessible from a sub URL, such as <em>http://www.mycook.com/railsapplication</em>).</p></div>
2155
2158
  <div class="admonitionblock">
2156
- <table><tr>
2159
+ <table><tr>
2157
2160
  <td class="icon">
2158
- <img src="./images/icons/note.png" alt="Note">
2161
+ <img src="./images/icons/note.png" alt="Note">
2159
2162
  </td>
2160
2163
  <td class="content">The default <span class="monospaced">RAILS_ENV</span> environment in which deployed Rails applications
2161
2164
  are run, is “production”. You can change this by changing the
2162
2165
  <a href="#rails_env"><em>RailsEnv</em></a> configuration option.</td>
2163
- </tr></table>
2166
+ </tr></table>
2164
2167
  </div>
2165
2168
  <div class="sect2">
2166
2169
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_deploying_to_a_virtual_host_8217_s_root"></span><h3 data-comment-topic="deploying-to-a-virtual-host-s-root-ab4zj6" data-anchor="_deploying_to_a_virtual_host_8217_s_root">3.1. Deploying to a virtual host’s root</h3>
2167
2170
  <div class="paragraph"><p>Add a virtual host entry to your Apache configuration file. Make sure that the
2168
2171
  following conditions are met:</p></div>
2169
- <div class="ulist"><ul>
2172
+ <div class="ulist"><ul>
2170
2173
  <li>
2171
2174
  <p>
2172
2175
  The virtual host’s document root must point to your Ruby on Rails application’s
@@ -2199,7 +2202,7 @@ MultiViews must be disabled for this folder.
2199
2202
  </div>
2200
2203
  <div class="paragraph"><p>You may also need to tweak your file/folder permissions. Make sure that the
2201
2204
  following folders are readable and executable by Apache:</p></div>
2202
- <div class="ulist"><ul>
2205
+ <div class="ulist"><ul>
2203
2206
  <li>
2204
2207
  <p>
2205
2208
  this <em>public</em> folder.
@@ -2243,7 +2246,7 @@ point to your Ruby on Rails application’s <em>public</em> folder. For example:
2243
2246
  </div>
2244
2247
  <div class="paragraph"><p>Next, add a <a href="#RailsBaseURI">RailsBaseURI</a> option to the virtual host configuration,
2245
2248
  and also make sure that:</p></div>
2246
- <div class="ulist"><ul>
2249
+ <div class="ulist"><ul>
2247
2250
  <li>
2248
2251
  <p>
2249
2252
  The Apache per-directory permissions allow access to this folder.
@@ -2274,21 +2277,21 @@ MultiViews is disabled for this folder.
2274
2277
  </div>
2275
2278
  <div class="paragraph"><p>Then restart Apache. The application has now been deployed.</p></div>
2276
2279
  <div class="admonitionblock">
2277
- <table><tr>
2280
+ <table><tr>
2278
2281
  <td class="icon">
2279
- <img src="./images/icons/note.png" alt="Note">
2282
+ <img src="./images/icons/note.png" alt="Note">
2280
2283
  </td>
2281
2284
  <td class="content">If you’re deploying to a sub-URI then please make sure that your view
2282
2285
  templates correctly handles references to sub-URI static assets! Otherwise
2283
2286
  you may find broken links to images, CSS files, JavaScripts, etc. Please read
2284
2287
  <a href="#sub_uri_deployment_uri_fix">How to fix broken images/CSS/JavaScript URIs in sub-URI deployments</a>
2285
2288
  for more information.</td>
2286
- </tr></table>
2289
+ </tr></table>
2287
2290
  </div>
2288
2291
  <div class="admonitionblock">
2289
- <table><tr>
2292
+ <table><tr>
2290
2293
  <td class="icon">
2291
- <img src="./images/icons/tip.png" alt="Tip">
2294
+ <img src="./images/icons/tip.png" alt="Tip">
2292
2295
  </td>
2293
2296
  <td class="content">
2294
2297
  <div class="paragraph"><p>You can deploy multiple Rails applications under a virtual host, by specifying
@@ -2304,7 +2307,7 @@ for more information.</td>
2304
2307
  </div>
2305
2308
  </div>
2306
2309
  </td>
2307
- </tr></table>
2310
+ </tr></table>
2308
2311
  </div>
2309
2312
  </div>
2310
2313
  <div class="sect2">
@@ -2312,7 +2315,7 @@ for more information.</td>
2312
2315
  <div class="paragraph"><p>Deploying a new version of a Ruby on Rails application is as simple as
2313
2316
  re-uploading the application files, and restarting the application.</p></div>
2314
2317
  <div class="paragraph"><p>There are two ways to restart the application:</p></div>
2315
- <div class="olist arabic"><ol class="arabic">
2318
+ <div class="olist arabic"><ol class="arabic">
2316
2319
  <li>
2317
2320
  <p>
2318
2321
  By restarting Apache.
@@ -2359,7 +2362,7 @@ a shell console, just like one would normally run migrations.</p></div>
2359
2362
  <div class="paragraph"><p>Phusion Passenger assumes that Rack application directories have a certain layout.
2360
2363
  Suppose that you have a Rack application in <em>/webapps/rackapp</em>. Then that
2361
2364
  folder must contain at least three entries:</p></div>
2362
- <div class="ulist"><ul>
2365
+ <div class="ulist"><ul>
2363
2366
  <li>
2364
2367
  <p>
2365
2368
  <em>config.ru</em>, a Rackup file for starting the Rack application. This file must contain
@@ -2395,14 +2398,14 @@ to the virtual host’s root (i.e. the application will be accessible from the r
2395
2398
  <em>http://www.rackapp.com/</em>), or in a sub URI (i.e. the application will be
2396
2399
  accessible from a sub URL, such as <em>http://www.rackapp.com/rackapp</em>).</p></div>
2397
2400
  <div class="admonitionblock">
2398
- <table><tr>
2401
+ <table><tr>
2399
2402
  <td class="icon">
2400
- <img src="./images/icons/note.png" alt="Note">
2403
+ <img src="./images/icons/note.png" alt="Note">
2401
2404
  </td>
2402
2405
  <td class="content">The default <span class="monospaced">RACK_ENV</span> environment in which deployed Rack applications
2403
2406
  are run, is “production”. You can change this by changing the
2404
2407
  <a href="#rack_env"><em>RackEnv</em></a> configuration option.</td>
2405
- </tr></table>
2408
+ </tr></table>
2406
2409
  </div>
2407
2410
  <div class="sect2">
2408
2411
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_tutorial_example_writing_and_deploying_a_hello_world_rack_application"></span><h3 data-comment-topic="tutorial-example-writing-and-deploying-a-hello-world-rack-application-axp5z5" data-anchor="_tutorial_example_writing_and_deploying_a_hello_world_rack_application">4.1. Tutorial/example: writing and deploying a Hello World Rack application</h3>
@@ -2448,7 +2451,7 @@ under the URL <em>http://www.rackexample.com/</em>.</p></div>
2448
2451
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_deploying_to_a_virtual_host_8217_s_root_2"></span><h3 data-comment-topic="deploying-to-a-virtual-host-s-root-u9bfax" data-anchor="_deploying_to_a_virtual_host_8217_s_root_2">4.2. Deploying to a virtual host’s root</h3>
2449
2452
  <div class="paragraph"><p>Add a virtual host entry to your Apache configuration file. Make sure that the
2450
2453
  following conditions are met:</p></div>
2451
- <div class="ulist"><ul>
2454
+ <div class="ulist"><ul>
2452
2455
  <li>
2453
2456
  <p>
2454
2457
  The virtual host’s document root must point to your Rack application’s
@@ -2481,7 +2484,7 @@ MultiViews must be disabled for this folder.
2481
2484
  </div>
2482
2485
  <div class="paragraph"><p>You may also need to tweak your file/folder permissions. Make sure that the
2483
2486
  following folders are readable and executable by Apache:</p></div>
2484
- <div class="ulist"><ul>
2487
+ <div class="ulist"><ul>
2485
2488
  <li>
2486
2489
  <p>
2487
2490
  this <em>public</em> folder.
@@ -2525,7 +2528,7 @@ point to your Rack application’s <em>public</em> folder. For example:</p></div
2525
2528
  </div>
2526
2529
  <div class="paragraph"><p>Next, add a <a href="#RackBaseURI">RackBaseURI</a> option to the virtual host configuration,
2527
2530
  and also make sure that:</p></div>
2528
- <div class="ulist"><ul>
2531
+ <div class="ulist"><ul>
2529
2532
  <li>
2530
2533
  <p>
2531
2534
  The Apache per-directory permissions allow access to this folder.
@@ -2556,9 +2559,9 @@ MultiViews is disabled for this folder.
2556
2559
  </div>
2557
2560
  <div class="paragraph"><p>Then restart Apache. The application has now been deployed.</p></div>
2558
2561
  <div class="admonitionblock">
2559
- <table><tr>
2562
+ <table><tr>
2560
2563
  <td class="icon">
2561
- <img src="./images/icons/tip.png" alt="Tip">
2564
+ <img src="./images/icons/tip.png" alt="Tip">
2562
2565
  </td>
2563
2566
  <td class="content">
2564
2567
  <div class="paragraph"><p>You can deploy multiple Rack applications under a virtual host, by specifying
@@ -2574,7 +2577,7 @@ MultiViews is disabled for this folder.
2574
2577
  </div>
2575
2578
  </div>
2576
2579
  </td>
2577
- </tr></table>
2580
+ </tr></table>
2578
2581
  </div>
2579
2582
  </div>
2580
2583
  <div class="sect2">
@@ -2582,7 +2585,7 @@ MultiViews is disabled for this folder.
2582
2585
  <div class="paragraph"><p>Deploying a new version of a Rack application is as simple as
2583
2586
  re-uploading the application files, and restarting the application.</p></div>
2584
2587
  <div class="paragraph"><p>There are two ways to restart the application:</p></div>
2585
- <div class="olist arabic"><ol class="arabic">
2588
+ <div class="olist arabic"><ol class="arabic">
2586
2589
  <li>
2587
2590
  <p>
2588
2591
  By restarting Apache.
@@ -2705,7 +2708,7 @@ run Sinatra::Application</pre>
2705
2708
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_deploying_a_wsgi_python_application"></span><h2 data-comment-topic="deploying-a-wsgi-python-application-7aygdl" data-anchor="_deploying_a_wsgi_python_application">5. Deploying a WSGI (Python) application</h2>
2706
2709
  <div class="sectionbody">
2707
2710
  <div class="paragraph"><p>Phusion Passenger supports all WSGI-compliant Python web applications. Suppose that you have a WSGI application in <em>/webapps/wsgiapp</em>. Then that folder must contain at least three entries:</p></div>
2708
- <div class="ulist"><ul>
2711
+ <div class="ulist"><ul>
2709
2712
  <li>
2710
2713
  <p>
2711
2714
  <em>passenger_wsgi.py</em>, which Phusion Passenger will use as the main entry point for your application. This file must export a WSGI object called <span class="monospaced">application</span>.
@@ -2777,7 +2780,7 @@ under the URL <em>http://www.wsgiexample.com/</em>.</p></div>
2777
2780
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_deploying_to_a_virtual_host_8217_s_root_3"></span><h3 data-comment-topic="deploying-to-a-virtual-host-s-root-zzo4v7" data-anchor="_deploying_to_a_virtual_host_8217_s_root_3">5.2. Deploying to a virtual host’s root</h3>
2778
2781
  <div class="paragraph"><p>Add a virtual host entry to your Apache configuration file. Make sure that the
2779
2782
  following conditions are met:</p></div>
2780
- <div class="ulist"><ul>
2783
+ <div class="ulist"><ul>
2781
2784
  <li>
2782
2785
  <p>
2783
2786
  The virtual host’s document root must point to your WSGI application’s
@@ -2810,7 +2813,7 @@ MultiViews must be disabled for this folder.
2810
2813
  </div>
2811
2814
  <div class="paragraph"><p>You may also need to tweak your file/folder permissions. Make sure that the
2812
2815
  following folders are readable and executable by Apache:</p></div>
2813
- <div class="ulist"><ul>
2816
+ <div class="ulist"><ul>
2814
2817
  <li>
2815
2818
  <p>
2816
2819
  this <em>public</em> folder.
@@ -2834,7 +2837,7 @@ all parent folders. That is, /webapps/wsgiapp and /webapps must also be readable
2834
2837
  <div class="paragraph"><p>Deploying a new version of a WSGI application is as simple as
2835
2838
  re-uploading the application files, and restarting the application.</p></div>
2836
2839
  <div class="paragraph"><p>There are two ways to restart the application:</p></div>
2837
- <div class="olist arabic"><ol class="arabic">
2840
+ <div class="olist arabic"><ol class="arabic">
2838
2841
  <li>
2839
2842
  <p>
2840
2843
  By restarting Apache.
@@ -2885,7 +2888,7 @@ this option as well. Please read
2885
2888
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerRuby"></span><h3 data-comment-topic="passengerruby-filename--1r3fv73" data-anchor="PassengerRuby">6.3. PassengerRuby &lt;filename&gt;</h3>
2886
2889
  <div class="paragraph"><p>The <span class="monospaced">PassengerDefaultRuby</span> and <span class="monospaced">PassengerRuby</span> directives specify the Ruby interpreter to use. Similarly, the <span class="monospaced">PassengerPython</span> directive is for specifying the Python interpreter.</p></div>
2887
2890
  <div class="paragraph"><p>The relationship between <span class="monospaced">PassengerDefaultRuby</span> and <span class="monospaced">PassengerRuby</span> is as follows:</p></div>
2888
- <div class="ulist"><ul>
2891
+ <div class="ulist"><ul>
2889
2892
  <li>
2890
2893
  <p>
2891
2894
  <span class="monospaced">PassengerDefaultRuby</span> may only occur in the global server configuration.
@@ -3012,7 +3015,7 @@ is the parent directory of the <em>public</em> directory. This option allows one
3012
3015
  specify the application’s root independently from the DocumentRoot, which
3013
3016
  is useful if the <em>public</em> directory lives in a non-standard place.</p></div>
3014
3017
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3015
- <div class="ulist"><ul>
3018
+ <div class="ulist"><ul>
3016
3019
  <li>
3017
3020
  <p>
3018
3021
  In the global server configuration.
@@ -3050,9 +3053,9 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
3050
3053
  <div class="sect2">
3051
3054
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerSpawnMethod"></span><h3 data-comment-topic="passengerspawnmethod-string--sodg2y" data-anchor="PassengerSpawnMethod">6.6. PassengerSpawnMethod &lt;string&gt;</h3>
3052
3055
  <div class="admonitionblock">
3053
- <table><tr>
3056
+ <table><tr>
3054
3057
  <td class="icon">
3055
- <img src="./images/icons/tip.png" alt="Tip">
3058
+ <img src="./images/icons/tip.png" alt="Tip">
3056
3059
  </td>
3057
3060
  <td class="content">
3058
3061
  <div class="title">"What spawn method should I use?"</div>
@@ -3067,12 +3070,12 @@ understand it, as it’s mostly a technical detail. You can basically follow thi
3067
3070
  <div class="paragraph"><p>However, we do recommend you to try to understand it. The <em>smart</em> and <em>smart-lv2</em> spawn
3068
3071
  methods bring many benefits.</p></div>
3069
3072
  </td>
3070
- </tr></table>
3073
+ </tr></table>
3071
3074
  </div>
3072
3075
  <div class="paragraph"><p>Internally, Phusion Passenger spawns multiple Ruby application processes in order to handle
3073
3076
  requests. But there are multiple ways with which processes can be spawned, each having
3074
3077
  its own set of pros and cons. Supported spawn methods are:</p></div>
3075
- <div class="dlist"><dl>
3078
+ <div class="dlist"><dl>
3076
3079
  <dt class="hdlist1">
3077
3080
  <em>smart</em>
3078
3081
  </dt>
@@ -3116,7 +3119,7 @@ to <em>smart</em>. The old <em>smart</em> spawning has been removed in favor of
3116
3119
  </div>
3117
3120
  </div>
3118
3121
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3119
- <div class="ulist"><ul>
3122
+ <div class="ulist"><ul>
3120
3123
  <li>
3121
3124
  <p>
3122
3125
  In the global server configuration.
@@ -3153,7 +3156,7 @@ follows:</p></div>
3153
3156
  </div>
3154
3157
  <div class="paragraph"><p>This way, Phusion Passenger will not interfere with Wordpress.</p></div>
3155
3158
  <div class="paragraph"><p><em>PassengerEnabled</em> may occur in the following places:</p></div>
3156
- <div class="ulist"><ul>
3159
+ <div class="ulist"><ul>
3157
3160
  <li>
3158
3161
  <p>
3159
3162
  In the global server configuration.
@@ -3225,7 +3228,7 @@ Apache worker processes as different users. So if you’re using apace2-mpm-itk,
3225
3228
  you should set this option to a directory that is writable by all Apache worker
3226
3229
  processes, such as <em>/tmp</em>.</p></div>
3227
3230
  <div class="paragraph"><p>You may specify <em>PassengerUploadBufferDir</em> in the following places:</p></div>
3228
- <div class="ulist"><ul>
3231
+ <div class="ulist"><ul>
3229
3232
  <li>
3230
3233
  <p>
3231
3234
  In the global server configuration.
@@ -3258,7 +3261,7 @@ may be desirable for Phusion Passenger to look in a different directory instead,
3258
3261
  for example for security reasons (see below). This option allows you to
3259
3262
  customize the directory in which <em>restart.txt</em> is searched for.</p></div>
3260
3263
  <div class="paragraph"><p>You may specify <em>PassengerRestartDir</em> in the following places:</p></div>
3261
- <div class="ulist"><ul>
3264
+ <div class="ulist"><ul>
3262
3265
  <li>
3263
3266
  <p>
3264
3267
  In the global server configuration.
@@ -3328,7 +3331,7 @@ directory that’s readable by Apache, but only writable by administrators.</p><
3328
3331
  <div class="paragraph"><p>When turned on, application-generated responses are buffered by Apache. Buffering will
3329
3332
  happen in memory.</p></div>
3330
3333
  <div class="paragraph"><p>Before we proceed with explaining this configuration option, we want to state the following to avoid confusion. If you use Phusion Passenger for Apache, there are in fact two response buffering systems active:</p></div>
3331
- <div class="olist arabic"><ol class="arabic">
3334
+ <div class="olist arabic"><ol class="arabic">
3332
3335
  <li>
3333
3336
  <p>
3334
3337
  The Apache response buffering system. <span class="monospaced">PassengerBufferResponse</span> turns this on or off.
@@ -3389,7 +3392,7 @@ after which it receives the entire response at once.
3389
3392
  When <span class="monospaced">PassengerBufferResponse</span> is turned off, it works as expected: the client
3390
3393
  receives an "entry X" message every second for 10 seconds.</p></div>
3391
3394
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3392
- <div class="ulist"><ul>
3395
+ <div class="ulist"><ul>
3393
3396
  <li>
3394
3397
  <p>
3395
3398
  In the global server configuration.
@@ -3413,15 +3416,15 @@ In <em>.htaccess</em>.
3413
3416
  </ul></div>
3414
3417
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>off</em>.</p></div>
3415
3418
  <div class="admonitionblock">
3416
- <table><tr>
3419
+ <table><tr>
3417
3420
  <td class="icon">
3418
- <img src="./images/icons/note.png" alt="Note">
3421
+ <img src="./images/icons/note.png" alt="Note">
3419
3422
  </td>
3420
3423
  <td class="content">
3421
3424
  <div class="paragraph"><p>The <a href="#PassengerBufferResponse">PassengerBufferResponse</a> directive should be turned off
3422
3425
  if responses can be huge. Because entire responses are buffered in memory when turned on.</p></div>
3423
3426
  </td>
3424
- </tr></table>
3427
+ </tr></table>
3425
3428
  </div>
3426
3429
  </div>
3427
3430
  <div class="sect2">
@@ -3434,7 +3437,7 @@ of a new application process could take a while, and any requests that
3434
3437
  come in during this time will be blocked until this first application
3435
3438
  process has spawned.</p></div>
3436
3439
  <div class="paragraph"><p>But when rolling restarts are enabled, Phusion Passenger Enterprise will:</p></div>
3437
- <div class="olist arabic"><ol class="arabic">
3440
+ <div class="olist arabic"><ol class="arabic">
3438
3441
  <li>
3439
3442
  <p>
3440
3443
  Spawn a new process in the background.
@@ -3453,7 +3456,7 @@ Step 1 and 2 are repeated until all processes have been replaced.
3453
3456
  </ol></div>
3454
3457
  <div class="paragraph"><p>This way, visitors will not experience any delays when you are restarting your application. This allows you to, for example, upgrade your application often without degrading user experience.</p></div>
3455
3458
  <div class="paragraph"><p>Rolling restarts have a few caveat however that you should be aware of:</p></div>
3456
- <div class="ulist"><ul>
3459
+ <div class="ulist"><ul>
3457
3460
  <li>
3458
3461
  <p>
3459
3462
  Upgrading an application sometimes involves upgrading the database schema.
@@ -3473,7 +3476,7 @@ Because there’s no telling which process will serve a request, users may
3473
3476
  </li>
3474
3477
  </ul></div>
3475
3478
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3476
- <div class="ulist"><ul>
3479
+ <div class="ulist"><ul>
3477
3480
  <li>
3478
3481
  <p>
3479
3482
  In the global server configuration.
@@ -3503,7 +3506,7 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
3503
3506
  <div class="paragraph"><p>Enables or disables resistance against deployment errors.</p></div>
3504
3507
  <div class="paragraph"><p>Suppose you’ve upgraded your application and you’ve issues a command to restart it (by touching restart.txt), but the application code contains an error that prevents Phusion Passenger from successfully spawning a process (e.g. a syntax error). Phusion Passenger would normally display an error message in response to this.</p></div>
3505
3508
  <div class="paragraph"><p>By enabling deployment error resistance, Phusion Passenger Enterprise would instead do this:</p></div>
3506
- <div class="ulist"><ul>
3509
+ <div class="ulist"><ul>
3507
3510
  <li>
3508
3511
  <p>
3509
3512
  It passes the request to one of the existing application processes (that belong to the previous version of the application). The visitor will not see a Phusion Passenger process spawning error message.
@@ -3523,7 +3526,7 @@ It sets an internal flag so that no processes for this application will be spawn
3523
3526
  <div class="paragraph"><p>This way, visitors will suffer minimally from deployment errors. Phusion Passenger will attempt to restart the application again next time restart.txt is touched.</p></div>
3524
3527
  <div class="paragraph"><p>Enabling deployment error resistance only works if <a href="#PassengerRollingRestarts">rolling restart</a> is also enabled.</p></div>
3525
3528
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3526
- <div class="ulist"><ul>
3529
+ <div class="ulist"><ul>
3527
3530
  <li>
3528
3531
  <p>
3529
3532
  In the global server configuration.
@@ -3563,7 +3566,7 @@ by default run the web application as the owner of the file <em>config/environme
3563
3566
  that behavior and explicitly set a user to run the web application as, regardless
3564
3567
  of the ownership of <em>environment.rb</em>/<em>config.ru</em>.</p></div>
3565
3568
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3566
- <div class="ulist"><ul>
3569
+ <div class="ulist"><ul>
3567
3570
  <li>
3568
3571
  <p>
3569
3572
  In the global server configuration.
@@ -3592,7 +3595,7 @@ as, regardless of the ownership of <em>environment.rb</em>/<em>config.ru</em>.</
3592
3595
  <div class="paragraph"><p><em>&lt;group name&gt;</em> may also be set to the special value <em>!STARTUP_FILE!</em>, in which case
3593
3596
  the web application’s group will be set to <em>environment.rb</em>/<em>config.ru</em>'s group.</p></div>
3594
3597
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3595
- <div class="ulist"><ul>
3598
+ <div class="ulist"><ul>
3596
3599
  <li>
3597
3600
  <p>
3598
3601
  In the global server configuration.
@@ -3638,7 +3641,7 @@ but the page might reveal potentially sensitive information, depending on the
3638
3641
  application. Experienced system administrators who are using Phusion Passenger
3639
3642
  on serious production servers should consider turning this feature off.</p></div>
3640
3643
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3641
- <div class="ulist"><ul>
3644
+ <div class="ulist"><ul>
3642
3645
  <li>
3643
3646
  <p>
3644
3647
  In the global server configuration.
@@ -3683,7 +3686,7 @@ non-zero value if you want to avoid potentially long startup times after a websi
3683
3686
  has been <a href="#idle_process">idle</a> for an extended period.</p></div>
3684
3687
  <div class="paragraph"><p>Please note that this option does <strong>not</strong> pre-start application processes during Apache
3685
3688
  startup. It just makes sure that when the application is first accessed:</p></div>
3686
- <div class="olist arabic"><ol class="arabic">
3689
+ <div class="olist arabic"><ol class="arabic">
3687
3690
  <li>
3688
3691
  <p>
3689
3692
  at least the given number of processes will be spawned.
@@ -3722,7 +3725,7 @@ simultanously. Phusion Passenger will start 12 more application processes. After
3722
3725
  timeout of 10 seconds have passed, Phusion Passenger will clean up 12 application
3723
3726
  processes, keeping 3 processes around.</p></div>
3724
3727
  <div class="paragraph"><p>The PassengerMinInstances option may occur in the following places:</p></div>
3725
- <div class="ulist"><ul>
3728
+ <div class="ulist"><ul>
3726
3729
  <li>
3727
3730
  <p>
3728
3731
  In the global server configuration.
@@ -3757,7 +3760,7 @@ means that there is no limit placed on the number of processes a single applicat
3757
3760
  may spawn, i.e. only the global limit of <a href="#PassengerMaxPoolSize">PassengerMaxPoolSize</a>
3758
3761
  will be enforced.</p></div>
3759
3762
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3760
- <div class="ulist"><ul>
3763
+ <div class="ulist"><ul>
3761
3764
  <li>
3762
3765
  <p>
3763
3766
  In the global server configuration.
@@ -3771,9 +3774,9 @@ In a virtual host configuration block.
3771
3774
  </ul></div>
3772
3775
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>0</em>.</p></div>
3773
3776
  <div class="admonitionblock">
3774
- <table><tr>
3777
+ <table><tr>
3775
3778
  <td class="icon">
3776
- <img src="./images/icons/tip.png" alt="Tip">
3779
+ <img src="./images/icons/tip.png" alt="Tip">
3777
3780
  </td>
3778
3781
  <td class="content">
3779
3782
  <div class="title">Practical usage example</div>
@@ -3784,7 +3787,7 @@ to 10. The e-commerce website is more important to you. You can then set
3784
3787
  than 3 processes, even if it suddenly gets a lot of traffic. Your e-commerce website
3785
3788
  on the other hand will be free to spawn up to 10 processes if it gets a lot of traffic.</p></div>
3786
3789
  </td>
3787
- </tr></table>
3790
+ </tr></table>
3788
3791
  </div>
3789
3792
  </div>
3790
3793
  <div class="sect3">
@@ -3799,9 +3802,9 @@ will be enforced.</p></div>
3799
3802
  <div class="paragraph"><p>This option may only occur once, in the global server configuration.
3800
3803
  The default value is <em>0</em>.</p></div>
3801
3804
  <div class="admonitionblock">
3802
- <table><tr>
3805
+ <table><tr>
3803
3806
  <td class="icon">
3804
- <img src="./images/icons/tip.png" alt="Tip">
3807
+ <img src="./images/icons/tip.png" alt="Tip">
3805
3808
  </td>
3806
3809
  <td class="content">
3807
3810
  <div class="title">Practical usage example</div>
@@ -3815,12 +3818,12 @@ settled down and it has released more pool slots.</p></div>
3815
3818
  <em>PassengerMaxInstancesPerApp</em> to 5. This way, both blogs will never use more
3816
3819
  than 5 pool slots.</p></div>
3817
3820
  </td>
3818
- </tr></table>
3821
+ </tr></table>
3819
3822
  </div>
3820
3823
  <div class="admonitionblock">
3821
- <table><tr>
3824
+ <table><tr>
3822
3825
  <td class="icon">
3823
- <img src="./images/icons/note.png" alt="Note">
3826
+ <img src="./images/icons/note.png" alt="Note">
3824
3827
  </td>
3825
3828
  <td class="content">
3826
3829
  <div class="title">Relation with PassengerMaxInstances</div>
@@ -3837,7 +3840,7 @@ on the other hand will be free to use up all 10 slots if it gets a lot of traffi
3837
3840
  different web applications, while <em>PassengerMaxInstances</em> allows one to divide
3838
3841
  the pool unequally, according to each web application’s relative importance.</p></div>
3839
3842
  </td>
3840
- </tr></table>
3843
+ </tr></table>
3841
3844
  </div>
3842
3845
  </div>
3843
3846
  <div class="sect3">
@@ -3877,7 +3880,7 @@ you’re using the <em>smart</em> or <em>smart-lv2</em> <a href="#PassengerSpawn
3877
3880
  system has enough memory, is it recommended that you set this option to a high
3878
3881
  value or to <em>0</em>.</p></div>
3879
3882
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3880
- <div class="ulist"><ul>
3883
+ <div class="ulist"><ul>
3881
3884
  <li>
3882
3885
  <p>
3883
3886
  In the global server configuration.
@@ -3895,7 +3898,7 @@ In a virtual host configuration block.
3895
3898
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerConcurrencyModel"></span><h4 data-comment-topic="passengerconcurrencymodel-process-thread--1eipofj" data-anchor="PassengerConcurrencyModel">6.15.7. PassengerConcurrencyModel &lt;process|thread&gt;</h4>
3896
3899
  <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 4.0.0. <a href="https://www.phusionpassenger.com/download">Buy Phusion Passenger Enterprise here.</a></strong></p></div>
3897
3900
  <div class="paragraph"><p>Specifies the I/O concurrency model that should be used for application processes. Phusion Passenger supports two concurrency models:</p></div>
3898
- <div class="ulist"><ul>
3901
+ <div class="ulist"><ul>
3899
3902
  <li>
3900
3903
  <p>
3901
3904
  <em>process</em> - single-threaded, multi-processed I/O concurrency. Each application process only has a single thread and can only handle 1 request at a time. This is the concurrency model that Ruby applications traditionally used. It has excellent compatiblity (can work with applications that are not designed to be thread-safe) but is unsuitable workloads in which the application has to wait for a lot of external I/O (e.g. HTTP API calls), and uses more memory because each process has a large memory overhead.
@@ -3908,7 +3911,7 @@ In a virtual host configuration block.
3908
3911
  </li>
3909
3912
  </ul></div>
3910
3913
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3911
- <div class="ulist"><ul>
3914
+ <div class="ulist"><ul>
3912
3915
  <li>
3913
3916
  <p>
3914
3917
  In the global server configuration.
@@ -3937,7 +3940,7 @@ In <em>.htaccess</em>.
3937
3940
  <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 4.0.0. <a href="https://www.phusionpassenger.com/download">Buy Phusion Passenger Enterprise here.</a></strong></p></div>
3938
3941
  <div class="paragraph"><p>Specifies the number of threads that Phusion Passenger should spawn per application process. This option only has effect if <a href="#PassengerConcurrencyModel">PassengerConcurrencyModel</a> is <em>thread</em>.</p></div>
3939
3942
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3940
- <div class="ulist"><ul>
3943
+ <div class="ulist"><ul>
3941
3944
  <li>
3942
3945
  <p>
3943
3946
  In the global server configuration.
@@ -3972,7 +3975,7 @@ reached.</p></div>
3972
3975
  it down after a certain number of requests, all of its memory is guaranteed
3973
3976
  to be freed by the operating system.</p></div>
3974
3977
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3975
- <div class="ulist"><ul>
3978
+ <div class="ulist"><ul>
3976
3979
  <li>
3977
3980
  <p>
3978
3981
  In the global server configuration.
@@ -3996,9 +3999,9 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Limits</span> i
3996
3999
  </ul></div>
3997
4000
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>0</em>.</p></div>
3998
4001
  <div class="admonitionblock">
3999
- <table><tr>
4002
+ <table><tr>
4000
4003
  <td class="icon">
4001
- <img src="./images/icons/caution.png" alt="Caution">
4004
+ <img src="./images/icons/caution.png" alt="Caution">
4002
4005
  </td>
4003
4006
  <td class="content">
4004
4007
  <div class="paragraph"><p>The <a href="#PassengerMaxRequests">PassengerMaxRequests</a> directive should be considered
@@ -4006,7 +4009,7 @@ as a workaround for misbehaving applications. It is advised that you fix the
4006
4009
  problem in your application rather than relying on these directives as a
4007
4010
  measure to avoid memory leaks.</p></div>
4008
4011
  </td>
4009
- </tr></table>
4012
+ </tr></table>
4010
4013
  </div>
4011
4014
  </div>
4012
4015
  <div class="sect3">
@@ -4019,7 +4022,7 @@ restarted upon the next request. A value of 0 means that there is no time limit.
4019
4022
  <div class="paragraph"><p>This option is useful for preventing your application from freezing for an
4020
4023
  indefinite period of time.</p></div>
4021
4024
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4022
- <div class="ulist"><ul>
4025
+ <div class="ulist"><ul>
4023
4026
  <li>
4024
4027
  <p>
4025
4028
  In the global server configuration.
@@ -4065,9 +4068,9 @@ to 10 seconds. You can then configure Phusion Passenger as follows:</p>
4065
4068
  or if a request to any other URI takes more than 2 seconds,
4066
4069
  then the corresponding application process will be forced to shutdown.</p></div>
4067
4070
  <div class="admonitionblock">
4068
- <table><tr>
4071
+ <table><tr>
4069
4072
  <td class="icon">
4070
- <img src="./images/icons/caution.png" alt="Caution">
4073
+ <img src="./images/icons/caution.png" alt="Caution">
4071
4074
  </td>
4072
4075
  <td class="content">
4073
4076
  <div class="paragraph"><p>The <a href="#PassengerMaxRequestTime">PassengerMaxRequestTime</a> directive should be
@@ -4075,7 +4078,7 @@ considered as a workaround for misbehaving applications. It is advised that you
4075
4078
  fix the problem in your application rather than relying on these directives as a
4076
4079
  measure to avoid freezing applications.</p></div>
4077
4080
  </td>
4078
- </tr></table>
4081
+ </tr></table>
4079
4082
  </div>
4080
4083
  </div>
4081
4084
  <div class="sect3">
@@ -4089,7 +4092,7 @@ will not be checked.</p></div>
4089
4092
  <div class="paragraph"><p>This option is useful if your application is leaking memory. By shutting
4090
4093
  it down, all of its memory is guaranteed to be freed by the operating system.</p></div>
4091
4094
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4092
- <div class="ulist"><ul>
4095
+ <div class="ulist"><ul>
4093
4096
  <li>
4094
4097
  <p>
4095
4098
  In the global server configuration.
@@ -4113,9 +4116,9 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Limits</span> i
4113
4116
  </ul></div>
4114
4117
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>0</em>.</p></div>
4115
4118
  <div class="admonitionblock">
4116
- <table><tr>
4119
+ <table><tr>
4117
4120
  <td class="icon">
4118
- <img src="./images/icons/note.png" alt="Note">
4121
+ <img src="./images/icons/note.png" alt="Note">
4119
4122
  </td>
4120
4123
  <td class="content">
4121
4124
  <div class="title">A word about permissions</div>
@@ -4126,12 +4129,12 @@ not obtainable through <span class="monospaced">ps</span>. You should ensure tha
4126
4129
  correctly and that the <span class="monospaced">/proc</span> filesystem is accessible by the
4127
4130
  <span class="monospaced">PassengerHelperAgent</span> process.</p></div>
4128
4131
  </td>
4129
- </tr></table>
4132
+ </tr></table>
4130
4133
  </div>
4131
4134
  <div class="admonitionblock">
4132
- <table><tr>
4135
+ <table><tr>
4133
4136
  <td class="icon">
4134
- <img src="./images/icons/caution.png" alt="Caution">
4137
+ <img src="./images/icons/caution.png" alt="Caution">
4135
4138
  </td>
4136
4139
  <td class="content">
4137
4140
  <div class="paragraph"><p>The <a href="#PassengerMaxRequests">PassengerMaxRequests</a> and
@@ -4140,14 +4143,14 @@ as workarounds for misbehaving applications. It is advised that you fix the
4140
4143
  problem in your application rather than relying on these directives as a
4141
4144
  measure to avoid memory leaks.</p></div>
4142
4145
  </td>
4143
- </tr></table>
4146
+ </tr></table>
4144
4147
  </div>
4145
4148
  </div>
4146
4149
  <div class="sect3">
4147
4150
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_passengerstatthrottlerate_lt_integer_gt"></span><h4 data-comment-topic="passengerstatthrottlerate-integer--1dcfda3" data-anchor="_passengerstatthrottlerate_lt_integer_gt">6.15.12. PassengerStatThrottleRate &lt;integer&gt;</h4>
4148
4151
  <div class="paragraph"><p>By default, Phusion Passenger performs several filesystem checks (or, in
4149
4152
  programmers jargon, <em>stat() calls</em>) each time a request is processed:</p></div>
4150
- <div class="ulist"><ul>
4153
+ <div class="ulist"><ul>
4151
4154
  <li>
4152
4155
  <p>
4153
4156
  It checks whether <em>config/environment.rb</em>, <em>config.ru</em> or <em>passenger_wsgi.py</em>
@@ -4171,7 +4174,7 @@ seconds. Setting it to a value of <em>0</em> means that no throttling will take
4171
4174
  or in other words, that the above list of filesystem checks will be performed on
4172
4175
  every request.</p></div>
4173
4176
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4174
- <div class="ulist"><ul>
4177
+ <div class="ulist"><ul>
4175
4178
  <li>
4176
4179
  <p>
4177
4180
  In the global server configuration.
@@ -4203,14 +4206,14 @@ web application might experience a small delay as Phusion Passenger is starting
4203
4206
  the web application on demand. If that is undesirable, then this directive can be
4204
4207
  used to pre-started application processes during Apache startup.</p></div>
4205
4208
  <div class="paragraph"><p>A few things to be careful of:</p></div>
4206
- <div class="ulist"><ul>
4209
+ <div class="ulist"><ul>
4207
4210
  <li>
4208
4211
  <p>
4209
4212
  This directive accepts the <strong>URL</strong> of the web application you want to pre-start,
4210
4213
  not a on/off value! This might seem a bit weird, but read on for rationale. As
4211
4214
  for the specifics of the URL:
4212
4215
  </p>
4213
- <div class="ulist"><ul>
4216
+ <div class="ulist"><ul>
4214
4217
  <li>
4215
4218
  <p>
4216
4219
  The domain part of the URL must be equal to the value of the <em>ServerName</em>
@@ -4241,7 +4244,7 @@ You will probably want to combine this option with
4241
4244
  </li>
4242
4245
  </ul></div>
4243
4246
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4244
- <div class="ulist"><ul>
4247
+ <div class="ulist"><ul>
4245
4248
  <li>
4246
4249
  <p>
4247
4250
  In the global server configuration.
@@ -4359,7 +4362,7 @@ PassengerPreStart http://bar.com:3500/</pre>
4359
4362
  <div class="paragraph"><p>A directive that accepts a simple on/off flag is definitely more intuitive,
4360
4363
  but due technical difficulties w.r.t. the way Apache works, it’s very hard
4361
4364
  to implement it like that:</p></div>
4362
- <div class="ulist"><ul>
4365
+ <div class="ulist"><ul>
4363
4366
  <li>
4364
4367
  <p>
4365
4368
  It is very hard to obtain a full list of web applications defined in the
@@ -4447,7 +4450,7 @@ performance mode via testing.</p></div>
4447
4450
  <div class="paragraph"><p>This option is <strong>not</strong> an all-or-nothing global option: you can enable high
4448
4451
  performance mode for certain virtual hosts or certain URLs only.
4449
4452
  The <em>PassengerHighPerformance</em> option may occur in the following places:</p></div>
4450
- <div class="ulist"><ul>
4453
+ <div class="ulist"><ul>
4451
4454
  <li>
4452
4455
  <p>
4453
4456
  In the global server configuration.
@@ -4524,7 +4527,7 @@ then you can enable high performance mode for a certain URL only. For example:</
4524
4527
  <div class="paragraph"><p>Configures whether Phusion Passenger should resolve symlinks in the document root.
4525
4528
  Please refer to <a href="#application_detection">How Phusion Passenger detects whether a virtual host is a web application</a> for more information.</p></div>
4526
4529
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4527
- <div class="ulist"><ul>
4530
+ <div class="ulist"><ul>
4528
4531
  <li>
4529
4532
  <p>
4530
4533
  In the global server configuration.
@@ -4558,7 +4561,7 @@ as well as Apache’s
4558
4561
  <div class="paragraph"><p>Is it important that you turn on both AllowEncodedSlashes <strong>and</strong> PassengerAllowEncodedSlashes,
4559
4562
  otherwise this feature will not work properly.</p></div>
4560
4563
  <div class="paragraph"><p>PassengerAllowEncodedSlashes may occur in the following places:</p></div>
4561
- <div class="ulist"><ul>
4564
+ <div class="ulist"><ul>
4562
4565
  <li>
4563
4566
  <p>
4564
4567
  In the global server configuration.
@@ -4625,7 +4628,7 @@ displaying maintenance.html will work fine even for URLs starting with "/users".
4625
4628
  write to the Apache error log file. A higher log level value means that more
4626
4629
  information will be logged.</p></div>
4627
4630
  <div class="paragraph"><p>Possible values are:</p></div>
4628
- <div class="ulist"><ul>
4631
+ <div class="ulist"><ul>
4629
4632
  <li>
4630
4633
  <p>
4631
4634
  <em>0</em>: Show only errors and warnings.
@@ -4674,7 +4677,7 @@ gem 'debugger', :platforms =&gt; :ruby_19</pre>
4674
4677
  </div>
4675
4678
  <div class="paragraph"><p>Once debugging is turned on, you can use the command <span class="monospaced">passenger-irb --debug &lt;PID&gt;</span> to attach an rdebug console to the application process with the given PID. Attaching will succeed once the application process executes a <span class="monospaced">debugger</span> command.</p></div>
4676
4679
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4677
- <div class="ulist"><ul>
4680
+ <div class="ulist"><ul>
4678
4681
  <li>
4679
4682
  <p>
4680
4683
  In the global server configuration.
@@ -4710,7 +4713,7 @@ Ruby on Rails &gt;= 3.x applications are considered Rack applications.</p></div>
4710
4713
  <div class="paragraph"><p>It is allowed to specify this option multiple times. Do this to deploy multiple
4711
4714
  Rails applications in different sub-URIs under the same virtual host.</p></div>
4712
4715
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4713
- <div class="ulist"><ul>
4716
+ <div class="ulist"><ul>
4714
4717
  <li>
4715
4718
  <p>
4716
4719
  In the global server configuration.
@@ -4737,7 +4740,7 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
4737
4740
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="rails_env"></span><h4 data-comment-topic="railsenv-string--1b0xxvu" data-anchor="rails_env">6.18.2. RailsEnv &lt;string&gt;</h4>
4738
4741
  <div class="paragraph"><p>This option allows one to specify the default <span class="monospaced">RAILS_ENV</span> value.</p></div>
4739
4742
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4740
- <div class="ulist"><ul>
4743
+ <div class="ulist"><ul>
4741
4744
  <li>
4742
4745
  <p>
4743
4746
  In the global server configuration.
@@ -4771,7 +4774,7 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
4771
4774
  <div class="paragraph"><p>It is allowed to specify this option multiple times. Do this to deploy multiple
4772
4775
  Rack applications in different sub-URIs under the same virtual host.</p></div>
4773
4776
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4774
- <div class="ulist"><ul>
4777
+ <div class="ulist"><ul>
4775
4778
  <li>
4776
4779
  <p>
4777
4780
  In the global server configuration.
@@ -4800,7 +4803,7 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
4800
4803
  environment variable. This allows one to define the environment in which
4801
4804
  Rack applications are run, very similar to <span class="monospaced">RAILS_ENV</span>.</p></div>
4802
4805
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4803
- <div class="ulist"><ul>
4806
+ <div class="ulist"><ul>
4804
4807
  <li>
4805
4808
  <p>
4806
4809
  In the global server configuration.
@@ -4898,7 +4901,7 @@ to fix this problem.</p></div>
4898
4901
  <div class="content">
4899
4902
  <div class="title">Symptoms</div>
4900
4903
  <div class="paragraph"><p>Installing Phusion Passenger fails because of one of the following errors:</p></div>
4901
- <div class="ulist"><ul>
4904
+ <div class="ulist"><ul>
4902
4905
  <li>
4903
4906
  <p>
4904
4907
  The Phusion Passenger installer tells you that the Ruby development headers
@@ -4923,7 +4926,7 @@ must be installed. On most Linux systems, Ruby and the Ruby development headers
4923
4926
  are contained in separate packages, so having Ruby installed does not
4924
4927
  automatically imply having the development headers installed.</p></div>
4925
4928
  <div class="paragraph"><p>Here’s how you can install the development headers:</p></div>
4926
- <div class="dlist"><dl>
4929
+ <div class="dlist"><dl>
4927
4930
  <dt class="hdlist1">
4928
4931
  Ubuntu/Debian
4929
4932
  </dt>
@@ -4979,15 +4982,15 @@ Other operating systems
4979
4982
  </dd>
4980
4983
  </dl></div>
4981
4984
  <div class="admonitionblock">
4982
- <table><tr>
4985
+ <table><tr>
4983
4986
  <td class="icon">
4984
- <img src="./images/icons/note.png" alt="Note">
4987
+ <img src="./images/icons/note.png" alt="Note">
4985
4988
  </td>
4986
4989
  <td class="content">If you’ve installed a new Ruby version (i.e. your system now contains
4987
4990
  multiple Ruby installations), then you will need to tell Phusion Passenger
4988
4991
  which Ruby installation you want to use. Please read
4989
4992
  <a href="#specifying_ruby_installation">Specifying the correct Ruby installation</a>.</td>
4990
- </tr></table>
4993
+ </tr></table>
4991
4994
  </div>
4992
4995
  </div>
4993
4996
  <div class="sect3">
@@ -4996,7 +4999,7 @@ which Ruby installation you want to use. Please read
4996
4999
  <div class="content">
4997
5000
  <div class="title">Symptoms</div>
4998
5001
  <div class="paragraph"><p>Installing Phusion Passenger fails because of one of the following errors:</p></div>
4999
- <div class="ulist"><ul>
5002
+ <div class="ulist"><ul>
5000
5003
  <li>
5001
5004
  <p>
5002
5005
  The installer says that the Apache development headers aren’t installed.
@@ -5012,7 +5015,7 @@ else similar to <em>http_*.h</em>.)</p></div>
5012
5015
  </ul></div>
5013
5016
  </div>
5014
5017
  </div>
5015
- <div class="dlist"><dl>
5018
+ <div class="dlist"><dl>
5016
5019
  <dt class="hdlist1">
5017
5020
  Ubuntu
5018
5021
  </dt>
@@ -5087,7 +5090,7 @@ Other operating systems
5087
5090
  <div class="content">
5088
5091
  <div class="title">Symptoms</div>
5089
5092
  <div class="paragraph"><p>Installing Phusion Passenger fails because one of the following errors:</p></div>
5090
- <div class="ulist"><ul>
5093
+ <div class="ulist"><ul>
5091
5094
  <li>
5092
5095
  <p>
5093
5096
  The installer tells you that APR development headers aren’t installed.
@@ -5106,7 +5109,7 @@ The error message “'apr_strings.h: No such file or directory”' occurs.
5106
5109
  </ul></div>
5107
5110
  </div>
5108
5111
  </div>
5109
- <div class="dlist"><dl>
5112
+ <div class="dlist"><dl>
5110
5113
  <dt class="hdlist1">
5111
5114
  Ubuntu
5112
5115
  </dt>
@@ -5179,9 +5182,9 @@ Other operating systems
5179
5182
  <div class="sect2">
5180
5183
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_problems_after_installation"></span><h3 data-comment-topic="problems-after-installation-fwd23q" data-anchor="_problems_after_installation">7.3. Problems after installation</h3>
5181
5184
  <div class="admonitionblock">
5182
- <table><tr>
5185
+ <table><tr>
5183
5186
  <td class="icon">
5184
- <img src="./images/icons/tip.png" alt="Tip">
5187
+ <img src="./images/icons/tip.png" alt="Tip">
5185
5188
  </td>
5186
5189
  <td class="content">
5187
5190
  <div class="title">The golden tip: read your Apache error logs!</div>
@@ -5189,7 +5192,7 @@ Other operating systems
5189
5192
  you’re experiencing post-installation problems, please look
5190
5193
  inside the Apache error logs. It will tell you what exactly went wrong.</p></div>
5191
5194
  </td>
5192
- </tr></table>
5195
+ </tr></table>
5193
5196
  </div>
5194
5197
  <div class="sect3">
5195
5198
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_my_rails_application_works_on_mongrel_but_not_on_phusion_passenger"></span><h4 data-comment-topic="my-rails-application-works-on-mongrel-but-not-on-phusion-passenger-1f28drx" data-anchor="_my_rails_application_works_on_mongrel_but_not_on_phusion_passenger">7.3.1. My Rails application works on Mongrel, but not on Phusion Passenger</h4>
@@ -5217,7 +5220,7 @@ Apache installations on their system.</p></div>
5217
5220
  <div class="paragraph"><p>Static assets are accelerated, i.e. they are served directly by Apache and do not
5218
5221
  go through the Rails stack. There are two reasons why Apache doesn’t serve static
5219
5222
  assets correctly:</p></div>
5220
- <div class="olist arabic"><ol class="arabic">
5223
+ <div class="olist arabic"><ol class="arabic">
5221
5224
  <li>
5222
5225
  <p>
5223
5226
  Your Apache configuration is too strict, and does not allow HTTP clients to
@@ -5253,7 +5256,7 @@ with SELinux. On Fedora, CentOS and RedHat Enterprise Linux, Apache is locked
5253
5256
  down by SELinux policies.</p></div>
5254
5257
  <div class="paragraph"><p>To solve this problem, you must set some permissions on the Phusion Passenger files
5255
5258
  and folders, so that Apache can access them.</p></div>
5256
- <div class="ulist"><ul>
5259
+ <div class="ulist"><ul>
5257
5260
  <li>
5258
5261
  <p>
5259
5262
  If you’ve installed Phusion Passenger via a gem, then run this command to determine
@@ -5300,7 +5303,7 @@ specified).</p></div>
5300
5303
  <div class="sect3">
5301
5304
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_my_rails_application_8217_s_log_file_is_not_being_written_to"></span><h4 data-comment-topic="my-rails-application-s-log-file-is-not-being-written-to-3i747l" data-anchor="_my_rails_application_8217_s_log_file_is_not_being_written_to">7.3.7. My Rails application’s log file is not being written to</h4>
5302
5305
  <div class="paragraph"><p>There are a couple things that you should be aware of:</p></div>
5303
- <div class="ulist"><ul>
5306
+ <div class="ulist"><ul>
5304
5307
  <li>
5305
5308
  <p>
5306
5309
  By default, Phusion Passenger runs Rails applications in <em>production</em> mode,
@@ -5441,14 +5444,14 @@ we see that all the Apache and Nginx worker processes only take less than 1 MB m
5441
5444
  This is a lot less than the 50-80 MB-ish memory usage as shown in the <em>VMSize</em> column
5442
5445
  (which is what a lot of people think is the real memory usage, but is actually not).</p></div>
5443
5446
  <div class="admonitionblock">
5444
- <table><tr>
5447
+ <table><tr>
5445
5448
  <td class="icon">
5446
- <img src="./images/icons/note.png" alt="Note">
5449
+ <img src="./images/icons/note.png" alt="Note">
5447
5450
  </td>
5448
5451
  <td class="content">Private dirty RSS reporting only works on Linux. Unfortunately other operating systems
5449
5452
  don’t provide facilities for determining processes' private dirty RSS. On non-Linux systems,
5450
5453
  the Resident Set Size is reported instead.</td>
5451
- </tr></table>
5454
+ </tr></table>
5452
5455
  </div>
5453
5456
  </div>
5454
5457
  <div class="sect2">
@@ -5470,7 +5473,7 @@ inactive = 1
5470
5473
  </div>
5471
5474
  </div>
5472
5475
  <div class="paragraph"><p>The <em>general information</em> section shows the following information:</p></div>
5473
- <div class="dlist"><dl>
5476
+ <div class="dlist"><dl>
5474
5477
  <dt class="hdlist1">
5475
5478
  max
5476
5479
  </dt>
@@ -5514,7 +5517,7 @@ time). The value of <em>inactive</em> equals <span class="monospaced">count - ac
5514
5517
  </dl></div>
5515
5518
  <div class="paragraph"><p>The <em>domains</em> section shows, for each application directory, information about running
5516
5519
  application instances:</p></div>
5517
- <div class="dlist"><dl>
5520
+ <div class="dlist"><dl>
5518
5521
  <dt class="hdlist1">
5519
5522
  Sessions
5520
5523
  </dt>
@@ -5581,13 +5584,13 @@ This is the case with Ruby on Rails. So if you kill a Ruby on Rails application
5581
5584
  running it in a <em>production</em> environment). If you don’t see a backtrace there, check
5582
5585
  the web server error log.</p></div>
5583
5586
  <div class="admonitionblock">
5584
- <table><tr>
5587
+ <table><tr>
5585
5588
  <td class="icon">
5586
- <img src="./images/icons/note.png" alt="Note">
5589
+ <img src="./images/icons/note.png" alt="Note">
5587
5590
  </td>
5588
5591
  <td class="content">It is safe to kill application instances, even in live environments. Phusion Passenger
5589
5592
  will restart killed application instances, as if nothing bad happened.</td>
5590
- </tr></table>
5593
+ </tr></table>
5591
5594
  </div>
5592
5595
  </div>
5593
5596
  <div class="sect2">
@@ -5596,7 +5599,7 @@ will restart killed application instances, as if nothing bad happened.</td>
5596
5599
  the request to the most suitable application process, but sometimes it is desirable to
5597
5600
  be able to directly access the individual application processes. Use cases include, but
5598
5601
  are not limited to:</p></div>
5599
- <div class="ulist"><ul>
5602
+ <div class="ulist"><ul>
5600
5603
  <li>
5601
5604
  <p>
5602
5605
  One wants to debug a memory leak or memory bloat problem that only seems to appear on
@@ -5679,7 +5682,7 @@ So if <em>/home/webapps/foo/config/environment.rb</em> is owned by <em>joe</em>,
5679
5682
  Passenger will launch the corresponding application as <em>joe</em> as well.</p></div>
5680
5683
  <div class="paragraph"><p>This behavior is the default, and you don’t need to configure anything. But
5681
5684
  there are things that you should keep in mind:</p></div>
5682
- <div class="ulist"><ul>
5685
+ <div class="ulist"><ul>
5683
5686
  <li>
5684
5687
  <p>
5685
5688
  The owner of <em>environment.rb</em>/<em>config.ru</em> must have read access to the application’s
@@ -5752,7 +5755,7 @@ end</pre>
5752
5755
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="bundler_support"></span><h3 data-comment-topic="bundler-support-cf72ih" data-anchor="bundler_support">9.4. Bundler support</h3>
5753
5756
  <div class="paragraph"><p>Phusion Passenger has automatic support for <a href="http://gembundler.com/git.html">Bundler</a>.
5754
5757
  It works as follows:</p></div>
5755
- <div class="ulist"><ul>
5758
+ <div class="ulist"><ul>
5756
5759
  <li>
5757
5760
  <p>
5758
5761
  If you have a <em>.bundle/environment.rb</em> in your application root, then Phusion
@@ -5805,9 +5808,9 @@ application’s root folder. Unlike <em>restart.txt</em>, Phusion Passenger does
5805
5808
  check for this file’s timestamp: Phusion Passenger will always restart the
5806
5809
  application, as long as <em>always_restart.txt</em> exists.</p></div>
5807
5810
  <div class="admonitionblock">
5808
- <table><tr>
5811
+ <table><tr>
5809
5812
  <td class="icon">
5810
- <img src="./images/icons/note.png" alt="Note">
5813
+ <img src="./images/icons/note.png" alt="Note">
5811
5814
  </td>
5812
5815
  <td class="content">If you’re just developing a Rails application then you probably don’t need
5813
5816
  this feature. If you set
@@ -5817,7 +5820,7 @@ then Rails will automatically reload your application code after each request.
5817
5820
  <em>always_restart.txt</em> is mostly useful when you’re using a web framework that
5818
5821
  doesn’t support code reloading by itself, of when you’re working on a web framework
5819
5822
  yourself.</td>
5820
- </tr></table>
5823
+ </tr></table>
5821
5824
  </div>
5822
5825
  </div>
5823
5826
  <div class="sect2">
@@ -5865,7 +5868,7 @@ please refer to
5865
5868
  <div class="paragraph"><p>The Out-of-Band Work feature allows you to run arbitrary long-running tasks outside normal request cycles. This works by letting current requests to the process finish, then telling the process to perform the out-of-band work, then resuming passing requests to the process after said work is finished.</p></div>
5866
5869
  <div class="paragraph"><p>A specific (and perhaps primary) use case of of Out-of-Band Work is <strong>Out-of-Band Garbage Collection</strong>. The garbage collector is run outside normal request cycles so that garbage collection runs inside normal request cycles can finish a lot faster. This can potentially save tens to hundreds of milliseconds of latency in requests.</p></div>
5867
5870
  <div class="paragraph"><p>Because Out-of-Band Work is implemented at the Phusion Passenger inter-process request routing level, and not by, say, spawning a thread inside the application process, Out-of-Band Work has the following useful properties:</p></div>
5868
- <div class="ulist"><ul>
5871
+ <div class="ulist"><ul>
5869
5872
  <li>
5870
5873
  <p>
5871
5874
  It works well even with tasks that can pause all threads. The MRI Ruby garbage collector is a stop-the-world mark-and-sweep garbage collector.
@@ -5878,7 +5881,7 @@ Phusion Passenger can spawn more processes as necessary, in order to prevent sit
5878
5881
  </li>
5879
5882
  </ul></div>
5880
5883
  <div class="paragraph"><p>Applications can use Out-of-Band Work as follows:</p></div>
5881
- <div class="olist arabic"><ol class="arabic">
5884
+ <div class="olist arabic"><ol class="arabic">
5882
5885
  <li>
5883
5886
  <p>
5884
5887
  Request out-of-band work by outputting the <span class="monospaced">X-Passenger-Request-OOB-Work</span> header during a request. It does not matter what the value is. At this time, it is not possible to request out-of-band work from outside requests.
@@ -5925,7 +5928,7 @@ use PhusionPassenger<span style="color: #990000">::</span>Rack<span style="color
5925
5928
  </div>
5926
5929
  </div>
5927
5930
  <div class="paragraph"><p>References:</p></div>
5928
- <div class="ulist"><ul>
5931
+ <div class="ulist"><ul>
5929
5932
  <li>
5930
5933
  <p>
5931
5934
  <a href="http://blog.phusion.nl/2013/01/22/phusion-passenger-4-technology-preview-out-of-band-work/">The Phusion Blog article which first introduced this feature.</a>
@@ -5981,7 +5984,7 @@ This check occurs after checking whether the original mapped filename exists (as
5981
5984
  of static asset serving). All this is done without the need for special mod_rewrite
5982
5985
  rules.</p></div>
5983
5986
  <div class="paragraph"><p>For example, suppose that the browser requests <em>/foo/bar</em>.</p></div>
5984
- <div class="olist arabic"><ol class="arabic">
5987
+ <div class="olist arabic"><ol class="arabic">
5985
5988
  <li>
5986
5989
  <p>
5987
5990
  Phusion Passenger will first check whether this URI maps to a static file, i.e.
@@ -6022,7 +6025,7 @@ whether the following file exists:</p></div>
6022
6025
  </div>
6023
6026
  <div class="paragraph"><p>If you’re not a programmer and don’t understand the above pseudo-code snippet, it means
6024
6027
  that Phusion Passenger will:</p></div>
6025
- <div class="olist arabic"><ol class="arabic">
6028
+ <div class="olist arabic"><ol class="arabic">
6026
6029
  <li>
6027
6030
  <p>
6028
6031
  Extract the parent directory filename from the value of the DocumentRoot directory.
@@ -6065,12 +6068,14 @@ Phusion Passenger will look for <em>config.ru</em> instead of <em>config/environ
6065
6068
  Attribution-Share Alike 3.0 Unported License</a>.</p></div>
6066
6069
  <div class="paragraph"><p><span class="image">
6067
6070
  <a class="image" href="http://creativecommons.org/licenses/by-sa/3.0/">
6068
- <img src="images/by_sa.png" alt="images/by_sa.png"></a>
6071
+ <img src="images/by_sa.png" alt="images/by_sa.png">
6072
+ </a>
6069
6073
  </span></p></div>
6070
6074
  <div class="paragraph"><p>Phusion Passenger is brought to you by <a href="http://www.phusion.nl/">Phusion</a>.</p></div>
6071
6075
  <div class="paragraph"><p><span class="image">
6072
6076
  <a class="image" href="http://www.phusion.nl/">
6073
- <img src="images/phusion_banner.png" alt="images/phusion_banner.png"></a>
6077
+ <img src="images/phusion_banner.png" alt="images/phusion_banner.png">
6078
+ </a>
6074
6079
  </span></p></div>
6075
6080
  <div class="paragraph"><p>Phusion Passenger is a trademark of Hongli Lai &amp; Ninh Bui.</p></div>
6076
6081
  </div>
@@ -6180,18 +6185,20 @@ programmers jargon, Phusion Passenger calls fork(), but not exec().</p></div>
6180
6185
  <div class="sect2">
6181
6186
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_the_smart_spawning_method"></span><h3 data-comment-topic="the-smart-spawning-method-1cvu9dd" data-anchor="_the_smart_spawning_method">13.2. The smart spawning method</h3>
6182
6187
  <div class="admonitionblock">
6183
- <table><tr>
6188
+ <table><tr>
6184
6189
  <td class="icon">
6185
- <img src="./images/icons/note.png" alt="Note">
6190
+ <img src="./images/icons/note.png" alt="Note">
6186
6191
  </td>
6187
6192
  <td class="content">Smart spawning is supported for all Ruby applications but not for WSGI applications.</td>
6188
- </tr></table>
6193
+ </tr></table>
6189
6194
  </div>
6190
6195
  <div class="paragraph"><p>While direct spawning works well, it’s not as efficient as it could be
6191
6196
  because each worker process has its own private copy of the Rails application
6192
6197
  as well as the Rails framework. This wastes memory as well as startup time.</p></div>
6193
6198
  <div class="paragraph"><p><span class="image">
6194
- <img src="images/direct_spawning.png" alt="Worker processes and direct spawning"></span><br><em>Figure: Worker processes and direct spawning. Each worker process has its
6199
+ <img src="images/direct_spawning.png" alt="Worker processes and direct spawning">
6200
+ </span><br>
6201
+ <em>Figure: Worker processes and direct spawning. Each worker process has its
6195
6202
  own private copy of the application code and Rails framework code.</em></p></div>
6196
6203
  <div class="paragraph"><p>It is possible to make the different worker processes share the memory occupied
6197
6204
  by application and Rails framework code, by utilizing so-called
@@ -6215,13 +6222,15 @@ processes will share as much common
6215
6222
  memory as possible. That is, they will all share the same application and Rails
6216
6223
  framework code.</p></div>
6217
6224
  <div class="paragraph"><p><span class="image">
6218
- <img src="images/smart.png" alt="images/smart.png"></span><br><em>Figure: Worker processes and the smart spawn method. All worker processes,
6225
+ <img src="images/smart.png" alt="images/smart.png">
6226
+ </span><br>
6227
+ <em>Figure: Worker processes and the smart spawn method. All worker processes,
6219
6228
  as well as the ApplicationSpawner, share the same application code and Rails
6220
6229
  framework code.</em></p></div>
6221
6230
  <div class="paragraph"><p>The <em>smart</em> method allows different worker processes that belong to the same
6222
6231
  application to share memory.</p></div>
6223
6232
  <div class="paragraph"><p>Notes:</p></div>
6224
- <div class="ulist"><ul>
6233
+ <div class="ulist"><ul>
6225
6234
  <li>
6226
6235
  <p>
6227
6236
  Vendored Rails frameworks cannot be shared by different applications, even if
@@ -7131,5 +7140,5 @@ Mizuho.topicListReceived = $.proxy(function(result) {
7131
7140
  $(document).ready(Mizuho.initializeCommenting);
7132
7141
 
7133
7142
  </script>
7134
- </body>
7143
+ </body>
7135
7144
  </html>