doc/Users guide Standalone.html in passenger-4.0.52 vs doc/Users guide Standalone.html in passenger-4.0.53

- old
+ new

@@ -1,11 +1,11 @@ <!DOCTYPE html> -<html lang="en"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> -<meta name="generator" content="AsciiDoc 8.6.7"> -<title>Phusion Passenger Standalone users guide</title> +<html lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<meta name="generator" content="AsciiDoc 8.6.7"> +<title>Phusion Passenger Standalone users guide</title> <style type="text/css"> /* Shared CSS for AsciiDoc xhtml11 and html5 backends */ /* Default font. */ body { @@ -601,11 +601,11 @@ } div.exampleblock > div.content, div.sidebarblock > div.content, div.listingblock > div.content { border-width: 0 0 0 3px; border-color: #E8E8E8; } div.verseblock { border-left-width: 0; margin-left: 3em; } div.quoteblock { border-left-width: 3px; margin-left: 0; margin-right: 0;} div.admonitionblock td.content { border-left: 3px solid #E8E8E8; } -</style> +</style> <script type="text/javascript"> /*<![CDATA[*/ var asciidoc = { // Namespace. ///////////////////////////////////////////////////////////////////// @@ -795,12 +795,11 @@ } } asciidoc.install(); /*]]>*/ -</script> -<style type="text/css"> +</script><style type="text/css"> body { margin: 1em auto 1em auto; padding: 0 1em 0 1em; max-width: 800px; } @@ -1053,11 +1052,11 @@ width: 1px; height: 1px; } </style> -</head> +</head> <body class="article"> <div id="topbar" style="display: none"> <div class="title"> <!-- Don't put a space between the img and a. That will break the hover layout. --> <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAKCAYAAAEV95QVAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sGCRMSACDxkZwAAAAidEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVAgb24gYSBNYWOHqHdDAAAAZUlEQVQY032PSxbAIAjEIlfygL6ePF3UUvpzNjgSYWwqAMEhUQnANnsC7TQPeJpsVWzMuh2sog4vDTUbqP081zECrW4dtdaQGSIKlWluPyjK+VXxAz5XfcKufCzA130AfQHWB30HZxlPaP080xsAAAAASUVORK5CYII=" width="11" height="10" alt=""><a href="javascript:void(Mizuho.smoothlyScrollToToc())">Phusion Passenger Standalone users guide</a> @@ -1068,16 +1067,15 @@ <h1>Phusion Passenger Standalone users guide</h1> <div id="preamble"> <div class="sectionbody"> <div class="paragraph"><p><span class="image"> <a class="image" href="http://www.phusion.nl/"> -<img src="images/phusion_banner.png" alt="images/phusion_banner.png"> -</a> +<img src="images/phusion_banner.png" alt="images/phusion_banner.png"></a> </span></p></div> <div class="paragraph"><p><a href="https://www.phusionpassenger.com/">Phusion Passenger</a> is a web server and application server, designed to be fast, robust and lightweight. It runs your web apps with the least amount of hassle by taking care of almost all administrative heavy lifting for you. Advanced administration tools allow you to gain deep insight into your web applications' operations and to keep your servers healthy. Phusion Passenger is polyglot by design, and currently supports Ruby (Rack), Python (WSGI) and Node.js.</p></div> <div class="paragraph"><p>In the Standalone mode, Phusion Passenger operates as a fully-featured, secure standalone HTTP server. You do not need to have an existing web server like Apache or Nginx. This mode is ideal…</p></div> -<div class="ulist"><ul> +<div class="ulist"><ul> <li> <p> …if you are not familiar with Apache or Nginx </p> </li> @@ -1160,133 +1158,127 @@ <div class="paragraph"><p>Phusion Passenger works on almost any POSIX-compliant operating system. In other words: practically any operating system on earth, except Microsoft Windows.</p></div> <div class="paragraph"><p>Supported operating systems:</p></div> <table class="tableblock frame-all grid-all" style=" width:100%; -"> -<col style="width:50%;"> -<col style="width:50%;"> -<thead> -<tr> +"> +<col style="width:50%;"> +<col style="width:50%;"> +<thead><tr> <th class="tableblock halign-left valign-top"> OS </th> <th class="tableblock halign-left valign-top"> Minimum version</th> -</tr> -</thead> -<tbody> -<tr> +</tr></thead> +<tbody> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Ubuntu</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">10.04</p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Debian</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">6</p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Red Hat, CentOS</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">5</p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Amazon Linux</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">All versions supported</p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Mac OS X</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">10.8 Mountain Lion</p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">FreeBSD</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">8</p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">OpenBSD</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">5.2</p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Other Unix</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td> -</tr> -</tbody> -</table> +</tr> +</tbody> +</table> <div class="paragraph"><p>"Other Unix" is supported on a "best-effort" basis. We do not regularly check whether Phusion Passenger still works on other Unices, but if users report issues then we’ll try to address them.</p></div> <div class="paragraph"><p>Supported architectures:</p></div> <table class="tableblock frame-all grid-all" style=" width:100%; -"> -<col style="width:50%;"> -<col style="width:50%;"> -<thead> -<tr> +"> +<col style="width:50%;"> +<col style="width:50%;"> +<thead><tr> <th class="tableblock halign-left valign-top"> Architecture </th> <th class="tableblock halign-left valign-top"> Notes</th> -</tr> -</thead> -<tbody> -<tr> +</tr></thead> +<tbody> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">x86 (32-bit)</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">x86_64 (64-bit)</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Other</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">Supported on a "best-effort" basis.</p></td> -</tr> -</tbody> -</table> +</tr> +</tbody> +</table> <div class="paragraph"><p>Supported languages and frameworks:</p></div> <table class="tableblock frame-all grid-all" style=" width:100%; -"> -<col style="width:50%;"> -<col style="width:50%;"> -<thead> -<tr> +"> +<col style="width:50%;"> +<col style="width:50%;"> +<thead><tr> <th class="tableblock halign-left valign-top"> Language/framework </th> <th class="tableblock halign-left valign-top"> Minimum version</th> -</tr> -</thead> -<tbody> -<tr> +</tr></thead> +<tbody> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Ruby (MRI)</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">1.8.5</p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">JRuby</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">1.7.0</p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Rubinius</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">2.2.0</p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Ruby on Rails</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">1.2</p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Python</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">2.6</p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Node.js</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.10</p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Meteor</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">0.6</p></td> -</tr> -</tbody> -</table> +</tr> +</tbody> +</table> <div class="paragraph"><p>If you run into any issues, please <a href="https://github.com/phusion/passenger/issues">report a bug</a> or <a href="http://groups.google.com/group/phusion-passenger">join our discussion forum</a>.</p></div> </div> <div class="sect2"> <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="where_to_get_support"></span><h3 data-comment-topic="where-to-get-support-xkx7rx" data-anchor="where_to_get_support">1.2. Where to get support</h3> -<div class="ulist"><ul> +<div class="ulist"><ul> <li> <p> <a href="http://groups.google.com/group/phusion-passenger">Community discussion forum</a> - post a message here if you’re experiencing problems. Support on this forum is provided by the community on a best-effort basis, so a (timely) response is not guaranteed. </p> @@ -1325,19 +1317,19 @@ <div class="paragraph"><p>Because Phusion Passenger is designed to run in a wide variety of operating systems and configurations, there are multiple ways to install it. Most users  — especially first-time users — will prefer <em>OS-specific installation instructions</em>. These are not only the easiest, but also allow Phusion Passenger to integrate into the operating system in the best way possible. Other users should consult the <em>generic installation instructions</em>.</p></div> <div class="paragraph"><p>The steps for upgrading or downgrading Phusion Passenger is almost the same as the steps for installing. All the installation guides in this section will also teach you how to upgrade and downgrade.</p></div> </div> <div class="sect2"> <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="install_osx_homebrew"></span><h3 data-comment-topic="installing-or-upgrading-on-mac-os-x-with-homebrew-fxjdi1" data-anchor="install_osx_homebrew">2.2. Installing or upgrading on Mac OS X with Homebrew</h3> -<div class="dlist"><dl> +<div class="dlist"><dl> <dt class="hdlist1"> <strong>Open source</strong> </dt> <dd> <p> Every time we release a new Phusion Passenger version, we make it available through <a href="http://brew.sh/">Homebrew</a>. Please note that the Homebrew maintainers have to merge our pull requests manually, so it may take a day or two before a new version shows up in the official Homebrew repository. </p> -<div class="olist arabic"><ol class="arabic"> +<div class="olist arabic"><ol class="arabic"> <li> <p> Update the Homebrew recipes: </p> <div class="listingblock"> @@ -1375,11 +1367,11 @@ <div class="paragraph"><p>We provide an official Phusion Passenger APT repository. This APT repository contains Phusion Passenger packages for multiple versions of Debian and Ubuntu. These packages are automatically built by our build server after we push out a source release, and thus are always up to date with the official source releases.</p></div> <div class="paragraph"><p>If you use these packages to install Phusion Passenger then you do not need to run <span class="monospaced">passenger-install-apache2-module</span> or <span class="monospaced">passenger-install-nginx-module</span>. These packages contain all the binaries that you need.</p></div> <div class="paragraph"><p>Packages are available for the x86 and x86_64 architectures. Our policy is to support all Ubuntu LTS releases that are still supported by Canonical, plus the latest Ubuntu release, plus all Debian releases that are still supported by Debian.</p></div> <div class="sect3"> <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="install_add_apt_repo"></span><h4 data-comment-topic="adding-our-apt-repository-1qu2se8" data-anchor="install_add_apt_repo">2.3.1. Adding our APT repository</h4> -<div class="olist arabic"><ol class="arabic"> +<div class="olist arabic"><ol class="arabic"> <li> <p> Install our PGP key. Packages are signed by "Phusion Automated Software Signing (<a href="mailto:auto-software-signing@phusion.nl">auto-software-signing@phusion.nl</a>)", fingerprint 1637 8A33 A6EF 1676 2922 526E 561F 9B9C AC40 B2F7. </p> <div class="listingblock"> @@ -1400,11 +1392,11 @@ </li> <li> <p> Create a file <span class="monospaced">/etc/apt/sources.list.d/passenger.list</span> and insert <strong>one of</strong> the following lines, depending on your distribution. </p> -<div class="dlist"><dl> +<div class="dlist"><dl> <dt class="hdlist1"> <strong>Open source</strong> </dt> <dd> <div class="listingblock"> @@ -1468,16 +1460,16 @@ </li> </ol></div> </div> <div class="sect3"> <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_installing_packages"></span><h4 data-comment-topic="installing-packages-k1zxbg" data-anchor="_installing_packages">2.3.2. Installing packages</h4> -<div class="dlist"><dl> +<div class="dlist"><dl> <dt class="hdlist1"> <strong>Open source</strong> </dt> <dd> -<div class="olist arabic"><ol class="arabic"> +<div class="olist arabic"><ol class="arabic"> <li> <p> <a href="#install_add_apt_repo">Add our APT repository.</a> </p> </li> @@ -1495,11 +1487,11 @@ </dd> <dt class="hdlist1"> <strong>Enterprise</strong> </dt> <dd> -<div class="olist arabic"><ol class="arabic"> +<div class="olist arabic"><ol class="arabic"> <li> <p> Download your license key from the <a href="https://www.phusionpassenger.com/orders">Customer Area</a> and save it as <span class="monospaced">/etc/passenger-enterprise-license</span>. </p> </li> @@ -1524,16 +1516,16 @@ </div> </div> <div class="sect2"> <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_installing_or_upgrading_on_red_hat_fedora_centos_or_scientificlinux"></span><h3 data-comment-topic="installing-or-upgrading-on-red-hat-fedora-centos-or-scientificlinux-16cek45" data-anchor="_installing_or_upgrading_on_red_hat_fedora_centos_or_scientificlinux">2.4. Installing or upgrading on Red Hat, Fedora, CentOS or ScientificLinux</h3> <div class="admonitionblock"> -<table><tr> +<table><tr> <td class="icon"> -<img src="./images/icons/warning.png" alt="Warning"> +<img src="./images/icons/warning.png" alt="Warning"> </td> <td class="content">The RPMs are currently unmaintained. As such, the repository only contains Phusion Passenger 3.x (the latest version is 4.x), which did not support Node.js, Meteor, multiple Rubies, etc. For more recent versions of Phusion Passenger, you are suggested to install from gem or tarball instead.</td> -</tr></table> +</tr></table> </div> <div class="paragraph"><p>YUM repositories with RPMs are maintained by <a href="https://github.com/erikogan/passenger">Erik Ogan</a> and <a href="http://stealthymonkeys.com/">Stealthy Monkeys Consulting</a>. Only packages for the open source version of Phusion Passenger are provided. <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a> customers should use the <a href="#rubygems_generic_install">generic RubyGems installation method</a> or <a href="#tarball_generic_install">the generic tarball installation method</a> instead.</p></div> <div class="paragraph"><p>If you use YUM to install Phusion Passenger then you do not need to run <span class="monospaced">passenger-install-apache2-module</span> or <span class="monospaced">passenger-install-nginx-module</span>. The YUM packages contain all the binaries that you need. You also don’t need to modify any Apache or Nginx configuration to get them to load Phusion Passenger, the packages provide configuration snippets for you as well.</p></div> <span class="anchor_helper" id="_step_1_import_the_stealthy_monkeys_consulting_8217_s_gpg_key"></span><h4 class="float" data-anchor="_step_1_import_the_stealthy_monkeys_consulting_8217_s_gpg_key">Step 1: Import the Stealthy Monkeys Consulting’s GPG key</h4> <div class="listingblock"> @@ -1612,11 +1604,11 @@ <div class="content monospaced"> <pre>which ruby</pre> </div> </div> <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> -<div class="ulist"><ul> +<div class="ulist"><ul> <li> <p> Are you using RVM? Run <span class="monospaced">rvmsudo -s</span> </p> </li> @@ -1631,11 +1623,11 @@ </p> </li> </ul></div> <div class="paragraph"><p>You must maintain this root prompt throughout this installation guide.</p></div> <span class="anchor_helper" id="_step_2_install_the_gem"></span><h4 class="float" data-anchor="_step_2_install_the_gem">Step 2: install the gem</h4> -<div class="dlist"><dl> +<div class="dlist"><dl> <dt class="hdlist1"> <strong>Open Source</strong> </dt> <dd> <p> @@ -1721,36 +1713,34 @@ <span class="anchor_helper" id="_step_1_installing_ruby"></span><h4 class="float" data-anchor="_step_1_installing_ruby">Step 1: installing Ruby</h4> <div class="paragraph"><p>Phusion Passenger supports multiple languages and its core is written in C++, but its installer and administration tools are written in Ruby, so you must install Ruby.</p></div> <div class="paragraph"><p>Even though Ruby is required, Ruby will normally not be loaded during normal operation unless you deploy a Ruby web application on Phusion Passenger. Phusion Passenger’s dependency on Ruby is very minimal. See <a href="#relationship_with_ruby">Phusion Passenger and its relationship with Ruby</a> for details.</p></div> <table class="tableblock frame-all grid-all" style=" width:100%; -"> -<col style="width:50%;"> -<col style="width:50%;"> -<tbody> -<tr> +"> +<col style="width:50%;"> +<col style="width:50%;"> +<tbody> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Debian, Ubuntu</p></td> -<td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">sudo apt-get update</span><br> -<span class="monospaced">sudo apt-get install ruby rake</span></p></td> -</tr> -<tr> +<td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">sudo apt-get update</span><br><span class="monospaced">sudo apt-get install ruby rake</span></p></td> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Red Hat, CentOS, ScientificLinux, Amazon Linux</p></td> -<td class="tableblock halign-left valign-top"><p class="tableblock">Enable <a href="http://fedoraproject.org/wiki/EPEL">EPEL</a>, then run as root:<br> -<span class="monospaced">yum install ruby rubygem-rake</span></p></td> -</tr> -<tr> +<td class="tableblock halign-left valign-top"><p class="tableblock">Enable <a href="http://fedoraproject.org/wiki/EPEL">EPEL</a>, then run as root:<br><span class="monospaced">yum install ruby rubygem-rake</span></p></td> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Mac OS X</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">No action needed. Ruby is installed by default.</p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Other operating systems</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">Install Ruby from <a href="http://www.ruby-lang.org/">the Ruby website</a>.</p></td> -</tr> -</tbody> -</table> +</tr> +</tbody> +</table> <span class="anchor_helper" id="_step_2_download_and_extract_the_tarball"></span><h4 class="float" data-anchor="_step_2_download_and_extract_the_tarball">Step 2: download and extract the tarball</h4> -<div class="dlist"><dl> +<div class="dlist"><dl> <dt class="hdlist1"> <strong>Open Source</strong> </dt> <dd> <p> @@ -1789,11 +1779,11 @@ </div> <div class="sect2"> <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_upgrading_from_open_source_to_enterprise"></span><h3 data-comment-topic="upgrading-from-open-source-to-enterprise-1kezors" data-anchor="_upgrading_from_open_source_to_enterprise">2.7. Upgrading from open source to Enterprise</h3> <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> <div class="paragraph"><p>Customers who have bought Phusion Passenger Enterprise can upgrade their open source installation to Enterprise as follows:</p></div> -<div class="olist arabic"><ol class="arabic"> +<div class="olist arabic"><ol class="arabic"> <li> <p> <a href="#uninstalling">Uninstall the open source Phusion Passenger</a>. </p> </li> @@ -1929,22 +1919,22 @@ <pre><tt><span style="font-weight: bold"><span style="color: #0000FF">export</span></span> <span style="color: #009900">CC</span><span style="color: #990000">=</span><span style="color: #FF0000">'ccache clang -fcolor-diagnostics -Qunused-arguments -fcatch-undefined-behavior -ftrapv'</span> <span style="font-weight: bold"><span style="color: #0000FF">export</span></span> <span style="color: #009900">CXX</span><span style="color: #990000">=</span><span style="color: #FF0000">'ccache clang++ -fcolor-diagnostics -Qunused-arguments -fcatch-undefined-behavior -ftrapv'</span></tt></pre> </div> </div> <div class="admonitionblock"> -<table><tr> +<table><tr> <td class="icon"> -<img src="./images/icons/note.png" alt="Note"> +<img src="./images/icons/note.png" alt="Note"> </td> <td class="content">If you run the installer with <span class="monospaced">sudo</span> then environment variables may not be passed properly. Learn more at <a href="#env_vars_and_sudo">Environment variables and sudo</a>.</td> -</tr></table> +</tr></table> </div> </div> <div class="sect3"> <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_adding_additional_compiler_or_linker_flags"></span><h4 data-comment-topic="adding-additional-compiler-or-linker-flags-nxfour" data-anchor="_adding_additional_compiler_or_linker_flags">2.9.2. Adding additional compiler or linker flags</h4> <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> -<div class="dlist"><dl> +<div class="dlist"><dl> <dt class="hdlist1"> <span class="monospaced">EXTRA_PRE_CFLAGS</span> </dt> <dd> <p> @@ -2031,23 +2021,23 @@ Setting this to 1 will enable the <span class="monospaced">PASSENGER_THREAD_LOCAL_STORAGE</span> macro, which forcefully disables the use of thread-local storage inside the Phusion Passenger codebase. Setting this environment variable is useful on systems that have broken support for thread-local storage, despite passing our build system’s check for proper thread-local storage support. At the time of writing, one user has reported that Ubuntu 12.04 32-bit has broken thread-local storage report although neither the reporter nor us were able to reproduce the problem on any other systems running Ubuntu 12.04 32-bit. Note that this flag has no effect on non-Phusion Passenger code. </p> </dd> </dl></div> <div class="admonitionblock"> -<table><tr> +<table><tr> <td class="icon"> -<img src="./images/icons/note.png" alt="Note"> +<img src="./images/icons/note.png" alt="Note"> </td> <td class="content">If you run the installer with <span class="monospaced">sudo</span> then environment variables may not be passed properly. Learn more at <a href="#env_vars_and_sudo">Environment variables and sudo</a>.</td> -</tr></table> +</tr></table> </div> </div> <div class="sect3"> <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="forcing_location_of_command_line_tools_and_dependencies"></span><h4 data-comment-topic="forcing-location-of-command-line-tools-and-dependencies-xajpg1" data-anchor="forcing_location_of_command_line_tools_and_dependencies">2.9.3. Forcing location of command line tools and dependencies</h4> <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> <div class="paragraph"><p>You can force the build to find certain command line tools at certain locations by using the following environment variables:</p></div> -<div class="dlist"><dl> +<div class="dlist"><dl> <dt class="hdlist1"> <span class="monospaced">HTTPD</span> </dt> <dd> <p> @@ -2104,30 +2094,30 @@ The location of the GNU-compatible <span class="monospaced">make</span> tool. </p> </dd> </dl></div> <div class="admonitionblock"> -<table><tr> +<table><tr> <td class="icon"> -<img src="./images/icons/tip.png" alt="Tip"> +<img src="./images/icons/tip.png" alt="Tip"> </td> <td class="content">If you do not know what environment variables are, or how to use them, then please read <a href="#env_vars_and_sudo">Environment variables and sudo</a>.</td> -</tr></table> +</tr></table> </div> <div class="admonitionblock"> -<table><tr> +<table><tr> <td class="icon"> -<img src="./images/icons/note.png" alt="Note"> +<img src="./images/icons/note.png" alt="Note"> </td> <td class="content">If you run the installer with <span class="monospaced">sudo</span> then environment variables may not be passed properly. Learn more at <a href="#env_vars_and_sudo">Environment variables and sudo</a>.</td> -</tr></table> +</tr></table> </div> </div> </div> <div class="sect2"> <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="uninstalling"></span><h3 data-comment-topic="uninstalling-3hpprb" data-anchor="uninstalling">2.10. Uninstalling</h3> -<div class="ulist"><ul> +<div class="ulist"><ul> <li> <p> If you installed Phusion Passenger through Homebrew, then run <span class="monospaced">brew uninstall passenger</span>. </p> </li> @@ -2191,11 +2181,11 @@ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_configuration"></span><h2 data-comment-topic="configuration-10trfau" data-anchor="_configuration">4. Configuration</h2> <div class="sectionbody"> <div class="sect2"> <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_command_line_options"></span><h3 data-comment-topic="command-line-options-1njv6kt" data-anchor="_command_line_options">4.1. Command line options</h3> <div class="paragraph"><p>Most configuration is done by customizing the arguments passed to the <span class="monospaced">passenger</span> command. The most important ones are:</p></div> -<div class="dlist"><dl> +<div class="dlist"><dl> <dt class="hdlist1"> <span class="monospaced">--port NUMBER</span> </dt> <dd> <p> @@ -2296,11 +2286,11 @@ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="config_file"></span><h3 data-comment-topic="configuration-file-xng7yp" data-anchor="config_file">4.2. Configuration file</h3> <div class="paragraph"><p><strong>Introduced in version 4.0.24.</strong></p></div> <div class="paragraph"><p>It is possible to store some options in a configuration file <span class="monospaced">passenger-standalone.json</span> in the application directory. Configuration in this file overrides command line options. The configuration file format is JSON.</p></div> <div class="paragraph"><p>In case Passenger Standalone is in <a href="#mass_deployment">mass deployment mode</a>, such a configuration file allows customizing options on a per-application basis.</p></div> <div class="paragraph"><p>The following configuration options are supported:</p></div> -<div class="dlist"><dl> +<div class="dlist"><dl> <dt class="hdlist1"> <span class="monospaced">port</span> </dt> <dd> <p> @@ -2419,16 +2409,16 @@ <pre><tt>passenger start --nginx-config-template nginx<span style="color: #990000">.</span>conf<span style="color: #990000">.</span>erb</tt></pre> </div> </div> <div class="paragraph"><p>Alternatively, if you don’t want to pass this parameter every time, you can also set the <span class="monospaced">nginx_config_template</span> option in <a href="#config_file">passenger-standalone.json</a>.</p></div> <div class="admonitionblock"> -<table><tr> +<table><tr> <td class="icon"> -<img src="./images/icons/note.png" alt="Note"> +<img src="./images/icons/note.png" alt="Note"> </td> <td class="content">The original configuration template file may change from time to time, e.g. because new features are introduced into Phusion Passenger. If your configuration template file does not contain the required changes, then these new features may not work properly. In the worst case, Standalone might even malfunction. Therefore, every time you upgrade Phusion Passenger, you should check whether the original configuration template file has changed, and merge back any changes into your own file.</td> -</tr></table> +</tr></table> </div> </div> </div> </div> <div class="sect1"> @@ -2472,11 +2462,11 @@ </div> </div> <div class="sect2"> <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="sharing_port"></span><h3 data-comment-topic="sharing-the-same-port-between-multiple-passenger-standalone-instances-3lcmc5" data-anchor="sharing_port">5.2. Sharing the same port between multiple Passenger Standalone instances</h3> <div class="paragraph"><p>If you have multiple applications on your server then it is desirable to have all of them listen on the same port (e.g. port 80), with the HTTP request’s host name determining which Passenger Standalone instance should handle the request. There are three ways to achieve this.</p></div> -<div class="olist arabic"><ol class="arabic"> +<div class="olist arabic"><ol class="arabic"> <li> <p> The first way is to use the <a href="#mass_deployment">Mass deployment</a> feature, which allows Passenger Standalone to directly host multiple applications at the same time. Please refer to that section to learn more. </p> </li> @@ -2511,11 +2501,11 @@ </div> </div> <div class="paragraph"><p>Notice the fact that we pass <span class="monospaced">--address 127.0.0.1</span>, which tells Passenger Standalone to only listen for requests that originate from the local machine. This is because the reverse proxy/load balancer, not Passenger Standalone, is supposed to be responsible for receiving external HTTP requests. The reverse proxy/load balancer will be running on the same machine only, so limiting Passenger Standalone in this manner improves security.</p></div> <span class="anchor_helper" id="_step_2_install_and_configure_the_reverse_proxy_load_balancer"></span><h4 class="float" data-anchor="_step_2_install_and_configure_the_reverse_proxy_load_balancer">Step 2: install and configure the reverse proxy/load balancer</h4> <div class="paragraph"><p>The next step is to <strong>install a reverse proxy/load balancer</strong>, and to <strong>configure</strong> it to do the following:</p></div> -<div class="ulist"><ul> +<div class="ulist"><ul> <li> <p> To listen on port 80. </p> </li> @@ -2526,59 +2516,57 @@ </li> </ul></div> <div class="paragraph"><p>You can use any reverse proxy/load balancer you want, but we’re going to show an example using <a href="http://www.nginx.org/">Nginx</a> because it’s a pretty popular choice. Install Nginx as follows:</p></div> <table class="tableblock frame-all grid-all" style=" width:100%; -"> -<col style="width:50%;"> -<col style="width:50%;"> -<tbody> -<tr> +"> +<col style="width:50%;"> +<col style="width:50%;"> +<tbody> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Debian, Ubuntu</p></td> -<td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">sudo apt-get update</span><br> -<span class="monospaced">sudo apt-get install nginx-extras</span></p></td> -</tr> -<tr> +<td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">sudo apt-get update</span><br><span class="monospaced">sudo apt-get install nginx-extras</span></p></td> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Red Hat, CentOS, ScientificLinux, Amazon Linux</p></td> -<td class="tableblock halign-left valign-top"><p class="tableblock">Enable <a href="http://fedoraproject.org/wiki/EPEL">EPEL</a>, then run as root:<br> -<span class="monospaced">yum install nginx</span></p></td> -</tr> -<tr> +<td class="tableblock halign-left valign-top"><p class="tableblock">Enable <a href="http://fedoraproject.org/wiki/EPEL">EPEL</a>, then run as root:<br><span class="monospaced">yum install nginx</span></p></td> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Mac OS X (Homebrew)</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">brew install nginx</span></p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Other operating systems</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">Install Nginx from <a href="http://www.nginx.org/">the Nginx website</a>.</p></td> -</tr> -</tbody> -</table> +</tr> +</tbody> +</table> <div class="paragraph"><p>Open the Nginx configuration file:</p></div> <table class="tableblock frame-all grid-all" style=" width:100%; -"> -<col style="width:50%;"> -<col style="width:50%;"> -<tbody> -<tr> +"> +<col style="width:50%;"> +<col style="width:50%;"> +<tbody> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Debian, Ubuntu</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">/etc/nginx/nginx.conf</span></p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Red Hat, CentOS, ScientificLinux, Amazon Linux</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">/etc/nginx/nginx.conf</span></p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Mac OS X (Homebrew)</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">/usr/local/etc/nginx/nginx.conf</span></p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Other operating systems</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">It depends on how you installed Nginx, but it’s usually <span class="monospaced">$PREFIX/conf/nginx.conf</span>, where <span class="monospaced">$PREFIX</span> is the prefix you installed Nginx to.</p></td> -</tr> -</tbody> -</table> +</tr> +</tbody> +</table> <div class="paragraph"><p>Add virtual host entries for your applications foo and bar. While making the virtual host entries, you must determine what host names foo and bar should respond to. Let’s say that foo should respond to <em>www.foo.com</em> and bar should respond to <em>www.bar.com</em>. Then the following entries will tell Nginx to listen on port 80, and to handle requests for the domains <em>www.foo.com</em> and <em>www.bar.com</em> differently.</p></div> <div class="listingblock"> <div class="content monospaced"> <pre>http { ... @@ -2639,38 +2627,38 @@ </div> </div> <div class="paragraph"><p>Once you’re done editing the Nginx configuration file, restart Nginx:</p></div> <table class="tableblock frame-all grid-all" style=" width:100%; -"> -<col style="width:50%;"> -<col style="width:50%;"> -<tbody> -<tr> +"> +<col style="width:50%;"> +<col style="width:50%;"> +<tbody> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Debian, Ubuntu</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">sudo /etc/init.d/nginx restart</span></p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Red Hat, CentOS, ScientificLinux, Amazon Linux</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">sudo service nginx restart</span></p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Mac OS X (Homebrew)</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">1. Run <span class="monospaced">sudo kill $(cat /usr/local/var/run/nginx.pid)</span><br> 2. You you installed the Nginx launchd plist that Homebrew provides (see <span class="monospaced">brew info nginx</span> to learn more), then you don’t have to do anything, and launchd will automatically restart Nginx. Otherwise, you have to manually start Nginx again: <span class="monospaced">sudo /usr/local/bin/nginx</span>.</p></td> -</tr> -<tr> +</tr> +<tr> <td class="tableblock halign-left valign-top"><p class="tableblock">Other operating systems</p></td> <td class="tableblock halign-left valign-top"> <p class="tableblock">It depends on how you installed Nginx, but it’s usually as follows:</p> <p class="tableblock"> 1. Lookup the PID of the Nginx master process using <span class="monospaced">ps aux</span>.<br> 2. Run <span class="monospaced">sudo kill &lt;PID&gt;</span><br> 3. Start Nginx again: <span class="monospaced">sudo $PREFIX/sbin/nginx</span>, where <span class="monospaced">$PREFIX</span> is the prefix you installed Nginx to.</p> </td> -</tr> -</tbody> -</table> +</tr> +</tbody> +</table> <span class="anchor_helper" id="_step_3_testing"></span><h4 class="float" data-anchor="_step_3_testing">Step 3: testing</h4> <div class="paragraph"><p>Nginx should now be listening on port 80, and should forward requests to foo and bar respectively. Let’s test it out by accessing <a href="http://www.foo.com">http://www.foo.com</a> and <a href="http://www.bar.com">http://www.bar.com</a>. But first, we need to ensure that any requests to <em>www.foo.com</em> and <em>www.bar.com</em>, that originate from the local machine, actually end up at the local host, and not at the IP address specified in the DNS records. To do this, edit <span class="monospaced">/etc/hosts</span> and add:</p></div> <div class="listingblock"> <div class="content monospaced"> <pre>127.0.0.1 www.foo.com www.bar.com</pre> @@ -2760,11 +2748,11 @@ Phusion Passenger Standalone log file. This is typically located in <span class="monospaced">log/passenger.[PORT NUMBER].log</span>. Most problems are logged to this log file.</p></div> <div class="paragraph"><p>If neither the logs nor this troubleshooting guide can help you, then please check out our <a href="#where_to_get_support">support resources</a>.</p></div> </div> <div class="sect2"> <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_upon_uploading_a_file_phusion_passenger_reports_client_body_temp_00000000xx_failed_2_no_such_file_or_directory"></span><h3 data-comment-topic="upon-uploading-a-file-phusion-passenger-reports-client-body-temp-00000000xx-failed-2-no-such-file-or-directory--d01goe" data-anchor="_upon_uploading_a_file_phusion_passenger_reports_client_body_temp_00000000xx_failed_2_no_such_file_or_directory">7.2. Upon uploading a file, Phusion Passenger reports "client_body_temp/00000000xx failed (2: No such file or directory)"</h3> -<div class="dlist"><dl> +<div class="dlist"><dl> <dt class="hdlist1"> <strong>Symptoms</strong> </dt> <dd> <p> @@ -2802,11 +2790,11 @@ </dd> </dl></div> </div> <div class="sect2"> <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_i_get_command_not_found_when_running_a_phusion_passenger_command_through_sudo"></span><h3 data-comment-topic="i-get-command-not-found-when-running-a-phusion-passenger-command-through-sudo-14k8kde" data-anchor="_i_get_command_not_found_when_running_a_phusion_passenger_command_through_sudo">7.3. I get "command not found" when running a Phusion Passenger command through sudo</h3> -<div class="dlist"><dl> +<div class="dlist"><dl> <dt class="hdlist1"> <strong>Symptoms</strong> </dt> <dd> <p> @@ -2874,11 +2862,11 @@ <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="about_environment_variables"></span><h2 data-comment-topic="appendix-about-environment-variables-1ct91x3" data-anchor="about_environment_variables">8. Appendix: About environment variables</h2> <div class="sectionbody"> <div class="paragraph"><p>Environment variables are named values that affect how the system works. For example they tell the system where to look for commands (the <span class="monospaced">PATH</span> variable) or where to look for libraries (<span class="monospaced">LD_LIBRARY_PATH</span>). Their names are often in all-uppercase. Sometimes people refer to an environment variable with a dollar sign <span class="monospaced">$</span> in front, but that’s the same thing: when people say "the $PATH environment variable" they mean "the PATH environment variable". This is because the dollar sign <span class="monospaced">$</span> is a shell syntax for refering to an environment variable, as you will learn later.</p></div> <div class="paragraph"><p>Environment variables are set on a <strong>per-process</strong> basis, but they are <strong>inherited</strong> by child processes. This means that if you set environment variables in process A, another already running process B will not see these new environment variables. But if A spawns a child process C, then C will have all environment variables that A had. If you once again change the environment variables in A, then C will not see the changes.</p></div> <div class="paragraph"><p>The per-process nature of environment variables some implications. When you set environment variables in your <span class="monospaced">bashrc</span> or other bash startup files…</p></div> -<div class="ulist"><ul> +<div class="ulist"><ul> <li> <p> …only newly spawned bash shells see them. </p> </li> @@ -2892,16 +2880,16 @@ …cron jobs do not see them, because cron jobs' environment variables are entirely dictated by their crontabs. </p> </li> </ul></div> <div class="admonitionblock"> -<table><tr> +<table><tr> <td class="icon"> -<img src="./images/icons/note.png" alt="Note"> +<img src="./images/icons/note.png" alt="Note"> </td> <td class="content">Because this chapter is meant for beginners, it assumes that the reader uses the bash shell. This chapter does not describe instructions for zsh, csh or other shells. We assume that users of other shells are familiar with the Bourne shell syntax, and know how to apply the instructions in this chapter in their shells' native syntaxes.</td> -</tr></table> +</tr></table> </div> <div class="sect2"> <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_working_with_environment_variables"></span><h3 data-comment-topic="working-with-environment-variables-11cmwlv" data-anchor="_working_with_environment_variables">8.1. Working with environment variables</h3> <div class="paragraph"><p>You can see all environment variables in your shell by running the following command:</p></div> <div class="listingblock"> @@ -2934,13 +2922,13 @@ ruby -e <span style="color: #FF0000">'p ENV["APXS2"]'</span> <span style="font-style: italic"><span style="color: #9A1900"># =&gt; "/usr/sbin/apxs2"</span></span></tt></pre> </div> </div> <div class="admonitionblock"> -<table><tr> +<table><tr> <td class="icon"> -<img src="./images/icons/note.png" alt="Note"> +<img src="./images/icons/note.png" alt="Note"> </td> <td class="content"> <div class="title">The "export" keyword is important</div> <div class="paragraph"><p>You <strong>must</strong> set the <span class="monospaced">export</span> keyword. If you omit the <span class="monospaced">export</span> keyword then the environment variable will not be visible to other processes:</p></div> <div class="listingblock"> @@ -2953,11 +2941,11 @@ ruby -e <span style="color: #FF0000">'p ENV["APXS2"]'</span> <span style="font-style: italic"><span style="color: #9A1900"># =&gt; nil</span></span></tt></pre> </div> </div> </td> -</tr></table> +</tr></table> </div> <div class="paragraph"><p>You can reference an environment variable in your shell by typing the <span class="monospaced">$</span> sign followed by the environment variable’s name. For example, to see the value of the <span class="monospaced">PATH</span> variable:</p></div> <div class="listingblock"> <div class="content"> <!-- Generator: GNU source-highlight 2.11.1 @@ -3031,11 +3019,11 @@ </div> </div> <div class="sect3"> <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_adding_phusion_passenger_8217_s_administration_tools_to_path"></span><h4 data-comment-topic="adding-phusion-passenger-s-administration-tools-to-path-d7k5mh" data-anchor="_adding_phusion_passenger_8217_s_administration_tools_to_path">8.2.1. Adding Phusion Passenger’s administration tools to PATH</h4> <div class="paragraph"><p>If you get a "command not found" error when invoking one of the Phusion Passenger administration tools (e.g. <span class="monospaced">passenger-status</span> or <span class="monospaced">passenger-memory-stats</span> then that means the tools are not in <span class="monospaced">PATH</span>, so you need to add them.</p></div> -<div class="ulist"><ul> +<div class="ulist"><ul> <li> <p> If you <a href="#rubygems_generic_install">installed Phusion Passenger with RubyGems</a>, then the tools are in your RubyGems executable path. You can view the gem path using the command <span class="monospaced">gem env</span>: </p> <div class="listingblock"> @@ -3089,16 +3077,16 @@ </div> <div class="paragraph"><p>In this example, the administration tools happen to be in <span class="monospaced">/usr/local/passenger/bin</span>, so you must add that to <span class="monospaced">PATH</span>.</p></div> </li> </ul></div> <div class="admonitionblock"> -<table><tr> +<table><tr> <td class="icon"> -<img src="./images/icons/note.png" alt="Note"> +<img src="./images/icons/note.png" alt="Note"> </td> <td class="content">You may still get a "command not found" when invoking the tools through sudo, even after you’ve added the relevant directory to <span class="monospaced">PATH</span>. Please read <a href="#env_vars_and_sudo">Environment variables and sudo</a> to learn more.</td> -</tr></table> +</tr></table> </div> </div> </div> <div class="sect2"> <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_making_environment_variables_permanent"></span><h3 data-comment-topic="making-environment-variables-permanent-mkq46d" data-anchor="_making_environment_variables_permanent">8.3. Making environment variables permanent</h3> @@ -3116,53 +3104,53 @@ echo <span style="color: #FF0000">'export PATH=/usr/local/bin:$PATH'</span> <span style="color: #990000">&gt;&gt;</span> <span style="color: #990000">~/.</span>bashrc</tt></pre> </div> </div> <div class="paragraph"><p>To make them permanent for future bash sessions <strong>for all users</strong>, add them to <span class="monospaced">/etc/bashrc</span>.</p></div> <div class="admonitionblock"> -<table><tr> +<table><tr> <td class="icon"> -<img src="./images/icons/note.png" alt="Note"> +<img src="./images/icons/note.png" alt="Note"> </td> <td class="content">Depending on the system, the bashrc file may have a different filename. On Debian and Ubuntu, it’s <span class="monospaced">/etc/bash.bashrc</span>.</td> -</tr></table> +</tr></table> </div> </div> <div class="sect3"> <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_apache"></span><h4 data-comment-topic="apache-15y3bm0" data-anchor="_apache">8.3.2. Apache</h4> <div class="admonitionblock"> -<table><tr> +<table><tr> <td class="icon"> -<img src="./images/icons/note.png" alt="Note"> +<img src="./images/icons/note.png" alt="Note"> </td> <td class="content">This subsection describes how to set environment variables on Apache itself, not on apps served through Phusion Passenger for Apache. The environment variables you set here will be passed to all apps, but you cannot customize them on a per-app basis. See also <a href="#env_vars_passenger_apps">Setting environment variables on Phusion Passenger-served apps</a>.</td> -</tr></table> +</tr></table> </div> <div class="paragraph"><p>On Debian and Ubuntu, with an Apache installed through apt, Apache environment variables are defined in the file <span class="monospaced">/etc/apache2/envvars</span>. This is a shell script so environment variables must be specified with the shell syntax.</p></div> <div class="paragraph"><p>On Red Hat, Fedora, CentOS and ScientificLinux, with an Apache installed through YUM, Apache environment variables are defined in <span class="monospaced">/etc/sysconfig/httpd</span>.</p></div> <div class="paragraph"><p>On OS X they are defined in <span class="monospaced">/System/Library/LaunchDaemons/org.apache.httpd.plist</span>, as explained <a href="/System/Library/LaunchDaemons/org.apache.httpd.plist">here on Stack Overflow</a>.</p></div> <div class="paragraph"><p>On other systems, or if you did not install Apache through the system’s package manager, the configuration file for environment variables is specific to the vendor that supplied Apache. There may not even be such a configuration file. You should contact the vendor for support.</p></div> </div> <div class="sect3"> <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_nginx"></span><h4 data-comment-topic="nginx-uarf27" data-anchor="_nginx">8.3.3. Nginx</h4> <div class="admonitionblock"> -<table><tr> +<table><tr> <td class="icon"> -<img src="./images/icons/note.png" alt="Note"> +<img src="./images/icons/note.png" alt="Note"> </td> <td class="content">This subsection describes how to set environment variables on Nginx itself, not on apps served through Phusion Passenger for Nginx. The environment variables you set here will be passed to all apps, but you cannot customize them on a per-app basis. See also <a href="#env_vars_passenger_apps">Setting environment variables on Phusion Passenger-served apps</a>.</td> -</tr></table> +</tr></table> </div> <div class="paragraph"><p>If you installed Nginx through <a href="#install_on_debian_ubuntu">the Debian or Ubuntu packages</a>, then you can define environment variables in <span class="monospaced">/etc/default/nginx</span>. This is a shell script so you must use the <span class="monospaced">export FOO=bar</span> syntax.</p></div> <div class="paragraph"><p>Otherwise, environment variables are best set through the script which starts Nginx. For example, if you installed Nginx from source and you used then you should edit that script to define the environment variables. Those init scripts are regular shell scripts, so use the <span class="monospaced">export FOO=bar</span> syntax. Just make sure your set your environment variables before the script starts Nginx.</p></div> <div class="admonitionblock"> -<table><tr> +<table><tr> <td class="icon"> -<img src="./images/icons/note.png" alt="Note"> +<img src="./images/icons/note.png" alt="Note"> </td> <td class="content">Setting environment variables on Nginx has no effect on the <a href="#flying_passenger">Flying Passenger daemon</a> because the daemon is started seperately. You should set the environment variables in the shell right before starting the daemon.</td> -</tr></table> +</tr></table> </div> </div> <div class="sect3"> <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_cron"></span><h4 data-comment-topic="cron-6272ar" data-anchor="_cron">8.3.4. cron</h4> <div class="paragraph"><p>To make environment variables permanent for cron jobs, add those variables to the relevant crontab. But note that inside crontabs you cannot refer to existing environment variables with the <span class="monospaced">$</span> syntax because crontabs are not shell scripts. You have to specify the entire value.</p></div> @@ -3187,11 +3175,11 @@ </div> </div> <div class="sect3"> <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="env_vars_passenger_apps"></span><h4 data-comment-topic="phusion-passenger-served-apps-127wbl2" data-anchor="env_vars_passenger_apps">8.3.5. Phusion Passenger-served apps</h4> <div class="paragraph"><p>You can pass environment variables to Phusion Passenger-served apps through various methods:</p></div> -<div class="ulist"><ul> +<div class="ulist"><ul> <li> <p> When running Apache, use the <span class="monospaced">PassEnv</span> and <span class="monospaced">SetEnv</span> directives of <a href="http://httpd.apache.org/docs/2.4/mod/mod_env.html">mod_env</a>. This is supported starting from Phusion Passenger 4.0. </p> </li> @@ -3239,16 +3227,16 @@ </div> </div> <div class="sect2"> <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="env_vars_and_sudo"></span><h3 data-comment-topic="environment-variables-and-sudo-znzmif" data-anchor="env_vars_and_sudo">8.4. Environment variables and sudo</h3> <div class="admonitionblock"> -<table><tr> +<table><tr> <td class="icon"> -<img src="./images/icons/note.png" alt="Note"> +<img src="./images/icons/note.png" alt="Note"> </td> <td class="content">RVM users should always use the <span class="monospaced">rvmsudo</span> command instead of <span class="monospaced">sudo</span>. However all information in this section apply to <span class="monospaced">rvmsudo</span> as well.</td> -</tr></table> +</tr></table> </div> <div class="paragraph"><p>The <span class="monospaced">sudo</span> command resets all environment variables before running the specified command, for security reasons. So if you set environment variables before running <span class="monospaced">sudo passenger-install-xxx-module</span>, <span class="monospaced">sudo passenger-status</span> or any other commands, then the environment variables are not correctly passed to the command. You can solve this by running sudo with <span class="monospaced">-E</span> (preserve environment variables):</p></div> <div class="listingblock"> <div class="content"> <!-- Generator: GNU source-highlight 2.11.1 @@ -3961,7 +3949,7 @@ }, Mizuho); $(document).ready(Mizuho.initializeCommenting); </script> -</body> +</body> </html>