Phusion Passenger users guide, Apache version
=============================================

image:images/phusion_banner.png[link="http://www.phusion.nl/"]

This is the old, deprecated Passenger for Apache documentation. Please visit https://www.phusionpassenger.com/library/ for the new documentation.


== Support information

include::users_guide_snippets/support_information.txt[]

[[installation]]
== Installation

include::users_guide_snippets/installation.txt[]


== Deploying a Rack-based Ruby application ==

This documentation has moved. Please visit https://www.phusionpassenger.com/library/deploy/apache/

=== Tutorial/example: writing and deploying a Hello World Rack application ===

This documentation has moved. Please visit https://www.phusionpassenger.com/library/deploy/apache/

=== Deploying to a virtual host's root ===

This documentation has moved. Please visit https://www.phusionpassenger.com/library/deploy/apache/

[[deploying_rack_to_sub_uri]]
=== Deploying to a sub URI ===

This documentation has moved. Please visit https://www.phusionpassenger.com/library/deploy/apache/

=== Redeploying (restarting the Rack application) ===

This documentation has moved. Please visit https://www.phusionpassenger.com/library/admin/apache/restart_app.html

=== Rackup specifications for various web frameworks ===
include::users_guide_snippets/rackup_specifications.txt[]


== Deploying a WSGI (Python) application

This documentation has moved. Please visit https://www.phusionpassenger.com/library/deploy/apache/

=== Tutorial/example: writing and deploying a Hello World WSGI application ===

This documentation has moved. Please visit https://www.phusionpassenger.com/library/deploy/apache/

=== Deploying to a virtual host's root ===

This documentation has moved. Please visit https://www.phusionpassenger.com/library/deploy/apache/

[[deploying_python_to_sub_uri]]
=== Deploying to a sub URI ===

This documentation has moved. Please visit https://www.phusionpassenger.com/library/deploy/apache/

=== Redeploying (restarting the WSGI application) ===

This documentation has moved. Please visit https://www.phusionpassenger.com/library/admin/apache/restart_app.html

=== Sample `passenger_wsgi.py` for Django

This documentation has moved. Please visit https://www.phusionpassenger.com/library/deploy/wsgi_spec.html


== Deploying a Node.js application

This documentation has moved. Please visit https://www.phusionpassenger.com/library/deploy/apache/


== Deploying a Meteor application

This documentation has moved. Please visit https://www.phusionpassenger.com/library/deploy/apache/


== Configuring Phusion Passenger ==

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/

[[PassengerRoot]]
=== PassengerRoot <directory> ===

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerroot

[[PassengerDefaultRuby]]
=== PassengerDefaultRuby <filename> ===

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerdefaultruby

=== Deployment options

[[PassengerEnabled]]
==== PassengerEnabled <on|off>

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerenabled

[[PassengerBaseURI]]
==== PassengerBaseURI <uri> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerbaseuri

=== Application loading options

[[PassengerRuby]]
==== PassengerRuby <filename>

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerruby

==== PassengerPython <filename>

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerpython

==== PassengerNodejs <filename>

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengernodejs

==== PassengerMeteorAppSettings <filename>

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengermeteorappsettings

[[PassengerAppEnv]]
==== PassengerAppEnv <string> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerappenv

[[rails_env]]
==== RailsEnv <string> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#railsenv-rackenv

[[rack_env]]
==== RackEnv <string> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#railsenv-rackenv

[[PassengerAppRoot]]
==== PassengerAppRoot <path/to/root>

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerapproot

[[PassengerAppGroupName]]
==== PassengerAppGroupName <name>

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerappgroupname

[[PassengerAppType]]
==== PassengerAppType <name>

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerapptype

[[PassengerStartupFile]]
==== PassengerStartupFile <filename>

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerstartupfile

==== PassengerRestartDir <directory>

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerrestartdir

[[PassengerSpawnMethod]]
==== PassengerSpawnMethod <string>

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerspawnmethod

[[PassengerLoadShellEnvvars]]
==== PassengerLoadShellEnvvars <on|off>

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerloadshellenvvars

[[PassengerRollingRestarts]]
==== PassengerRollingRestarts <on|off>

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerrollingrestarts

[[PassengerResistDeploymentErrors]]
==== PassengerResistDeploymentErrors <on|off>

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerresistdeploymenterrors

=== Security options ===

[[PassengerUserSwitching]]
==== PassengerUserSwitching <on|off> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengeruserswitching

[[PassengerUser]]
==== PassengerUser <username> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengeruser

[[PassengerGroup]]
==== PassengerGroup <group name> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengergroup

[[PassengerDefaultUser]]
==== PassengerDefaultUser <username> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerdefaultuser

[[PassengerDefaultGroup]]
==== PassengerDefaultGroup <group name> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerdefaultgroup

[[PassengerFriendlyErrorPages]]
==== PassengerFriendlyErrorPages <on|off> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerfriendlyerrorpages


=== Resource control and optimization options ===

[[PassengerMaxPoolSize]]
==== PassengerMaxPoolSize <integer> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengermaxpoolsize

[[PassengerMinInstances]]
==== PassengerMinInstances <integer> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengermininstances

[[PassengerMaxInstances]]
==== PassengerMaxInstances <integer> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengermaxinstances

==== PassengerMaxInstancesPerApp <integer> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengermaxinstancesperapp

[[PassengerPoolIdleTime]]
==== PassengerPoolIdleTime <integer> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerpoolidletime

[[PassengerMaxPreloaderIdleTime]]
==== PassengerMaxPreloaderIdleTime <integer> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengermaxpreloaderidletime

==== PassengerStartTimeout <seconds> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerstarttimeout

[[PassengerConcurrencyModel]]
==== PassengerConcurrencyModel <process|thread> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerconcurrencymodel

[[PassengerThreadCount]]
==== PassengerThreadCount <number> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerthreadcount

[[PassengerMaxRequests]]
==== PassengerMaxRequests <integer> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengermaxrequests

[[PassengerMaxRequestTime]]
==== PassengerMaxRequestTime <seconds> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengermaxrequesttime

[[PassengerMemoryLimit]]
==== PassengerMemoryLimit <integer> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengermemorylimit

==== PassengerStatThrottleRate <integer> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerstatthrottlerate

[[PassengerPreStart]]
==== PassengerPreStart <url> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerprestart

[[PassengerHighPerformance]]
==== PassengerHighPerformance <on|off> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerhighperformance


/////////////////////////////////////////
/////////////////////////////////////////


=== Connection handling options ===

[[PassengerBufferUpload]]
==== PassengerBufferUpload <on|off> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerbufferupload

[[PassengerBufferResponse]]
==== PassengerBufferResponse <on|off> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerbufferresponse

[[PassengerResponseBufferHighWatermark]]
==== PassengerResponseBufferHighWatermark <bytes>

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerresponsebufferhighwatermark

[[PassengerErrorOverride]]
==== PassengerErrorOverride <on|off> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengererroroverride

[[PassengerMaxRequestQueueSize]]
==== PassengerMaxRequestQueueSize <number> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengermaxrequestqueuesize

[[PassengerStickySessions]]
==== PassengerStickySessions <on|off>

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerstickysessions

[[PassengerStickySessionsCookieName]]
==== PassengerStickySessionsCookieName

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerstickysessionscookiename


=== Compatibility options ===

[[PassengerResolveSymlinksInDocumentRoot]]
==== PassengerResolveSymlinksInDocumentRoot <on|off> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerresolvesymlinksindocumentroot

==== PassengerAllowEncodedSlashes <on|off> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerallowencodedslashes


=== Logging and debugging options ===

[[PassengerLogLevel]]
==== PassengerLogLevel <integer> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerloglevel

[[PassengerLogFile]]
==== PassengerLogFile <filename> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerlogfile

==== PassengerFileDescriptorLogFile <filename>

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerfiledescriptorlogfile

==== PassengerDebugger <on|off> ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerdebugger

=== Advanced options

[[PassengerInstanceRegistryDir]]
==== PassengerInstanceRegistryDir <directory>

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerinstanceregistrydir

[[PassengerDataBufferDir]]
==== PassengerDataBufferDir <directory>

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerdatabufferdir

=== Deprecated or removed options ===

==== RailsRuby ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#railsruby

==== RailsBaseURI and RackBaseURI ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#railsbaseuri-rackbaseuri

==== RailsUserSwitching ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#railsuserswitching

==== RailsDefaultUser ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#railsdefaultuser

==== RailsAllowModRewrite ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#railsallowmodrewrite

==== RailsSpawnMethod ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#railsspawnmethod

==== RailsAutoDetect, RackAutoDetect and WsgiAutoDetect ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#railsautodetect-rackautodetect-and-wsgiautodetect

==== RailsAppSpawnerIdleTime ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#railsappspawneridletime

==== RailsFrameworkSpawnerIdleTime ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#railsframeworkspawneridletime

==== PassengerDebugLogFile ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/config/apache/reference/#passengerdebuglogfile


[[troubleshooting]]
== Troubleshooting

include::users_guide_snippets/troubleshooting/default.txt[]

=== OS X: The installer cannot locate MAMP's Apache

This documentation has moved. Please visit https://www.phusionpassenger.com/library/admin/apache/troubleshooting/?a=os-x-the-installer-cannot-locate-mamp-s-apache

=== Apache reports a "403 Forbidden" error

This documentation has moved. Please visit https://www.phusionpassenger.com/library/admin/apache/troubleshooting/?a=static-assets-such-as-images-and-stylesheets-aren-t-being-displayed

=== Static assets such as images and stylesheets aren't being displayed

This documentation has moved. Please visit https://www.phusionpassenger.com/library/admin/apache/troubleshooting/?a=static-assets-such-as-images-and-stylesheets-aren-t-being-displayed

[[apache_selinux_permissions]]
=== Apache cannot access my app's files because of SELinux errors

This documentation has moved. Please visit https://www.phusionpassenger.com/library/admin/apache/troubleshooting/?a=apache-cannot-access-my-app-s-files-because-of-selinux-errors

=== The application thinks its not on SSL even though it is

This documentation has moved. Please visit https://www.phusionpassenger.com/library/admin/apache/troubleshooting/?a=the-application-thinks-its-not-on-ssl-even-though-it-is


include::users_guide_snippets/troubleshooting/rails.txt[]

[[conflicting_apache_modules]]
=== Conflicting Apache modules ===

==== mod_userdir ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/admin/apache/troubleshooting/?a=conflicting-apache-modules

==== MultiViews (mod_negotiation) ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/admin/apache/troubleshooting/?a=conflicting-apache-modules

==== VirtualDocumentRoot ====

This documentation has moved. Please visit https://www.phusionpassenger.com/library/admin/apache/troubleshooting/?a=conflicting-apache-modules


== Analysis and system maintenance ==

include::users_guide_snippets/analysis_and_system_maintenance.txt[]


== Tips ==

include::users_guide_snippets/tips.txt[]

=== X-Sendfile support ===

Phusion Passenger does not provide X-Sendfile support by itself. Please install
link:http://tn123.ath.cx/mod_xsendfile/[mod_xsendfile] for X-Sendfile support.

=== Upload progress ===

Phusion Passenger does not provide upload progress support by itself. Please
try drogus's link:http://github.com/drogus/apache-upload-progress-module/tree/master[
Apache upload progress module] instead.


== Under the hood ==
Phusion Passenger hides a lot of complexity for the end user (i.e. the web server
system administrator), but sometimes it is desirable to know what is going on.
This section describes a few things that Phusion Passenger does under the hood.

include::users_guide_snippets/under_the_hood/page_caching_support.txt[]
include::users_guide_snippets/under_the_hood/relationship_with_ruby.txt[]

=== Static assets serving ===
Phusion Passenger accelerates serving of static files. This means that, if an URI
maps to a file that exists, then Phusion Passenger will let Apache serve that file
directly, without hitting the web application.

Phusion Passenger does all this without the need for any mod_rewrite rules. People
who are switching from an old Mongrel-based setup might have mod_rewrite rules such
as these:

------------------------------------------------------------
# Check whether this request has a corresponding file; if that
# exists, let Apache serve it, otherwise forward the request to
# Mongrel.
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ balancer://mongrel%{REQUEST_URI} [P,QSA,L]
------------------------------------------------------------

These kind of mod_rewrite rules are no longer required, and you can safely remove
them.

[[application_detection]]
=== How Phusion Passenger detects whether a virtual host is a web application ===

This documentation has moved. Please visit https://www.phusionpassenger.com/library/indepth/app_autodetection/apache/


include::users_guide_snippets/appendix_a_about.txt[]

include::users_guide_snippets/appendix_b_terminology.txt[]

include::users_guide_snippets/appendix_c_spawning_methods.txt[]

[[about_environment_variables]]
== Appendix D: About environment variables

include::users_guide_snippets/environment_variables.txt[]
