From f017640c42047a4ed123f184ad76ac6e58b814f8 Mon Sep 17 00:00:00 2001 From: "Hongli Lai (Phusion)" Date: Wed, 10 Sep 2014 11:44:48 +0200 Subject: [PATCH] Remove support for Rails 1.2-2.2 --- CHANGELOG | 1 + doc/Design and Architecture.txt | 3 +- doc/Users guide Apache.idmap.txt | 364 +++++++++--------- doc/Users guide Apache.txt | 152 +------- doc/Users guide Nginx.idmap.txt | 330 ++++++++-------- doc/Users guide Nginx.txt | 136 +------ .../support_information.txt | 2 +- ext/common/ApplicationPool2/AppTypes.cpp | 3 +- ext/common/ApplicationPool2/AppTypes.h | 3 +- ext/common/ApplicationPool2/ErrorRenderer.h | 2 +- ext/common/ApplicationPool2/Options.h | 6 +- ext/common/ApplicationPool2/SpawnerFactory.h | 7 +- helper-scripts/classic-rails-loader.rb | 166 -------- helper-scripts/classic-rails-preloader.rb | 193 ---------- .../classic_rails/cgi_fixed.rb | 68 ---- .../classic_rails/thread_handler_extension.rb | 40 -- test/ruby/classic_rails/loader_spec.rb | 46 --- test/ruby/classic_rails/preloader_spec.rb | 52 --- 18 files changed, 349 insertions(+), 1225 deletions(-) delete mode 100644 helper-scripts/classic-rails-loader.rb delete mode 100644 helper-scripts/classic-rails-preloader.rb delete mode 100644 lib/phusion_passenger/classic_rails/cgi_fixed.rb delete mode 100644 lib/phusion_passenger/classic_rails/thread_handler_extension.rb delete mode 100644 test/ruby/classic_rails/loader_spec.rb delete mode 100644 test/ruby/classic_rails/preloader_spec.rb diff --git a/CHANGELOG b/CHANGELOG index 8ae2e82a7f..2ae95b1679 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,7 @@ Release 5.0.0 beta 1 * Full socket hijacking now requires the caller to output an HTTP status line * Lowered server instance dir toucher interval from 6 to 1 hour. * Log levels revamped + * Rails 1.2-2.2 support removed. Rails 2.3 still supported Release 4.0.50 diff --git a/doc/Design and Architecture.txt b/doc/Design and Architecture.txt index 64ff2cf912..ce7900b099 100644 --- a/doc/Design and Architecture.txt +++ b/doc/Design and Architecture.txt @@ -313,8 +313,7 @@ All (pre)loaders are located in the `helper-scripts` directory in the source tre [options="header"] |================================================================================ | Language/Framework | Loader | Preloader -| Ruby Rack and Rails >= 3.x | rack-loader.rb | rack-preloader.rb -| Ruby on Rails 1.x and 2.x | classic-rails-loader.rb | classic-rails-preloader.rb +| Ruby Rack and Rails | rack-loader.rb | rack-preloader.rb | Python | wsgi-loader.py | - | Node.js and bundled Meteor | node-loader.js | - | Unbundled Meteor | meteor-loader.rb | - diff --git a/doc/Users guide Apache.idmap.txt b/doc/Users guide Apache.idmap.txt index 0283dade9c..591cd66d36 100644 --- a/doc/Users guide Apache.idmap.txt +++ b/doc/Users guide Apache.idmap.txt @@ -74,367 +74,355 @@ 2.15. Moving to a different directory => moving-to-a-different-directory-1n0gkwh -3. Deploying a Ruby on Rails 1.x or 2.x (but NOT Rails >= 3.x) application => deploying-a-ruby-on-rails-1-x-or-2-x-but-not-rails-3-x-application-9r92hi +3. Deploying a Rack-based Ruby application => deploying-a-rack-based-ruby-application-including-rails-3--hcs66f -3.1. Deploying to a virtual host’s root => deploying-to-a-virtual-host-s-root-ab4zj6 +3.1. Tutorial/example: writing and deploying a Hello World Rack application => tutorial-example-writing-and-deploying-a-hello-world-rack-application-axp5z5 -3.2. Deploying to a sub URI => deploying-to-a-sub-uri-13rfygg +3.2. Deploying to a virtual host’s root => deploying-to-a-virtual-host-s-root-ab4zj6 -3.3. Redeploying (restarting the Ruby on Rails application) => redeploying-restarting-the-ruby-on-rails-application--m5zqc6 +3.3. Deploying to a sub URI => deploying-to-a-sub-uri-13rfygg -3.4. Migrations => migrations-15238b4 +3.4. Redeploying (restarting the Rack application) => redeploying-restarting-the-rack-application--18m41m1 -3.5. Capistrano integration => capistrano-integration-1o4cbyq +3.5. Rackup specifications for various web frameworks => rackup-specifications-for-various-web-frameworks-ndsqc2 -4. Deploying a Rack-based Ruby application (including Rails >= 3) => deploying-a-rack-based-ruby-application-including-rails-3--hcs66f +3.5.1. Camping => camping-1kxexk0 -4.1. Tutorial/example: writing and deploying a Hello World Rack application => tutorial-example-writing-and-deploying-a-hello-world-rack-application-axp5z5 +3.5.2. Halcyon => halcyon-1ghnpmz -4.2. Deploying to a virtual host’s root => deploying-to-a-virtual-host-s-root-u9bfax - -4.3. Deploying to a sub URI => deploying-to-a-sub-uri-zekba6 - -4.4. Redeploying (restarting the Rack application) => redeploying-restarting-the-rack-application--18m41m1 - -4.5. Rackup specifications for various web frameworks => rackup-specifications-for-various-web-frameworks-ndsqc2 +3.5.3. Mack => mack-miht6b -4.5.1. Camping => camping-1kxexk0 +3.5.4. Merb => merb-iyj7qy -4.5.2. Halcyon => halcyon-1ghnpmz +3.5.5. Ramaze => ramaze-boddtj -4.5.3. Mack => mack-miht6b +3.5.6. Sinatra => sinatra-1hubto4 -4.5.4. Merb => merb-iyj7qy +4. Deploying a WSGI (Python) application => deploying-a-wsgi-python-application-7aygdl -4.5.5. Ramaze => ramaze-boddtj +4.1. Tutorial/example: writing and deploying a Hello World WSGI application => tutorial-example-writing-and-deploying-a-hello-world-wsgi-application-9ziqy8 -4.5.6. Sinatra => sinatra-1hubto4 - -5. Deploying a WSGI (Python) application => deploying-a-wsgi-python-application-7aygdl - -5.1. Tutorial/example: writing and deploying a Hello World WSGI application => tutorial-example-writing-and-deploying-a-hello-world-wsgi-application-9ziqy8 - -5.2. Deploying to a virtual host’s root => deploying-to-a-virtual-host-s-root-zzo4v7 +4.2. Deploying to a virtual host’s root => deploying-to-a-virtual-host-s-root-u9bfax -5.3. Deploying to a sub URI => deploying-to-a-sub-uri-ayqz96 +4.3. Deploying to a sub URI => deploying-to-a-sub-uri-zekba6 -5.4. Redeploying (restarting the WSGI application) => redeploying-restarting-the-wsgi-application--na7pmf +4.4. Redeploying (restarting the WSGI application) => redeploying-restarting-the-wsgi-application--na7pmf -5.5. Sample passenger_wsgi.py for Django => sample-passenger-wsgi-py-for-django-slb9m8 +4.5. Sample passenger_wsgi.py for Django => sample-passenger-wsgi-py-for-django-slb9m8 -6. Deploying a Node.js application => deploying-a-node-js-application-882ecy +5. Deploying a Node.js application => deploying-a-node-js-application-882ecy -7. Deploying a Meteor application => deploying-a-meteor-application-mxfmir +6. Deploying a Meteor application => deploying-a-meteor-application-mxfmir -8. Configuring Phusion Passenger => configuring-phusion-passenger-11oztoe +7. Configuring Phusion Passenger => configuring-phusion-passenger-11oztoe -8.1. PassengerRoot => passengerroot-directory--sere8l +7.1. PassengerRoot => passengerroot-directory--sere8l -8.2. PassengerDefaultRuby => passengerdefaultruby-and-passengerruby-7zblp8 +7.2. PassengerDefaultRuby => passengerdefaultruby-and-passengerruby-7zblp8 -8.3. Deployment options => deployment-options-1unzrll +7.3. Deployment options => deployment-options-1unzrll -8.3.1. PassengerEnabled => passengerenabled-on-off--74rzth +7.3.1. PassengerEnabled => passengerenabled-on-off--74rzth -8.3.2. PassengerBaseURI => passengerbaseuri-uri--97i9mm +7.3.2. PassengerBaseURI => passengerbaseuri-uri--97i9mm -8.4. Application loading options => application-loading-options-1uedd4o +7.4. Application loading options => application-loading-options-1uedd4o -8.4.1. PassengerRuby => passengerruby-filename--1r3fv73 +7.4.1. PassengerRuby => passengerruby-filename--1r3fv73 -8.4.2. PassengerPython => passengerpython-filename--1ssesv3 +7.4.2. PassengerPython => passengerpython-filename--1ssesv3 -8.4.3. PassengerNodejs => passengernodejs-filename--2mjb1j +7.4.3. PassengerNodejs => passengernodejs-filename--2mjb1j -8.4.4. PassengerAppEnv => passengerappenv-string--s3ojlc +7.4.4. PassengerAppEnv => passengerappenv-string--s3ojlc -8.4.5. RailsEnv => railsenv-string--1b0xxvu +7.4.5. RailsEnv => railsenv-string--1b0xxvu -8.4.6. RackEnv => rackenv-string--vve9py +7.4.6. RackEnv => rackenv-string--vve9py -8.4.7. PassengerAppRoot => passengerapproot-path-to-root--uf24yd +7.4.7. PassengerAppRoot => passengerapproot-path-to-root--uf24yd -8.4.8. PassengerAppType => passengerapptype-name--62jzqf +7.4.8. PassengerAppType => passengerapptype-name--62jzqf -8.4.9. PassengerStartupFile => passengerstartupfile-filename--14vhvn9 +7.4.9. PassengerStartupFile => passengerstartupfile-filename--14vhvn9 -8.4.10. PassengerRestartDir => passengerrestartdir-directory--1fmhmv0 +7.4.10. PassengerRestartDir => passengerrestartdir-directory--1fmhmv0 -8.4.11. PassengerSpawnMethod => passengerspawnmethod-string--sodg2y +7.4.11. PassengerSpawnMethod => passengerspawnmethod-string--sodg2y -8.4.12. PassengerLoadShellEnvvars => passengerloadshellenvvars-on-off--1290yz1 +7.4.12. PassengerLoadShellEnvvars => passengerloadshellenvvars-on-off--1290yz1 -8.4.13. PassengerRollingRestarts => passengerrollingrestarts +7.4.13. PassengerRollingRestarts => passengerrollingrestarts -8.4.14. PassengerResistDeploymentErrors => passengerresistdeploymenterrors +7.4.14. PassengerResistDeploymentErrors => passengerresistdeploymenterrors -8.5. Security options => security-options-1pb75ho +7.5. Security options => security-options-1pb75ho -8.5.1. PassengerUserSwitching => passengeruserswitching +7.5.1. PassengerUserSwitching => passengeruserswitching -8.5.2. PassengerUser => passengeruser +7.5.2. PassengerUser => passengeruser -8.5.3. PassengerGroup => passengergroup +7.5.3. PassengerGroup => passengergroup -8.5.4. PassengerDefaultUser => passengerdefaultuser +7.5.4. PassengerDefaultUser => passengerdefaultuser -8.5.5. PassengerDefaultGroup => passengerdefaultgroup +7.5.5. PassengerDefaultGroup => passengerdefaultgroup -8.5.6. PassengerFriendlyErrorPages => passengerfriendlyerrorpages +7.5.6. PassengerFriendlyErrorPages => passengerfriendlyerrorpages -8.6. Resource control and optimization options => resource-control-and-optimization-options-zu2f7u +7.6. Resource control and optimization options => resource-control-and-optimization-options-zu2f7u -8.6.1. PassengerMaxPoolSize => passengermaxpoolsize-integer--am64q8 +7.6.1. PassengerMaxPoolSize => passengermaxpoolsize-integer--am64q8 -8.6.2. PassengerMinInstances => passengermininstances-integer--wegq6b +7.6.2. PassengerMinInstances => passengermininstances-integer--wegq6b -8.6.3. PassengerMaxInstances => passengermaxinstances +7.6.3. PassengerMaxInstances => passengermaxinstances -8.6.4. PassengerMaxInstancesPerApp => passengermaxinstancesperapp +7.6.4. PassengerMaxInstancesPerApp => passengermaxinstancesperapp -8.6.5. PassengerPoolIdleTime => passengerpoolidletime-integer--a3gunq +7.6.5. PassengerPoolIdleTime => passengerpoolidletime-integer--a3gunq -8.6.6. PassengerMaxPreloaderIdleTime => railsappspawneridletime-integer--1awgog1 +7.6.6. PassengerMaxPreloaderIdleTime => railsappspawneridletime-integer--1awgog1 -8.6.7. PassengerStartTimeout => passengerstarttimeout-seconds--ihnfku +7.6.7. PassengerStartTimeout => passengerstarttimeout-seconds--ihnfku -8.6.8. PassengerConcurrencyModel => passengerconcurrencymodel-process-thread--1eipofj +7.6.8. PassengerConcurrencyModel => passengerconcurrencymodel-process-thread--1eipofj -8.6.9. PassengerThreadCount => passengerthreadcount-number--10jl64a +7.6.9. PassengerThreadCount => passengerthreadcount-number--10jl64a -8.6.10. PassengerMaxRequests => passengermaxrequests-integer--17qkw9n +7.6.10. PassengerMaxRequests => passengermaxrequests-integer--17qkw9n -8.6.11. PassengerMaxRequestTime => passengermaxrequesttime-seconds--127v1i2 +7.6.11. PassengerMaxRequestTime => passengermaxrequesttime-seconds--127v1i2 -8.6.12. PassengerMemoryLimit => passengermemorylimit-integer--18irza1 +7.6.12. PassengerMemoryLimit => passengermemorylimit-integer--18irza1 -8.6.13. PassengerStatThrottleRate => passengerstatthrottlerate-integer--1dcfda3 +7.6.13. PassengerStatThrottleRate => passengerstatthrottlerate-integer--1dcfda3 -8.6.14. PassengerPreStart => passengerprestart-url--1utb57k +7.6.14. PassengerPreStart => passengerprestart-url--1utb57k -8.6.15. PassengerHighPerformance => passengerhighperformance-on-off--nvfa86 +7.6.15. PassengerHighPerformance => passengerhighperformance-on-off--nvfa86 -8.7. Connection handling options => connection-handling-options-1k3zd1a +7.7. Connection handling options => connection-handling-options-1k3zd1a -8.7.1. PassengerBufferUpload => passengerbufferupload-on-off--1lsjr93 +7.7.1. PassengerBufferUpload => passengerbufferupload-on-off--1lsjr93 -8.7.2. PassengerBufferResponse => passengerbufferresponse-on-off--1y7ilka +7.7.2. PassengerBufferResponse => passengerbufferresponse-on-off--1y7ilka -8.7.3. PassengerErrorOverride => passengererroroverride-on-off--1pq9nez +7.7.3. PassengerErrorOverride => passengererroroverride-on-off--1pq9nez -8.7.4. PassengerMaxRequestQueueSize => passenger-max-request-queue-size-number--1f1uocd +7.7.4. PassengerMaxRequestQueueSize => passenger-max-request-queue-size-number--1f1uocd -8.7.5. PassengerStickySessions => passengerstickysessions-on-off--fx1jkt +7.7.5. PassengerStickySessions => passengerstickysessions-on-off--fx1jkt -8.7.6. PassengerStickySessionsCookieName => passenger-sticky-sessions-cookie-name-stktkx +7.7.6. PassengerStickySessionsCookieName => passenger-sticky-sessions-cookie-name-stktkx -8.8. Compatibility options => compatibility-options-8jve5a +7.8. Compatibility options => compatibility-options-8jve5a -8.8.1. PassengerResolveSymlinksInDocumentRoot => passengerresolvesymlinksindocumentroot-on-off--1r0qcp8 +7.8.1. PassengerResolveSymlinksInDocumentRoot => passengerresolvesymlinksindocumentroot-on-off--1r0qcp8 -8.8.2. PassengerAllowEncodedSlashes => passengerallowencodedslashes-on-off--1y3s1ww +7.8.2. PassengerAllowEncodedSlashes => passengerallowencodedslashes-on-off--1y3s1ww -8.9. Logging and debugging options => logging-and-debugging-options-el2cuc +7.9. Logging and debugging options => logging-and-debugging-options-el2cuc -8.9.1. PassengerLogLevel => passengerloglevel-integer--s3kbil +7.9.1. PassengerLogLevel => passengerloglevel-integer--s3kbil -8.9.2. PassengerDebugLogFile => passengerdebuglogfile-filename--1wjm2j1 +7.9.2. PassengerDebugLogFile => passengerdebuglogfile-filename--1wjm2j1 -8.9.3. PassengerDebugger => passengerdebugger-on-off--19you7e +7.9.3. PassengerDebugger => passengerdebugger-on-off--19you7e -8.10. Advanced options => advanced-options-1ab1jkq +7.10. Advanced options => advanced-options-1ab1jkq -8.10.1. PassengerTempDir => passengertempdir-directory--68h2ng +7.10.1. PassengerTempDir => passengertempdir-directory--68h2ng -8.10.2. PassengerUploadBufferDir => passengeruploadbufferdir-directory--kdr8at +7.10.2. PassengerUploadBufferDir => passengeruploadbufferdir-directory--kdr8at -8.11. Deprecated or removed options => deprecated-options-pm9m57 +7.11. Deprecated or removed options => deprecated-options-pm9m57 -8.11.1. RailsRuby => railsruby-ht09ei +7.11.1. RailsRuby => railsruby-ht09ei -8.11.2. RailsBaseURI and RackBaseURI => railsbaseuri-uri--1txrw3k +7.11.2. RailsBaseURI and RackBaseURI => railsbaseuri-uri--1txrw3k -8.11.3. RailsUserSwitching => railsuserswitching-1npx8y4 +7.11.3. RailsUserSwitching => railsuserswitching-1npx8y4 -8.11.4. RailsDefaultUser => railsdefaultuser-19j7n3m +7.11.4. RailsDefaultUser => railsdefaultuser-19j7n3m -8.11.5. RailsAllowModRewrite => railsallowmodrewrite-1vkziro +7.11.5. RailsAllowModRewrite => railsallowmodrewrite-1vkziro -8.11.6. RailsSpawnMethod => railsspawnmethod-1aljgpa +7.11.6. RailsSpawnMethod => railsspawnmethod-1aljgpa -8.11.7. RailsAutoDetect, RackAutoDetect and WsgiAutoDetect => railsautodetect-rackautodetect-and-wsgiautodetect-1qgakzs +7.11.7. RailsAutoDetect, RackAutoDetect and WsgiAutoDetect => railsautodetect-rackautodetect-and-wsgiautodetect-1qgakzs -8.11.8. RailsAppSpawnerIdleTime => railsappspawneridletime-heh41r +7.11.8. RailsAppSpawnerIdleTime => railsappspawneridletime-heh41r -8.11.9. RailsFrameworkSpawnerIdleTime => railsframeworkspawneridletime-adcf9k +7.11.9. RailsFrameworkSpawnerIdleTime => railsframeworkspawneridletime-adcf9k -9. Troubleshooting => troubleshooting-2ihihi +8. Troubleshooting => troubleshooting-2ihihi -9.1. Generic troubleshooting tips => generic-troubleshooting-tips-130iuhe +8.1. Generic troubleshooting tips => generic-troubleshooting-tips-130iuhe -9.2. Why does the first request take a long time? => why-does-the-first-request-take-a-long-time--12mg452 +8.2. Why does the first request take a long time? => why-does-the-first-request-take-a-long-time--12mg452 -9.3. I get "command not found" when running a Phusion Passenger command through sudo => i-get-command-not-found-when-running-a-phusion-passenger-command-through-sudo-v9z223 +8.3. I get "command not found" when running a Phusion Passenger command through sudo => i-get-command-not-found-when-running-a-phusion-passenger-command-through-sudo-v9z223 -9.4. OS X: The installer cannot locate MAMP’s Apache => macos-x-the-installer-cannot-locate-mamp-s-apache-or908n +8.4. OS X: The installer cannot locate MAMP’s Apache => macos-x-the-installer-cannot-locate-mamp-s-apache-or908n -9.5. Apache reports a "403 Forbidden" error => apache-reports-a-403-forbidden-error-140tb4p +8.5. Apache reports a "403 Forbidden" error => apache-reports-a-403-forbidden-error-140tb4p -9.6. Static assets such as images and stylesheets aren’t being displayed => static-assets-such-as-images-and-stylesheets-aren-t-being-displayed-uaptpi +8.6. Static assets such as images and stylesheets aren’t being displayed => static-assets-such-as-images-and-stylesheets-aren-t-being-displayed-uaptpi -9.7. The Apache error log says that the spawn manager script does not exist, or that it does not have permission to execute it => the-apache-error-log-says-that-the-spawn-manager-script-does-not-exist-or-that-it-does-not-have-permission-to-execute-it-1fmoozk +8.7. The Apache error log says that the spawn manager script does not exist, or that it does not have permission to execute it => the-apache-error-log-says-that-the-spawn-manager-script-does-not-exist-or-that-it-does-not-have-permission-to-execute-it-1fmoozk -9.8. The application thinks its not on SSL even though it is => the-application-thinks-its-not-on-ssl-even-though-it-is-u9fcp1 +8.8. The application thinks its not on SSL even though it is => the-application-thinks-its-not-on-ssl-even-though-it-is-u9fcp1 -9.9. Ruby on Rails-specific troubleshooting => ruby-on-rails-specific-problems-6umss5 +8.9. Ruby on Rails-specific troubleshooting => ruby-on-rails-specific-problems-6umss5 -9.9.1. The "About your application’s environment" link does not work => the-about-your-application-s-environment-link-does-not-work-7k4tlm +8.9.1. The "About your application’s environment" link does not work => the-about-your-application-s-environment-link-does-not-work-7k4tlm -9.9.2. The Rails application reports that it’s unable to start because of a permission error => the-rails-application-reports-that-it-s-unable-to-start-because-of-a-permission-error-v53i6s +8.9.2. The Rails application reports that it’s unable to start because of a permission error => the-rails-application-reports-that-it-s-unable-to-start-because-of-a-permission-error-v53i6s -9.9.3. The Rails application’s log file is not being written to => my-rails-application-s-log-file-is-not-being-written-to-3i747l +8.9.3. The Rails application’s log file is not being written to => my-rails-application-s-log-file-is-not-being-written-to-3i747l -9.10. Conflicting Apache modules => conflicting-apache-modules-1uwpixk +8.10. Conflicting Apache modules => conflicting-apache-modules-1uwpixk -9.10.1. mod_userdir => mod-userdir-x5e2te +8.10.1. mod_userdir => mod-userdir-x5e2te -9.10.2. MultiViews (mod_negotiation) => multiviews-mod-negotiation--zchfg0 +8.10.2. MultiViews (mod_negotiation) => multiviews-mod-negotiation--zchfg0 -9.10.3. VirtualDocumentRoot => virtualdocumentroot-14cwd7l +8.10.3. VirtualDocumentRoot => virtualdocumentroot-14cwd7l -10. Analysis and system maintenance => analysis-and-system-maintenance-qvkwzr +9. Analysis and system maintenance => analysis-and-system-maintenance-qvkwzr -10.1. Inspecting memory usage => inspecting-memory-usage-1bkis6i +9.1. Inspecting memory usage => inspecting-memory-usage-1bkis6i -10.2. Inspecting Phusion Passenger’s internal status => inspecting-phusion-passenger-s-internal-status-ukekf7 +9.2. Inspecting Phusion Passenger’s internal status => inspecting-phusion-passenger-s-internal-status-ukekf7 -10.3. Debugging frozen applications => debugging-frozen-applications-1qsjqq7 +9.3. Debugging frozen applications => debugging-frozen-applications-1qsjqq7 -10.4. Accessing individual application processes => accessing-individual-application-processes-1p0j4jb +9.4. Accessing individual application processes => accessing-individual-application-processes-1p0j4jb -10.5. Attaching an IRB console to an application process => attaching-an-irb-console-to-an-application-process-1cma32j +9.5. Attaching an IRB console to an application process => attaching-an-irb-console-to-an-application-process-1cma32j -11. Tips => tips-19cwwf7 +10. Tips => tips-19cwwf7 -11.1. User Switching (security feature) => user-switching-security--8njx1x +10.1. User Switching (security feature) => user-switching-security--8njx1x -11.1.1. Requirements => requirements-yxvtxo +10.1.1. Requirements => requirements-yxvtxo -11.1.2. Effects => effects-1lko7vo +10.1.2. Effects => effects-1lko7vo -11.1.3. Caveats & troubleshooting => caveats-troubleshooting-161hgge +10.1.3. Caveats & troubleshooting => caveats-troubleshooting-161hgge -11.1.4. Finding out what user an application is running as => finding-out-what-user-an-application-is-running-as-7uwrol +10.1.4. Finding out what user an application is running as => finding-out-what-user-an-application-is-running-as-7uwrol -11.2. Copy-on-write memory support (reducing memory consumption of Ruby applications) => reducing-memory-consumption-of-ruby-on-rails-applications-by-33--1ubxnq0 +10.2. Copy-on-write memory support (reducing memory consumption of Ruby applications) => reducing-memory-consumption-of-ruby-on-rails-applications-by-33--1ubxnq0 -11.3. Capistrano recipe => capistrano-recipe-syzgo7 +10.3. Capistrano recipe => capistrano-recipe-syzgo7 -11.4. Bundler support => bundler-support-cf72ih +10.4. Bundler support => bundler-support-cf72ih -11.4.1. Does Phusion Passenger itself need to be added to the Gemfile? => does-phusion-passenger-itself-need-to-be-added-to-the-gemfile--17whimp +10.4.1. Does Phusion Passenger itself need to be added to the Gemfile? => does-phusion-passenger-itself-need-to-be-added-to-the-gemfile--17whimp -11.5. Installing multiple Ruby on Rails versions => installing-multiple-ruby-on-rails-versions-mi5j14 +10.5. Installing multiple Ruby on Rails versions => installing-multiple-ruby-on-rails-versions-mi5j14 -11.6. Making the application restart after each request => making-the-application-restart-after-each-request-183bezx +10.6. Making the application restart after each request => making-the-application-restart-after-each-request-183bezx -11.7. How to fix broken images/CSS/JavaScript URIs in sub-URI deployments => how-to-fix-broken-images-css-javascript-uris-in-sub-uri-deployments-a63b6r +10.7. How to fix broken images/CSS/JavaScript URIs in sub-URI deployments => how-to-fix-broken-images-css-javascript-uris-in-sub-uri-deployments-a63b6r -11.8. Out-of-Band Work and Out-of-Band Garbage Collection => out-of-band-work-and-out-of-band-garbage-collection-kav2p8 +10.8. Out-of-Band Work and Out-of-Band Garbage Collection => out-of-band-work-and-out-of-band-garbage-collection-kav2p8 -11.9. Hooks => hooks-bcltgp +10.9. Hooks => hooks-bcltgp -11.9.1. Example => example-icjf0z +10.9.1. Example => example-icjf0z -11.9.2. Environment => environment-1amls4v +10.9.2. Environment => environment-1amls4v -11.9.3. Blocking and concurrency => blocking-and-concurrency-cxpbyu +10.9.3. Blocking and concurrency => blocking-and-concurrency-cxpbyu -11.9.4. Error handling => error-handling-1a1uvod +10.9.4. Error handling => error-handling-1a1uvod -11.9.5. Compatibility => compatibility-18tl6g3 +10.9.5. Compatibility => compatibility-18tl6g3 -11.9.6. Available hooks => available-hooks-159anc3 +10.9.6. Available hooks => available-hooks-159anc3 -11.10. Flying Passenger => flying-passenger-q916f7 +10.10. Flying Passenger => flying-passenger-q916f7 -11.10.1. Requirements => requirements-1ntkin3 +10.10.1. Requirements => requirements-1ntkin3 -11.10.2. Basic usage => basic-usage-joifsk +10.10.2. Basic usage => basic-usage-joifsk -11.10.3. Configuring Flying Passenger => configuring-flying-passenger-1v35vgg +10.10.3. Configuring Flying Passenger => configuring-flying-passenger-1v35vgg -11.10.4. Managing the Flying Passenger daemon => managing-the-flying-passenger-daemon-1bng2bu +10.10.4. Managing the Flying Passenger daemon => managing-the-flying-passenger-daemon-1bng2bu -11.10.5. Using Flying Passenger with MRI 1.8 or JRuby => using-flying-passenger-with-mri-1-8-or-jruby-f5tbvs +10.10.5. Using Flying Passenger with MRI 1.8 or JRuby => using-flying-passenger-with-mri-1-8-or-jruby-f5tbvs -11.10.6. Caveats and limitations => caveats-and-limitations-lz3rbb +10.10.6. Caveats and limitations => caveats-and-limitations-lz3rbb -11.11. X-Sendfile support => x-sendfile-support-1cgyykw +10.11. X-Sendfile support => x-sendfile-support-1cgyykw -11.12. Upload progress => upload-progress-71cyl7 +10.12. Upload progress => upload-progress-71cyl7 -12. Under the hood => under-the-hood-21ue5t +11. Under the hood => under-the-hood-21ue5t -12.1. Page caching support => page-caching-support-kwq9b9 +11.1. Page caching support => page-caching-support-kwq9b9 -12.2. Phusion Passenger and its relationship with Ruby => phusion-passenger-and-its-relationship-with-ruby-1eq08ff +11.2. Phusion Passenger and its relationship with Ruby => phusion-passenger-and-its-relationship-with-ruby-1eq08ff -12.2.1. How Ruby is used => how-ruby-is-used-14r83nr +11.2.1. How Ruby is used => how-ruby-is-used-14r83nr -12.2.2. When the system has multiple Ruby interpreters => when-the-system-has-multiple-ruby-interpreters-10tm1fq +11.2.2. When the system has multiple Ruby interpreters => when-the-system-has-multiple-ruby-interpreters-10tm1fq -12.3. Static assets serving => static-assets-serving-wo2d9v +11.3. Static assets serving => static-assets-serving-wo2d9v -12.4. How Phusion Passenger detects whether a virtual host is a web application => how-phusion-passenger-detects-whether-a-virtual-host-is-a-web-application-179mp8m +11.4. How Phusion Passenger detects whether a virtual host is a web application => how-phusion-passenger-detects-whether-a-virtual-host-is-a-web-application-179mp8m -13. Appendix A: About this document => appendix-a-about-this-document-103toqs +12. Appendix A: About this document => appendix-a-about-this-document-103toqs -14. Appendix B: Terminology => appendix-b-terminology-h4eaf4 +13. Appendix B: Terminology => appendix-b-terminology-h4eaf4 -14.1. Application root => application-root-otx6xf +13.1. Application root => application-root-otx6xf -14.2. Idle process => idle-process-potb6g +13.2. Idle process => idle-process-potb6g -14.3. Inactive process => inactive-process-16gjv2e +13.3. Inactive process => inactive-process-16gjv2e -15. Appendix C: Spawning methods explained => appendix-c-spawning-methods-explained-owghi9 +14. Appendix C: Spawning methods explained => appendix-c-spawning-methods-explained-owghi9 -15.1. The most straightforward and traditional way: direct spawning => the-most-straightforward-and-traditional-way-conservative-spawning-1ybbli2 +14.1. The most straightforward and traditional way: direct spawning => the-most-straightforward-and-traditional-way-conservative-spawning-1ybbli2 -15.2. The smart spawning method => the-smart-spawning-method-1cvu9dd +14.2. The smart spawning method => the-smart-spawning-method-1cvu9dd -15.2.1. How it works => how-it-works-672zja +14.2.1. How it works => how-it-works-672zja -15.2.2. Summary of benefits => summary-of-benefits-1yrihfb +14.2.2. Summary of benefits => summary-of-benefits-1yrihfb -15.3. Smart spawning caveat #1: unintentional file descriptor sharing => smart-spawning-gotcha-1-unintentional-file-descriptor-sharing-z1y55l +14.3. Smart spawning caveat #1: unintentional file descriptor sharing => smart-spawning-gotcha-1-unintentional-file-descriptor-sharing-z1y55l -15.3.1. Example 1: Memcached connection sharing (harmful) => example-1-memcached-connection-sharing-harmful--c71wqw +14.3.1. Example 1: Memcached connection sharing (harmful) => example-1-memcached-connection-sharing-harmful--c71wqw -15.3.2. Example 2: Log file sharing (not harmful) => example-2-log-file-sharing-not-harmful--1p2yuol +14.3.2. Example 2: Log file sharing (not harmful) => example-2-log-file-sharing-not-harmful--1p2yuol -15.4. Smart spawning caveat #2: the need to revive threads => smart-spawning-gotcha-2-the-need-to-revive-threads-1k6cj7d +14.4. Smart spawning caveat #2: the need to revive threads => smart-spawning-gotcha-2-the-need-to-revive-threads-1k6cj7d -16. Appendix D: About environment variables => appendix-d-about-environment-variables-1lebv1u +15. Appendix D: About environment variables => appendix-d-about-environment-variables-1lebv1u -16.1. Working with environment variables => working-with-environment-variables-85e6aa +15.1. Working with environment variables => working-with-environment-variables-85e6aa -16.2. The PATH environment variable => the-path-environment-variable-p8e32r +15.2. The PATH environment variable => the-path-environment-variable-p8e32r -16.2.1. Adding Phusion Passenger’s administration tools to PATH => adding-phusion-passenger-s-administration-tools-to-path-xwppud +15.2.1. Adding Phusion Passenger’s administration tools to PATH => adding-phusion-passenger-s-administration-tools-to-path-xwppud -16.3. Making environment variables permanent => making-environment-variables-permanent-13x0l4h +15.3. Making environment variables permanent => making-environment-variables-permanent-13x0l4h -16.3.1. bash => bash-1pktn63 +15.3.1. bash => bash-1pktn63 -16.3.2. Apache => apache-15zqjvi +15.3.2. Apache => apache-15zqjvi -16.3.3. Nginx => nginx-l7ztbb +15.3.3. Nginx => nginx-l7ztbb -16.3.4. cron => cron-1kjp7ck +15.3.4. cron => cron-1kjp7ck -16.3.5. Phusion Passenger-served apps => phusion-passenger-served-apps-478vyt +15.3.5. Phusion Passenger-served apps => phusion-passenger-served-apps-478vyt -16.4. Environment variables and sudo => environment-variables-and-sudo-1odzcpz +15.4. Environment variables and sudo => environment-variables-and-sudo-1odzcpz diff --git a/doc/Users guide Apache.txt b/doc/Users guide Apache.txt index 37527cb6b0..49d0b94125 100644 --- a/doc/Users guide Apache.txt +++ b/doc/Users guide Apache.txt @@ -28,154 +28,7 @@ include::users_guide_snippets/support_information.txt[] include::users_guide_snippets/installation.txt[] -== Deploying a Ruby on Rails 1.x or 2.x (but NOT Rails >= 3.x) application == - -Suppose you have a Ruby on Rails application in '/webapps/mycook', and you own -the domain 'www.mycook.com'. You can either deploy your application to the -virtual host's root (i.e. the application will be accessible from the root URL, -'http://www.mycook.com/'), or in a sub URI (i.e. the application will be -accessible from a sub URL, such as 'http://www.mycook.com/railsapplication'). - -NOTE: The default `RAILS_ENV` environment in which deployed Rails applications -are run, is ``production''. You can change this by changing the -<> configuration option. - -=== Deploying to a virtual host's root === - -Add a virtual host entry to your Apache configuration file. Make sure that the -following conditions are met: - -- The virtual host's document root must point to your Ruby on Rails application's - 'public' folder. -- The Apache per-directory permissions must allow access to this folder. -- MultiViews must be disabled for this folder. - -For example: -------------------------------------------- - - ServerName www.mycook.com - DocumentRoot /webapps/mycook/public - - Allow from all - Options -MultiViews - # Uncomment this if you're on Apache >= 2.4: - #Require all granted - - -------------------------------------------- - -You may also need to tweak your file/folder permissions. Make sure that the -following folders are readable and executable by Apache: - - * this 'public' folder. - * the application's 'config' folder. - * all parent folders. That is, /webapps/mycook and /webapps must also be readable and executable by Apache. - -Then restart Apache. The application has now been deployed. - -[[deploying_rails_to_sub_uri]] -=== Deploying to a sub URI === - -Suppose that you already have a virtual host: - -------------------------------------------- - - ServerName www.phusion.nl - DocumentRoot /websites/phusion - - Allow from all - Options -MultiViews - # Uncomment this if you're on Apache >= 2.4: - #Require all granted - - -------------------------------------------- - -And you want your Rails application, located in `/websites/rails`, to be accessible from the URL -'http://www.phusion.nl/subapp'. - -To do this, you need to perform the following: - - 1. Set `Alias {SUBURI} {PATH TO YOUR APPLICATION'S PUBLIC DIRECTORY}`. - 2. Create a `` block. - 3. Inside the Location block, set `PassengerBaseURI /{SUBURI}`. - 4. Inside the Location block, set `PassengerAppRoot {PATH TO YOUR APPLICATION ROOT}`. - 5. Create a `` block. - 6. Inside the Directory block, set `Allow from all`, and (if you're on Apache >= 2.4) `Require all granted`. - 7. Inside the Directory block, disable MultiViews. - -Here is an example: - -------------------------------------------- - - ServerName www.phusion.nl - DocumentRoot /websites/phusion - - Allow from all - Options -MultiViews - # Uncomment this if you're on Apache >= 2.4: - #Require all granted - - - # These have been added: - Alias /subapp /websites/rails/public - - PassengerBaseURI /subapp - PassengerAppRoot /websites/rails - - - Allow from all - Options -MultiViews - # Uncomment this if you're on Apache >= 2.4: - #Require all granted - - -------------------------------------------- - -Then restart Apache. The application has now been deployed to the sub-URI. - -NOTE: If you're deploying to a sub-URI then please make sure that your view -templates correctly handles references to sub-URI static assets! Otherwise -you may find broken links to images, CSS files, JavaScripts, etc. Please read -<> -for more information. - -=== Redeploying (restarting the Ruby on Rails application) === - -Deploying a new version of a Ruby on Rails application is as simple as -re-uploading the application files, and restarting the application. - -There are two ways to restart the application: - -1. By restarting Apache. -2. By creating or modifying the file 'tmp/restart.txt' in the Rails - application's <>. Phusion Passenger will - automatically restart the application during the next request. - -For example, to restart our example MyCook application, we type this in the -command line: -------------------------------------------- -touch /webapps/mycook/tmp/restart.txt -------------------------------------------- - -Please note that, unlike earlier versions of Phusion Passenger, 'restart.txt' -is not automatically deleted. Phusion Passenger checks whether the timestamp -of this file has changed in order to determine whether the application should -be restarted. - -=== Migrations === - -Phusion Passenger is not related to Ruby on Rails migrations in any way. To -run migrations on your deployment server, please login to your deployment -server (e.g. with 'ssh') and type `rake db:migrate RAILS_ENV=production` in -a shell console, just like one would normally run migrations. - -=== Capistrano integration === - -See <>. - - -== Deploying a Rack-based Ruby application (including Rails >= 3) == +== Deploying a Rack-based Ruby application == Phusion Passenger supports arbitrary Ruby web applications that follow the link:http://rack.rubyforge.org/[Rack] interface. @@ -800,8 +653,7 @@ By default, Phusion Passenger autodetects the type of the application, e.g. whet Allowed values are: - * `rack` - Ruby on Rails >= 3.0 and Ruby Rack - * `classic-rails` - Ruby on Rails 1.x and 2.0 + * `rack` - Ruby and Rails * `wsgi` - Python * `node` - Node.js, or Meteor JS in bundled mode * `meteor` - Meteor JS in non-bundled mode diff --git a/doc/Users guide Nginx.idmap.txt b/doc/Users guide Nginx.idmap.txt index 03bf7a3880..c61c2b86f5 100644 --- a/doc/Users guide Nginx.idmap.txt +++ b/doc/Users guide Nginx.idmap.txt @@ -76,333 +76,321 @@ 2.15. Moving to a different directory => moving-to-a-different-directory-gif3wo -3. Deploying a Ruby on Rails 1.x or 2.x (but NOT Rails >= 3) application => deploying-a-ruby-on-rails-1-x-or-2-x-but-not-rails-3-application-b69gqa +3. Deploying a Rack-based Ruby application => deploying-a-rack-based-ruby-application-including-rails-3--12benx3 -3.1. Deploying to a virtual host’s root => deploying-to-a-virtual-host-s-root-1mh24z5 +3.1. Tutorial/example: writing and deploying a Hello World Rack application => tutorial-example-writing-and-deploying-a-hello-world-rack-application-1wstx99 -3.2. Deploying to a sub URI => deploying-to-a-sub-uri-1il2qj7 +3.2. Deploying to a virtual host’s root => deploying-to-a-virtual-host-s-root-1mh24z5 -3.3. Redeploying (restarting the Ruby on Rails application) => redeploying-restarting-the-ruby-on-rails-application--1eso761 +3.3. Deploying to a sub URI => deploying-to-a-sub-uri-1il2qj7 -3.4. Migrations => migrations-9yyb8w +3.4. Redeploying (restarting the Rack application) => redeploying-restarting-the-rack-application--xnbfam -3.5. Capistrano integration => capistrano-integration-1ktunm6 +3.5. Rackup specifications for various web frameworks => rackup-specifications-for-various-web-frameworks-1a2cs41 -4. Deploying a Rack-based Ruby application (including Rails >= 3) => deploying-a-rack-based-ruby-application-including-rails-3--12benx3 +3.5.1. Camping => camping-16vz2yb -4.1. Tutorial/example: writing and deploying a Hello World Rack application => tutorial-example-writing-and-deploying-a-hello-world-rack-application-1wstx99 +3.5.2. Halcyon => halcyon-1benlfl -4.2. Deploying to a virtual host’s root => deploying-to-a-virtual-host-s-root-f02erj - -4.3. Deploying to a sub URI => deploying-to-a-sub-uri-37q0ou - -4.4. Redeploying (restarting the Rack application) => redeploying-restarting-the-rack-application--xnbfam - -4.5. Rackup specifications for various web frameworks => rackup-specifications-for-various-web-frameworks-1a2cs41 +3.5.3. Mack => mack-1ezijq6 -4.5.1. Camping => camping-16vz2yb +3.5.4. Merb => merb-ddsh55 -4.5.2. Halcyon => halcyon-1benlfl +3.5.5. Ramaze => ramaze-1p2zod -4.5.3. Mack => mack-1ezijq6 +3.5.6. Sinatra => sinatra-a7u9ag -4.5.4. Merb => merb-ddsh55 +4. Deploying a WSGI (Python) application => deploying-a-wsgi-python-application-1or2efo -4.5.5. Ramaze => ramaze-1p2zod +4.1. Tutorial/example: writing and deploying a Hello World WSGI application => tutorial-example-writing-and-deploying-a-hello-world-wsgi-application-k5ron2 -4.5.6. Sinatra => sinatra-a7u9ag - -5. Deploying a WSGI (Python) application => deploying-a-wsgi-python-application-1or2efo - -5.1. Tutorial/example: writing and deploying a Hello World WSGI application => tutorial-example-writing-and-deploying-a-hello-world-wsgi-application-k5ron2 - -5.2. Deploying to a virtual host’s root => deploying-to-a-virtual-host-s-root-1chcpbj +4.2. Deploying to a virtual host’s root => deploying-to-a-virtual-host-s-root-f02erj -5.3. Deploying to a sub URI => deploying-to-a-sub-uri-5v6zmg +4.3. Deploying to a sub URI => deploying-to-a-sub-uri-37q0ou -5.4. Redeploying (restarting the WSGI application) => redeploying-restarting-the-wsgi-application--10zdh2k +4.4. Redeploying (restarting the WSGI application) => redeploying-restarting-the-wsgi-application--10zdh2k -5.5. Sample passenger_wsgi.py for Django => sample-passenger-wsgi-py-for-django-1cvndls +4.5. Sample passenger_wsgi.py for Django => sample-passenger-wsgi-py-for-django-1cvndls -6. Deploying a Node.js application => deploying-a-node-js-application-15wbczd +5. Deploying a Node.js application => deploying-a-node-js-application-15wbczd -7. Deploying a Meteor application => deploying-a-meteor-application-1b51wl9 +6. Deploying a Meteor application => deploying-a-meteor-application-1b51wl9 -8. Configuring Phusion Passenger => configuring-phusion-passenger-1g1svey +7. Configuring Phusion Passenger => configuring-phusion-passenger-1g1svey -8.1. passenger_root => passenger-root-directory--bqvhhz +7.1. passenger_root => passenger-root-directory--bqvhhz -8.2. Deployment options => deployment-options-1a1vxsp +7.2. Deployment options => deployment-options-1a1vxsp -8.2.1. passenger_enabled => passenger-enabled-on-off--1rpb2t7 +7.2.1. passenger_enabled => passenger-enabled-on-off--1rpb2t7 -8.2.2. passenger_base_uri => passenger-base-uri-uri--1xtuo50 +7.2.2. passenger_base_uri => passenger-base-uri-uri--1xtuo50 -8.2.3. passenger_document_root => passenger-document-root-path--1pge8kd +7.2.3. passenger_document_root => passenger-document-root-path--1pge8kd -8.3. Application loading options => application-loading-options-f3skts +7.3. Application loading options => application-loading-options-f3skts -8.3.1. passenger_ruby => passenger-ruby-filename--1gnok5k +7.3.1. passenger_ruby => passenger-ruby-filename--1gnok5k -8.3.2. passenger_python => passenger-python-filename--14p554 +7.3.2. passenger_python => passenger-python-filename--14p554 -8.3.3. passenger_nodejs => passenger-nodejs-filename--16hzjsv +7.3.3. passenger_nodejs => passenger-nodejs-filename--16hzjsv -8.3.4. passenger_app_env => passenger-app-env-string--qjeimp +7.3.4. passenger_app_env => passenger-app-env-string--qjeimp -8.3.5. rails_env => rails-env-string--jlh7v9 +7.3.5. rails_env => rails-env-string--jlh7v9 -8.3.6. rack_env => rack-env-string--tqmrt0 +7.3.6. rack_env => rack-env-string--tqmrt0 -8.3.7. passenger_app_root => passenger-app-root-path-to-root--1dbudc6 +7.3.7. passenger_app_root => passenger-app-root-path-to-root--1dbudc6 -8.3.8. passenger_app_type => passenger-app-type-name--g9zccv +7.3.8. passenger_app_type => passenger-app-type-name--g9zccv -8.3.9. passenger_startup_file => passenger-startup-file-filename--y4gy1m +7.3.9. passenger_startup_file => passenger-startup-file-filename--y4gy1m -8.3.10. passenger_spawn_method => passenger-spawn-method-string--1sc6njl +7.3.10. passenger_spawn_method => passenger-spawn-method-string--1sc6njl -8.3.11. passenger_load_shell_envvars => passenger-load-shell-envvars-on-off--fw5u4l +7.3.11. passenger_load_shell_envvars => passenger-load-shell-envvars-on-off--fw5u4l -8.3.12. passenger_rolling_restarts => passenger-rolling-restarts +7.3.12. passenger_rolling_restarts => passenger-rolling-restarts -8.3.13. passenger_resist_deployment_errors => passenger-resist-deployment-errors-on-off--k9yf1 +7.3.13. passenger_resist_deployment_errors => passenger-resist-deployment-errors-on-off--k9yf1 -8.4. Security options => security-options-1bv93g4 +7.4. Security options => security-options-1bv93g4 -8.4.1. passenger_user_switching => passenger-user-switching-on-off--1p37u3l +7.4.1. passenger_user_switching => passenger-user-switching-on-off--1p37u3l -8.4.2. passenger_user => passenger-user-username--b06ur7 +7.4.2. passenger_user => passenger-user-username--b06ur7 -8.4.3. passenger_group => passenger-user-group-name--1fco4j7 +7.4.3. passenger_group => passenger-user-group-name--1fco4j7 -8.4.4. passenger_default_user => passenger-default-user-username--1h6cdmf +7.4.4. passenger_default_user => passenger-default-user-username--1h6cdmf -8.4.5. Passenger_default_group => passenger-default-group-group-name--1qxn2qa +7.4.5. Passenger_default_group => passenger-default-group-group-name--1qxn2qa -8.4.6. passenger_show_version_in_header => passenger-show-version-in-header-on-off--2h49av +7.4.6. passenger_show_version_in_header => passenger-show-version-in-header-on-off--2h49av -8.4.7. passenger_friendly_error_pages => passenger-friendly-error-pages-on-off--1ti1a0e +7.4.7. passenger_friendly_error_pages => passenger-friendly-error-pages-on-off--1ti1a0e -8.5. Resource control and optimization options => resource-control-and-optimization-options-xd7evs +7.5. Resource control and optimization options => resource-control-and-optimization-options-xd7evs -8.5.1. passenger_max_pool_size => passenger-max-pool-size-integer--3jzefs +7.5.1. passenger_max_pool_size => passenger-max-pool-size-integer--3jzefs -8.5.2. passenger_min_instances => passenger-min-instances-integer--uclykt +7.5.2. passenger_min_instances => passenger-min-instances-integer--uclykt -8.5.3. passenger_max_instances => passenger-max-instances +7.5.3. passenger_max_instances => passenger-max-instances -8.5.4. passenger_max_instances_per_app => passenger-max-instances-per-app-integer--1xhbbne +7.5.4. passenger_max_instances_per_app => passenger-max-instances-per-app-integer--1xhbbne -8.5.5. passenger_pool_idle_time => passenger-pool-idle-time-integer--xcw65o +7.5.5. passenger_pool_idle_time => passenger-pool-idle-time-integer--xcw65o -8.5.6. passenger_max_preloader_idle_time => rails-app-spawner-idle-time-integer--1xjqe4b +7.5.6. passenger_max_preloader_idle_time => rails-app-spawner-idle-time-integer--1xjqe4b -8.5.7. passenger_start_timeout => passenger-start-timeout-seconds--8xn504 +7.5.7. passenger_start_timeout => passenger-start-timeout-seconds--8xn504 -8.5.8. passenger_concurrency_model => passenger-concurrency-model-process-thread--brcvkk +7.5.8. passenger_concurrency_model => passenger-concurrency-model-process-thread--brcvkk -8.5.9. passenger_thread_count => passenger-thread-count-number--1kd6ffy +7.5.9. passenger_thread_count => passenger-thread-count-number--1kd6ffy -8.5.10. passenger_max_requests => passenger-max-requests-integer--sgzint +7.5.10. passenger_max_requests => passenger-max-requests-integer--sgzint -8.5.11. passenger_max_request_time => passenger-max-request-time-seconds--1htog2g +7.5.11. passenger_max_request_time => passenger-max-request-time-seconds--1htog2g -8.5.12. passenger_memory_limit => passenger-memory-limit-integer--1ry7dwx +7.5.12. passenger_memory_limit => passenger-memory-limit-integer--1ry7dwx -8.5.13. passenger_pre_start => passenger-pre-start-url--npldeb +7.5.13. passenger_pre_start => passenger-pre-start-url--npldeb -8.6. Connection handling options => connection-handling-options-8jgq90 +7.6. Connection handling options => connection-handling-options-8jgq90 -8.6.1. passenger_set_cgi_param => passenger-set-cgi-param-cgi-environment-name-value--rx9gc0 +7.6.1. passenger_set_cgi_param => passenger-set-cgi-param-cgi-environment-name-value--rx9gc0 -8.6.2. passenger_max_request_queue_size => passenger-max-request-queue-size-number--i0te1b +7.6.2. passenger_max_request_queue_size => passenger-max-request-queue-size-number--i0te1b -8.6.3. passenger_request_queue_overflow_status_code => passenger-request-queue-overflow-status-code-code--1wcwuxl +7.6.3. passenger_request_queue_overflow_status_code => passenger-request-queue-overflow-status-code-code--1wcwuxl -8.6.4. passenger_sticky_sessions => passenger-sticky-sessions-on-off--lwvbxs +7.6.4. passenger_sticky_sessions => passenger-sticky-sessions-on-off--lwvbxs -8.6.5. passenger_sticky_sessions_cookie_name => passenger-sticky-sessions-cookie-name-8hrox9 +7.6.5. passenger_sticky_sessions_cookie_name => passenger-sticky-sessions-cookie-name-8hrox9 -8.6.6. passenger_ignore_client_abort => passenger-ignore-client-abort +7.6.6. passenger_ignore_client_abort => passenger-ignore-client-abort -8.6.7. passenger_intercept_errors => passenger-intercept-errors-1uvcb9x +7.6.7. passenger_intercept_errors => passenger-intercept-errors-1uvcb9x -8.6.8. passenger_pass_header
=> passenger-pass-header-header-name--1cg31je +7.6.8. passenger_pass_header
=> passenger-pass-header-header-name--1cg31je -8.6.9. passenger_buffer_response => passenger-buffer-response +7.6.9. passenger_buffer_response => passenger-buffer-response -8.6.10. passenger_buffer_size => passenger-buffer-size-1jfkq87 +7.6.10. passenger_buffer_size => passenger-buffer-size-1jfkq87 -8.6.11. passenger_buffers => passenger-busy-buffers +7.6.11. passenger_buffers => passenger-busy-buffers -8.6.12. passenger_busy_buffer_size => passenger-busy-buffer-size-124sj61 +7.6.12. passenger_busy_buffer_size => passenger-busy-buffer-size-124sj61 -8.7. Logging and debugging options => logging-and-debugging-options-14e91ni +7.7. Logging and debugging options => logging-and-debugging-options-14e91ni -8.7.1. passenger_log_level => passenger-log-level-integer--17snhon +7.7.1. passenger_log_level => passenger-log-level-integer--17snhon -8.7.2. passenger_debug_log_file => passenger-debug-log-file-filename--21ubaj +7.7.2. passenger_debug_log_file => passenger-debug-log-file-filename--21ubaj -8.7.3. passenger_debugger => passenger-debugger-on-off--1wkuq85 +7.7.3. passenger_debugger => passenger-debugger-on-off--1wkuq85 -8.8. Advanced options => advanced-options-hnuhqz +7.8. Advanced options => advanced-options-hnuhqz -8.8.1. passenger_temp_dir => passenger-temp-dir-directory--1t3opri +7.8.1. passenger_temp_dir => passenger-temp-dir-directory--1t3opri -8.8.2. passenger_fly_with => passenger-fly-with-socket-filename--1amd1xn +7.8.2. passenger_fly_with => passenger-fly-with-socket-filename--1amd1xn -8.9. Deprecated options => deprecated-options-1dtzo0g +7.9. Deprecated options => deprecated-options-1dtzo0g -8.9.1. rails_spawn_method => rails-spawn-method-17vdnpt +7.9.1. rails_spawn_method => rails-spawn-method-17vdnpt -9. Troubleshooting => troubleshooting-1pt0c76 +8. Troubleshooting => troubleshooting-1pt0c76 -9.1. Generic troubleshooting tips => generic-troubleshooting-tips-xhe4nu +8.1. Generic troubleshooting tips => generic-troubleshooting-tips-xhe4nu -9.2. Why does the first request take a long time? => why-does-the-first-request-take-a-long-time--1knj9fp +8.2. Why does the first request take a long time? => why-does-the-first-request-take-a-long-time--1knj9fp -9.3. Upon accessing the web app, Nginx reports a "Permission denied" error => upon-accessing-the-web-app-nginx-reports-a-permission-denied-error-1wgatlk +8.3. Upon accessing the web app, Nginx reports a "Permission denied" error => upon-accessing-the-web-app-nginx-reports-a-permission-denied-error-1wgatlk -9.4. I get "command not found" when running a Phusion Passenger command through sudo => i-get-command-not-found-when-running-a-phusion-passenger-command-through-sudo-10fzwno +8.4. I get "command not found" when running a Phusion Passenger command through sudo => i-get-command-not-found-when-running-a-phusion-passenger-command-through-sudo-10fzwno -9.5. The application thinks its not on SSL even though it is => the-application-thinks-its-not-on-ssl-even-though-it-is-1e2m21h +8.5. The application thinks its not on SSL even though it is => the-application-thinks-its-not-on-ssl-even-though-it-is-1e2m21h -9.6. Ruby on Rails-specific troubleshooting => ruby-on-rails-specific-troubleshooting-n8u5u1 +8.6. Ruby on Rails-specific troubleshooting => ruby-on-rails-specific-troubleshooting-n8u5u1 -9.6.1. The "About your application’s environment" link does not work => the-about-your-application-s-environment-link-does-not-work-9p7b2g +8.6.1. The "About your application’s environment" link does not work => the-about-your-application-s-environment-link-does-not-work-9p7b2g -9.6.2. The Rails application reports that it’s unable to start because of a permission error => the-rails-application-reports-that-it-s-unable-to-start-because-of-a-permission-error-58ww8s +8.6.2. The Rails application reports that it’s unable to start because of a permission error => the-rails-application-reports-that-it-s-unable-to-start-because-of-a-permission-error-58ww8s -9.6.3. The Rails application’s log file is not being written to => the-rails-application-s-log-file-is-not-being-written-to-9m2i5h +8.6.3. The Rails application’s log file is not being written to => the-rails-application-s-log-file-is-not-being-written-to-9m2i5h -10. Analysis and system maintenance => analysis-and-system-maintenance-1nnlnj8 +9. Analysis and system maintenance => analysis-and-system-maintenance-1nnlnj8 -10.1. Inspecting memory usage => inspecting-memory-usage-1k6y8v0 +9.1. Inspecting memory usage => inspecting-memory-usage-1k6y8v0 -10.2. Inspecting Phusion Passenger’s internal status => inspecting-phusion-passenger-s-internal-status-v36wbc +9.2. Inspecting Phusion Passenger’s internal status => inspecting-phusion-passenger-s-internal-status-v36wbc -10.3. Debugging frozen applications => debugging-frozen-applications-qoctl8 +9.3. Debugging frozen applications => debugging-frozen-applications-qoctl8 -10.4. Accessing individual application processes => accessing-individual-application-processes-1qe4fqk +9.4. Accessing individual application processes => accessing-individual-application-processes-1qe4fqk -10.5. Attaching an IRB console to an application process => attaching-an-irb-console-to-an-application-process-d36enw +9.5. Attaching an IRB console to an application process => attaching-an-irb-console-to-an-application-process-d36enw -11. Tips => tips-n4c22d +10. Tips => tips-n4c22d -11.1. User Switching (security feature) => user-switching-security--zmsy9o +10.1. User Switching (security feature) => user-switching-security--zmsy9o -11.1.1. Requirements => requirements-15ozqdj +10.1.1. Requirements => requirements-15ozqdj -11.1.2. Effects => effects-nd2m44 +10.1.2. Effects => effects-nd2m44 -11.1.3. Caveats & troubleshooting => caveats-troubleshooting-mbw582 +10.1.3. Caveats & troubleshooting => caveats-troubleshooting-mbw582 -11.1.4. Finding out what user an application is running as => finding-out-what-user-an-application-is-running-as-1ni7zk6 +10.1.4. Finding out what user an application is running as => finding-out-what-user-an-application-is-running-as-1ni7zk6 -11.2. Copy-on-write memory support (reducing memory consumption of Ruby applications) => reducing-memory-consumption-of-ruby-on-rails-applications-by-33--1o3z66q +10.2. Copy-on-write memory support (reducing memory consumption of Ruby applications) => reducing-memory-consumption-of-ruby-on-rails-applications-by-33--1o3z66q -11.3. Capistrano recipe => capistrano-recipe-pfn4qu +10.3. Capistrano recipe => capistrano-recipe-pfn4qu -11.4. Bundler support => bundler-support-19v1h43 +10.4. Bundler support => bundler-support-19v1h43 -11.4.1. Does Phusion Passenger itself need to be added to the Gemfile? => does-phusion-passenger-itself-need-to-be-added-to-the-gemfile--xn1a11 +10.4.1. Does Phusion Passenger itself need to be added to the Gemfile? => does-phusion-passenger-itself-need-to-be-added-to-the-gemfile--xn1a11 -11.5. Installing multiple Ruby on Rails versions => installing-multiple-ruby-on-rails-versions-1bp1fff +10.5. Installing multiple Ruby on Rails versions => installing-multiple-ruby-on-rails-versions-1bp1fff -11.6. Making the application restart after each request => making-the-application-restart-after-each-request-vimy48 +10.6. Making the application restart after each request => making-the-application-restart-after-each-request-vimy48 -11.7. How to fix broken images/CSS/JavaScript URIs in sub-URI deployments => how-to-fix-broken-images-css-javascript-uris-in-sub-uri-deployments-11mzwt6 +10.7. How to fix broken images/CSS/JavaScript URIs in sub-URI deployments => how-to-fix-broken-images-css-javascript-uris-in-sub-uri-deployments-11mzwt6 -11.8. Out-of-Band Work and Out-of-Band Garbage Collection => out-of-band-work-and-out-of-band-garbage-collection-v89lu2 +10.8. Out-of-Band Work and Out-of-Band Garbage Collection => out-of-band-work-and-out-of-band-garbage-collection-v89lu2 -11.9. Hooks => hooks-qrxle1 +10.9. Hooks => hooks-qrxle1 -11.9.1. Example => example-1orara9 +10.9.1. Example => example-1orara9 -11.9.2. Environment => environment-10uhg8m +10.9.2. Environment => environment-10uhg8m -11.9.3. Blocking and concurrency => blocking-and-concurrency-g5njp1 +10.9.3. Blocking and concurrency => blocking-and-concurrency-g5njp1 -11.9.4. Error handling => error-handling-m78oxs +10.9.4. Error handling => error-handling-m78oxs -11.9.5. Compatibility => compatibility-132b3ns +10.9.5. Compatibility => compatibility-132b3ns -11.9.6. Available hooks => available-hooks-11w1prq +10.9.6. Available hooks => available-hooks-11w1prq -11.10. Flying Passenger => flying-passenger-137qg5e +10.10. Flying Passenger => flying-passenger-137qg5e -11.10.1. Requirements => requirements-194ysj6 +10.10.1. Requirements => requirements-194ysj6 -11.10.2. Basic usage => basic-usage-1qtgvwx +10.10.2. Basic usage => basic-usage-1qtgvwx -11.10.3. Configuring Flying Passenger => configuring-flying-passenger-n558np +10.10.3. Configuring Flying Passenger => configuring-flying-passenger-n558np -11.10.4. Managing the Flying Passenger daemon => managing-the-flying-passenger-daemon-vjmzdh +10.10.4. Managing the Flying Passenger daemon => managing-the-flying-passenger-daemon-vjmzdh -11.10.5. Using Flying Passenger with MRI 1.8 or JRuby => using-flying-passenger-with-mri-1-8-or-jruby-pxho35 +10.10.5. Using Flying Passenger with MRI 1.8 or JRuby => using-flying-passenger-with-mri-1-8-or-jruby-pxho35 -11.10.6. Caveats and limitations => caveats-and-limitations-15wakf +10.10.6. Caveats and limitations => caveats-and-limitations-15wakf -12. Under the hood => under-the-hood-8uney +11. Under the hood => under-the-hood-8uney -12.1. Page caching support => page-caching-support-nafhf6 +11.1. Page caching support => page-caching-support-nafhf6 -12.2. Phusion Passenger and its relationship with Ruby => phusion-passenger-and-its-relationship-with-ruby-1hub1pa +11.2. Phusion Passenger and its relationship with Ruby => phusion-passenger-and-its-relationship-with-ruby-1hub1pa -12.2.1. How Ruby is used => how-ruby-is-used-j7g2a4 +11.2.1. How Ruby is used => how-ruby-is-used-j7g2a4 -12.2.2. When the system has multiple Ruby interpreters => when-the-system-has-multiple-ruby-interpreters-fwn3t +11.2.2. When the system has multiple Ruby interpreters => when-the-system-has-multiple-ruby-interpreters-fwn3t -12.3. How Phusion Passenger detects whether a virtual host is a web application => how-phusion-passenger-detects-whether-a-virtual-host-is-a-web-application-13qbmhn +11.3. How Phusion Passenger detects whether a virtual host is a web application => how-phusion-passenger-detects-whether-a-virtual-host-is-a-web-application-13qbmhn -13. Appendix A: About this document => appendix-a-about-this-document-zfvixm +12. Appendix A: About this document => appendix-a-about-this-document-zfvixm -14. Appendix B: Terminology => appendix-b-terminology-wzv5ro +13. Appendix B: Terminology => appendix-b-terminology-wzv5ro -14.1. Application root => application-root-1fd6bqv +13.1. Application root => application-root-1fd6bqv -14.2. Idle process => idle-process-13byfw9 +13.2. Idle process => idle-process-13byfw9 -14.3. Inactive process => inactive-process-1d2h0po +13.3. Inactive process => inactive-process-1d2h0po -15. Appendix C: Spawning methods explained => appendix-c-spawning-methods-explained-tcp8e6 +14. Appendix C: Spawning methods explained => appendix-c-spawning-methods-explained-tcp8e6 -15.1. The most straightforward and traditional way: direct spawning => the-most-straightforward-and-traditional-way-conservative-spawning-civ29z +14.1. The most straightforward and traditional way: direct spawning => the-most-straightforward-and-traditional-way-conservative-spawning-civ29z -15.2. The smart spawning method => the-smart-spawning-method-7nhgtj +14.2. The smart spawning method => the-smart-spawning-method-7nhgtj -15.2.1. How it works => how-it-works-f9umga +14.2.1. How it works => how-it-works-f9umga -15.2.2. Summary of benefits => summary-of-benefits-qovyvk +14.2.2. Summary of benefits => summary-of-benefits-qovyvk -15.3. Smart spawning caveat #1: unintentional file descriptor sharing => smart-spawning-gotcha-1-unintentional-file-descriptor-sharing-cebw6q +14.3. Smart spawning caveat #1: unintentional file descriptor sharing => smart-spawning-gotcha-1-unintentional-file-descriptor-sharing-cebw6q -15.3.1. Example 1: Memcached connection sharing (harmful) => example-1-memcached-connection-sharing-harmful--1wfs3ad +14.3.1. Example 1: Memcached connection sharing (harmful) => example-1-memcached-connection-sharing-harmful--1wfs3ad -15.3.2. Example 2: Log file sharing (not harmful) => example-2-log-file-sharing-not-harmful--ox4yfy +14.3.2. Example 2: Log file sharing (not harmful) => example-2-log-file-sharing-not-harmful--ox4yfy -15.4. Smart spawning caveat #2: the need to revive threads => smart-spawning-gotcha-2-the-need-to-revive-threads-1ey176o +14.4. Smart spawning caveat #2: the need to revive threads => smart-spawning-gotcha-2-the-need-to-revive-threads-1ey176o -16. Appendix D: About environment variables => appendix-d-about-environment-variables-1t2cuff +15. Appendix D: About environment variables => appendix-d-about-environment-variables-1t2cuff -16.1. Working with environment variables => working-with-environment-variables-1kmvq8w +15.1. Working with environment variables => working-with-environment-variables-1kmvq8w -16.2. The PATH environment variable => the-path-environment-variable-vlp05e +15.2. The PATH environment variable => the-path-environment-variable-vlp05e -16.2.1. Adding Phusion Passenger’s administration tools to PATH => adding-phusion-passenger-s-administration-tools-to-path-1flz2tu +15.2.1. Adding Phusion Passenger’s administration tools to PATH => adding-phusion-passenger-s-administration-tools-to-path-1flz2tu -16.3. Making environment variables permanent => making-environment-variables-permanent-1wjyhzt +15.3. Making environment variables permanent => making-environment-variables-permanent-1wjyhzt -16.3.1. bash => bash-19xsxec +15.3.1. bash => bash-19xsxec -16.3.2. Apache => apache-9hqtyj +15.3.2. Apache => apache-9hqtyj -16.3.3. Nginx => nginx-157dpwy +15.3.3. Nginx => nginx-157dpwy -16.3.4. cron => cron-1nuc9cz +15.3.4. cron => cron-1nuc9cz -16.3.5. Phusion Passenger-served apps => phusion-passenger-served-apps-uiewl5 +15.3.5. Phusion Passenger-served apps => phusion-passenger-served-apps-uiewl5 -16.4. Environment variables and sudo => environment-variables-and-sudo-10lphxn +15.4. Environment variables and sudo => environment-variables-and-sudo-10lphxn diff --git a/doc/Users guide Nginx.txt b/doc/Users guide Nginx.txt index 26cc0ed425..a05df1b51a 100644 --- a/doc/Users guide Nginx.txt +++ b/doc/Users guide Nginx.txt @@ -27,139 +27,8 @@ include::users_guide_snippets/support_information.txt[] include::users_guide_snippets/installation.txt[] -[[deploying_a_ror_app]] -== Deploying a Ruby on Rails 1.x or 2.x (but NOT Rails >= 3) application == - -Suppose you have a Ruby on Rails application in '/webapps/mycook', and you own -the domain 'www.mycook.com'. You can either deploy your application to the -virtual host's root (i.e. the application will be accessible from the root URL, -'http://www.mycook.com/'), or in a sub URI (i.e. the application will be -accessible from a sub URL, such as 'http://www.mycook.com/railsapplication'). - -NOTE: The default `RAILS_ENV` environment in which deployed Rails applications -are run, is ``production''. You can change this by changing the -<> configuration option. - -=== Deploying to a virtual host's root === - -Add a 'server' virtual host entry to your Nginx configuration file. The virtual -host's root must point to your Ruby on Rails application's 'public' folder. - -Inside the 'server' block, set 'passenger_enabled on'. - -For example: -------------------------------------------- -http { - ... - - server { - listen 80; - server_name www.mycook.com; - root /webapps/mycook/public; - passenger_enabled on; - } - - ... -} -------------------------------------------- -Then restart Nginx. The application has now been deployed. - -[[deploying_rails_to_sub_uri]] -=== Deploying to a sub URI === - -Suppose that you already have a virtual host for the application `/websites/phusion`: - -------------------------------------------- -http { - ... - - server { - listen 80; - server_name www.phusion.nl; - root /websites/phusion; - passenger_enabled on; - } - - ... -} -------------------------------------------- - -And you want your Rails application, located in `/websites/rails`, to be accessible from the URL -'http://www.phusion.nl/subapp'. - -To do this, you need to perform the following: - - 1. Create a `location` with parameter `~ ^/(/.*|$)`. This is a regular expression that says: "match everything that is exactly , or starts with /". - 2. Inside the location block, set `alias $1`. - 3. Inside the location block, set `passenger_base_uri `. - 4. Inside the location block, set `passenger_app_root `. - 5. Inside the location block, set `passenger_document_root `. - 6. Inside the location block, re-specify `passenger_enabled on`. - -Here is an example: - -------------------------------------------- -http { - ... - - server { - listen 80; - server_name www.phusion.nl; - root /websites/phusion; - - # This block has been added. - location ~ ^/subapp(/.*|$) { - alias /websites/rails/public$1; # <-- be sure to point to 'public'! - passenger_base_uri /subapp; - passenger_app_root /websites/rails; - passenger_document_root /websites/rails/public; - passenger_enabled on; - } - } - - ... -} -------------------------------------------- - -Then restart Nginx. The application has now been deployed on the sub-URI. - -=== Redeploying (restarting the Ruby on Rails application) === - -Deploying a new version of a Ruby on Rails application is as simple as -re-uploading the application files, and restarting the application. - -There are two ways to restart the application: - -1. By restarting Nginx. -2. By creating or modifying the file 'tmp/restart.txt' in the Rails - application's <>. Phusion Passenger will - automatically restart the application during the next request. - -For example, to restart our example MyCook application, we type this in the -command line: -------------------------------------------- -touch /webapps/mycook/tmp/restart.txt -------------------------------------------- - -Please note that, unlike earlier versions of Phusion Passenger, 'restart.txt' -is not automatically deleted. Phusion Passenger checks whether the timestamp -of this file has changed in order to determine whether the application should -be restarted. - -=== Migrations === - -Phusion Passenger is not related to Ruby on Rails migrations in any way. To -run migrations on your deployment server, please login to your deployment -server (e.g. with 'ssh') and type `rake db:migrate RAILS_ENV=production` in -a shell console, just like one would normally run migrations. - -=== Capistrano integration === - -See <>. - - [[deploying_a_rack_app]] -== Deploying a Rack-based Ruby application (including Rails >= 3) == +== Deploying a Rack-based Ruby application == Phusion Passenger supports arbitrary Ruby web applications that follow the link:http://rack.rubyforge.org/[Rack] interface. @@ -776,8 +645,7 @@ By default, Phusion Passenger autodetects the type of the application, e.g. whet Allowed values are: - * `rack` - Ruby on Rails >= 3.0 and Ruby Rack - * `classic-rails` - Ruby on Rails 1.x and 2.0 + * `rack` - Ruby and Rails * `wsgi` - Python * `node` - Node.js, or Meteor JS in bundled mode * `meteor` - Meteor JS in non-bundled mode diff --git a/doc/users_guide_snippets/support_information.txt b/doc/users_guide_snippets/support_information.txt index a0d91fa6ab..7a4ffef513 100644 --- a/doc/users_guide_snippets/support_information.txt +++ b/doc/users_guide_snippets/support_information.txt @@ -38,7 +38,7 @@ Supported languages and frameworks: | Ruby (MRI) | 1.8.5 | JRuby | 1.7.0 | Rubinius | 2.2.0 -| Ruby on Rails | 1.2 +| Ruby on Rails | 2.3 | Python | 2.6 | Node.js | 0.10 | Meteor | 0.6 diff --git a/ext/common/ApplicationPool2/AppTypes.cpp b/ext/common/ApplicationPool2/AppTypes.cpp index 356dce77f4..e6896e2e35 100644 --- a/ext/common/ApplicationPool2/AppTypes.cpp +++ b/ext/common/ApplicationPool2/AppTypes.cpp @@ -1,6 +1,6 @@ /* * Phusion Passenger - https://www.phusionpassenger.com/ - * Copyright (c) 2013 Phusion + * Copyright (c) 2013-2014 Phusion * * "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui. * @@ -39,7 +39,6 @@ namespace ApplicationPool2 { const AppTypeDefinition appTypeDefinitions[] = { { PAT_RACK, "rack", "config.ru", "Passenger RackApp" }, { PAT_WSGI, "wsgi", "passenger_wsgi.py", "Passenger WsgiApp" }, - { PAT_CLASSIC_RAILS, "classic-rails", "config/environment.rb", "Passenger ClassicRailsApp" }, { PAT_NODE, "node", "app.js", "Passenger NodeApp" }, { PAT_METEOR, "meteor", ".meteor", "Passenger MeteorApp" }, { PAT_NONE, NULL, NULL, NULL } diff --git a/ext/common/ApplicationPool2/AppTypes.h b/ext/common/ApplicationPool2/AppTypes.h index 85812faade..36a8e621dc 100644 --- a/ext/common/ApplicationPool2/AppTypes.h +++ b/ext/common/ApplicationPool2/AppTypes.h @@ -1,6 +1,6 @@ /* * Phusion Passenger - https://www.phusionpassenger.com/ - * Copyright (c) 2013 Phusion + * Copyright (c) 2013-2014 Phusion * * "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui. * @@ -43,7 +43,6 @@ extern "C" { typedef enum { PAT_RACK, PAT_WSGI, - PAT_CLASSIC_RAILS, PAT_NODE, PAT_METEOR, PAT_NONE, diff --git a/ext/common/ApplicationPool2/ErrorRenderer.h b/ext/common/ApplicationPool2/ErrorRenderer.h index 16c94b5cf3..c4049d3664 100644 --- a/ext/common/ApplicationPool2/ErrorRenderer.h +++ b/ext/common/ApplicationPool2/ErrorRenderer.h @@ -74,7 +74,7 @@ class ErrorRenderer { params.set("ENVIRONMENT", options.environment); params.set("MESSAGE", message); params.set("IS_RUBY_APP", - (options.appType == "classic-rails" || options.appType == "rack") + (options.appType == "rack") ? "true" : "false"); if (e != NULL) { params.set("TITLE", "Web application could not be started"); diff --git a/ext/common/ApplicationPool2/Options.h b/ext/common/ApplicationPool2/Options.h index c8f7af64ee..69e64ba3cf 100644 --- a/ext/common/ApplicationPool2/Options.h +++ b/ext/common/ApplicationPool2/Options.h @@ -1,6 +1,6 @@ /* * Phusion Passenger - https://www.phusionpassenger.com/ - * Copyright (c) 2010-2013 Phusion + * Copyright (c) 2010-2014 Phusion * * "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui. * @@ -651,9 +651,7 @@ class Options { } string getStartCommand(const ResourceLocator &resourceLocator) const { - if (appType == P_STATIC_STRING("classic-rails")) { - return ruby + "\t" + resourceLocator.getHelperScriptsDir() + "/classic-rails-loader.rb"; - } else if (appType == P_STATIC_STRING("rack")) { + if (appType == P_STATIC_STRING("rack")) { return ruby + "\t" + resourceLocator.getHelperScriptsDir() + "/rack-loader.rb"; } else if (appType == P_STATIC_STRING("wsgi")) { return python + "\t" + resourceLocator.getHelperScriptsDir() + "/wsgi-loader.py"; diff --git a/ext/common/ApplicationPool2/SpawnerFactory.h b/ext/common/ApplicationPool2/SpawnerFactory.h index 23a425f0f1..50412339f0 100644 --- a/ext/common/ApplicationPool2/SpawnerFactory.h +++ b/ext/common/ApplicationPool2/SpawnerFactory.h @@ -1,6 +1,6 @@ /* * Phusion Passenger - https://www.phusionpassenger.com/ - * Copyright (c) 2011-2013 Phusion + * Copyright (c) 2011-2014 Phusion * * "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui. * @@ -47,10 +47,7 @@ class SpawnerFactory { SpawnerPtr tryCreateSmartSpawner(const Options &options) { string dir = config->resourceLocator->getHelperScriptsDir(); vector preloaderCommand; - if (options.appType == "classic-rails") { - preloaderCommand.push_back(options.ruby); - preloaderCommand.push_back(dir + "/classic-rails-preloader.rb"); - } else if (options.appType == "rack") { + if (options.appType == "rack") { preloaderCommand.push_back(options.ruby); preloaderCommand.push_back(dir + "/rack-preloader.rb"); } else { diff --git a/helper-scripts/classic-rails-loader.rb b/helper-scripts/classic-rails-loader.rb deleted file mode 100644 index 07659bdc5b..0000000000 --- a/helper-scripts/classic-rails-loader.rb +++ /dev/null @@ -1,166 +0,0 @@ -#!/usr/bin/env ruby -# Phusion Passenger - https://www.phusionpassenger.com/ -# Copyright (c) 2013-2014 Phusion -# -# "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -module PhusionPassenger -module App - def self.options - return @@options - end - - def self.format_exception(e) - result = "#{e} (#{e.class})" - if !e.backtrace.empty? - if e.respond_to?(:html?) && e.html? - require 'erb' if !defined?(ERB) - result << "\n
  " << ERB::Util.h(e.backtrace.join("\n  ")) << "
" - else - result << "\n " << e.backtrace.join("\n ") - end - end - return result - end - - def self.exit_code_for_exception(e) - if e.is_a?(SystemExit) - return e.status - else - return 1 - end - end - - def self.handshake_and_read_startup_request - STDOUT.sync = true - STDERR.sync = true - puts "!> I have control 1.0" - abort "Invalid initialization header" if STDIN.readline != "You have control 1.0\n" - - @@options = {} - while (line = STDIN.readline) != "\n" - name, value = line.strip.split(/: */, 2) - @@options[name] = value - end - end - - def self.init_passenger - require "#{options["ruby_libdir"]}/phusion_passenger" - PhusionPassenger.locate_directories(options["passenger_root"]) - PhusionPassenger.require_passenger_lib 'native_support' - PhusionPassenger.require_passenger_lib 'ruby_core_enhancements' - PhusionPassenger.require_passenger_lib 'utils/tmpdir' - PhusionPassenger.require_passenger_lib 'loader_shared_helpers' - PhusionPassenger.require_passenger_lib 'request_handler' - @@options = LoaderSharedHelpers.init(@@options) - Utils.passenger_tmpdir = options["generation_dir"] - if defined?(NativeSupport) - NativeSupport.disable_stdio_buffering - end - rescue Exception => e - LoaderSharedHelpers.about_to_abort(e) if defined?(LoaderSharedHelpers) - puts "!> Error" - puts "!> html: true" if e.respond_to?(:html?) && e.html? - puts "!> " - puts format_exception(e) - exit exit_code_for_exception(e) - end - - def self.load_app - LoaderSharedHelpers.before_loading_app_code_step1('config/environment.rb', options) - LoaderSharedHelpers.before_loading_app_code_step2(options) - - require File.expand_path('config/environment') - require 'rails/version' if !defined?(Rails::VERSION) - if Rails::VERSION::MAJOR >= 3 - LoaderSharedHelpers.about_to_abort - puts "!> Error" - puts "!> " - puts "!> This application is a Rails #{Rails::VERSION::MAJOR} " + - "application, but it was wrongly detected as a Rails " + - "1 or Rails 2 application. This is probably a bug in " + - "Phusion Passenger, so please report it." - exit 1 - end - if !defined?(Dispatcher) - require 'dispatcher' - end - - # - No point in preloading the application sources if the garbage collector - # isn't copy-on-write friendly. - # - Rails >= 2.2 already preloads application sources by default, so no need - # to do that again. - if GC.copy_on_write_friendly? && !rails_will_preload_app_code? - # Rails 2.2+ uses application_controller.rb while old - # versions use application.rb. - require_dependency 'application' - ['models','controllers','helpers'].each do |section| - Dir.glob("app/#{section}}/*.rb").each do |file| - require_dependency File.expand_path(file) - end - end - end - - LoaderSharedHelpers.after_loading_app_code(options) - - if Rails::VERSION::STRING >= '2.3.0' - PhusionPassenger.require_passenger_lib 'rack/thread_handler_extension' - RequestHandler::ThreadHandler.send(:include, Rack::ThreadHandlerExtension) - app = ActionController::Dispatcher.new - else - PhusionPassenger.require_passenger_lib 'classic_rails/thread_handler_extension' - RequestHandler::ThreadHandler.send(:include, ClassicRails::ThreadHandlerExtension) - app = nil - end - handler = RequestHandler.new(STDIN, options.merge("app" => app)) - - LoaderSharedHelpers.before_handling_requests(false, options) - return handler - - rescue Exception => e - LoaderSharedHelpers.about_to_abort(e) - puts "!> Error" - puts "!> html: true" if e.respond_to?(:html?) && e.html? - puts "!> " - puts format_exception(e) - exit exit_code_for_exception(e) - end - - def self.rails_will_preload_app_code? - return ::Rails::Initializer.method_defined?(:load_application_classes) - end - - - ################## Main code ################## - - - handshake_and_read_startup_request - init_passenger - handler = load_app - LoaderSharedHelpers.advertise_readiness - LoaderSharedHelpers.advertise_sockets(STDOUT, handler) - puts "!> " - handler.main_loop - handler.cleanup - LoaderSharedHelpers.after_handling_requests - -end # module App -end # module PhusionPassenger diff --git a/helper-scripts/classic-rails-preloader.rb b/helper-scripts/classic-rails-preloader.rb deleted file mode 100644 index 1387156512..0000000000 --- a/helper-scripts/classic-rails-preloader.rb +++ /dev/null @@ -1,193 +0,0 @@ -#!/usr/bin/env ruby -# encoding: utf-8 -# Phusion Passenger - https://www.phusionpassenger.com/ -# Copyright (c) 2013-2014 Phusion -# -# "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -GC.copy_on_write_friendly = true if GC.respond_to?(:copy_on_write_friendly=) - -module PhusionPassenger -module App - def self.options - return @@options - end - - def self.format_exception(e) - result = "#{e} (#{e.class})" - if !e.backtrace.empty? - if e.respond_to?(:html?) && e.html? - require 'erb' if !defined?(ERB) - result << "\n
  " << ERB::Util.h(e.backtrace.join("\n  ")) << "
" - else - result << "\n " << e.backtrace.join("\n ") - end - end - return result - end - - def self.exit_code_for_exception(e) - if e.is_a?(SystemExit) - return e.status - else - return 1 - end - end - - def self.handshake_and_read_startup_request - STDOUT.sync = true - STDERR.sync = true - puts "!> I have control 1.0" - abort "Invalid initialization header" if STDIN.readline != "You have control 1.0\n" - - @@options = {} - while (line = STDIN.readline) != "\n" - name, value = line.strip.split(/: */, 2) - @@options[name] = value - end - end - - def self.init_passenger - require "#{options["ruby_libdir"]}/phusion_passenger" - PhusionPassenger.locate_directories(options["passenger_root"]) - PhusionPassenger.require_passenger_lib 'native_support' - PhusionPassenger.require_passenger_lib 'ruby_core_enhancements' - PhusionPassenger.require_passenger_lib 'utils/tmpdir' - PhusionPassenger.require_passenger_lib 'preloader_shared_helpers' - PhusionPassenger.require_passenger_lib 'loader_shared_helpers' - PhusionPassenger.require_passenger_lib 'request_handler' - @@options = LoaderSharedHelpers.init(@@options) - @@options = PreloaderSharedHelpers.init(@@options) - Utils.passenger_tmpdir = options["generation_dir"] - if defined?(NativeSupport) - NativeSupport.disable_stdio_buffering - end - rescue Exception => e - LoaderSharedHelpers.about_to_abort(e) if defined?(LoaderSharedHelpers) - puts "!> Error" - puts "!> html: true" if e.respond_to?(:html?) && e.html? - puts "!> " - puts format_exception(e) - exit exit_code_for_exception(e) - end - - def self.preload_app - LoaderSharedHelpers.before_loading_app_code_step1('config/environment.rb', options) - LoaderSharedHelpers.before_loading_app_code_step2(options) - - require File.expand_path('config/environment') - require 'rails/version' if !defined?(Rails::VERSION) - if Rails::VERSION::MAJOR >= 3 - LoaderSharedHelpers.about_to_abort - puts "!> Error" - puts "!> " - puts "This application is a Rails #{Rails::VERSION::MAJOR} " + - "application, but it was wrongly detected as a Rails " + - "1 or Rails 2 application. This is probably a bug in " + - "Phusion Passenger, so please report it." - exit 1 - end - if !defined?(Dispatcher) - require 'dispatcher' - end - - # - No point in preloading the application sources if the garbage collector - # isn't copy-on-write friendly. - # - Rails >= 2.2 already preloads application sources by default, so no need - # to do that again. - if GC.copy_on_write_friendly? && !rails_will_preload_app_code? - # Rails 2.2+ uses application_controller.rb while old - # versions use application.rb. - require_dependency 'application' - ['models','controllers','helpers'].each do |section| - Dir.glob("app/#{section}}/*.rb").each do |file| - require_dependency File.expand_path(file) - end - end - end - - LoaderSharedHelpers.after_loading_app_code(options) - - rescue Exception => e - LoaderSharedHelpers.about_to_abort(e) - puts "!> Error" - puts "!> html: true" if e.respond_to?(:html?) && e.html? - puts "!> " - puts format_exception(e) - exit exit_code_for_exception(e) - end - - def self.rails_will_preload_app_code? - return ::Rails::Initializer.method_defined?(:load_application_classes) - end - - def self.negotiate_spawn_command - puts "!> I have control 1.0" - abort "Invalid initialization header" if STDIN.readline != "You have control 1.0\n" - - begin - while (line = STDIN.readline) != "\n" - name, value = line.strip.split(/: */, 2) - options[name] = value - end - @@options = LoaderSharedHelpers.sanitize_spawn_options(@@options) - - LoaderSharedHelpers.before_handling_requests(true, options) - if Rails::VERSION::STRING >= '2.3.0' - PhusionPassenger.require_passenger_lib 'rack/thread_handler_extension' - RequestHandler::ThreadHandler.send(:include, Rack::ThreadHandlerExtension) - app = ActionController::Dispatcher.new - else - PhusionPassenger.require_passenger_lib 'classic_rails/thread_handler_extension' - RequestHandler::ThreadHandler.send(:include, ClassicRails::ThreadHandlerExtension) - app = nil - end - handler = RequestHandler.new(STDIN, options.merge("app" => app)) - rescue Exception => e - LoaderSharedHelpers.about_to_abort(e) - puts "!> Error" - puts "!> " - puts format_exception(e) - exit exit_code_for_exception(e) - end - - LoaderSharedHelpers.advertise_readiness - LoaderSharedHelpers.advertise_sockets(STDOUT, handler) - puts "!> " - return handler - end - - - ################## Main code ################## - - - handshake_and_read_startup_request - init_passenger - preload_app - if PreloaderSharedHelpers.run_main_loop(options) == :forked - handler = negotiate_spawn_command - handler.main_loop - handler.cleanup - LoaderSharedHelpers.after_handling_requests - end - -end # module App -end # module PhusionPassenger diff --git a/lib/phusion_passenger/classic_rails/cgi_fixed.rb b/lib/phusion_passenger/classic_rails/cgi_fixed.rb deleted file mode 100644 index b8029b77e6..0000000000 --- a/lib/phusion_passenger/classic_rails/cgi_fixed.rb +++ /dev/null @@ -1,68 +0,0 @@ -# NOTE: This code is based on cgi_fixed.rb from Zed Shaw's scgi_rails -# package, version 0.4.3. The license of this single file is as follows: -# -# Copyright (c) 2004 Zed A. Shaw -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# We also made some small local modifications. - -require 'cgi' - -module PhusionPassenger -module ClassicRails - -# Modifies CGI so that we can use it. Main thing it does is expose -# the stdinput and stdoutput so RequestHandler can connect them to -# the right sources. It also exposes the env_table so that RequestHandler -# can hook the request parameters into the environment table. -# -# This is partially based on the FastCGI code, but much of the Ruby 1.6 -# backwards compatibility is removed. -class CGIFixed < ::CGI - public :env_table - - def initialize(params, input, output, *args) - @env_table = params - @args = *args - @input = input - @out = output - super(*args) - end - - def args - @args - end - - def env_table - @env_table - end - - def stdinput - @input - end - - def stdoutput - @out - end -end - -end # module ClassicRails -end # module PhusionPassenger diff --git a/lib/phusion_passenger/classic_rails/thread_handler_extension.rb b/lib/phusion_passenger/classic_rails/thread_handler_extension.rb deleted file mode 100644 index 65a2833b48..0000000000 --- a/lib/phusion_passenger/classic_rails/thread_handler_extension.rb +++ /dev/null @@ -1,40 +0,0 @@ -# encoding: binary -# Phusion Passenger - https://www.phusionpassenger.com/ -# Copyright (c) 2010-2013 Phusion -# -# "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -PhusionPassenger.require_passenger_lib 'classic_rails/cgi_fixed' -module PhusionPassenger -module ClassicRails - -module ThreadHandlerExtension - def process_request(env, connection, socket_wrapper, full_http_response) - cgi = CGIFixed.new(env, connection, connection) - ::Dispatcher.dispatch(cgi, - ::ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS, - cgi.stdoutput) - return false # Socket hijacking not supported. - end -end - -end # module ClassicRails -end # module PhusionPassenger diff --git a/test/ruby/classic_rails/loader_spec.rb b/test/ruby/classic_rails/loader_spec.rb deleted file mode 100644 index 7c5a373fa1..0000000000 --- a/test/ruby/classic_rails/loader_spec.rb +++ /dev/null @@ -1,46 +0,0 @@ -require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') -require 'ruby/shared/loader_sharedspec' -require 'ruby/shared/ruby_loader_sharedspec' - -module PhusionPassenger - -describe "Classic Rails 2.3 loader" do - include LoaderSpecHelper - - before :each do - @stub = register_stub(ClassicRailsStub.new("rails2.3")) - end - - def start(options = {}) - @loader = Loader.new(["ruby", "#{PhusionPassenger.helper_scripts_dir}/classic-rails-loader.rb"], @stub.app_root) - return @loader.start(options) - end - - def rails_version - return "2.3" - end - - it_should_behave_like "a loader" - it_should_behave_like "a Ruby loader" - - it "calls the starting_worker_process event with forked=false" do - File.prepend(@stub.environment_rb, %q{ - history_file = "history.txt" - PhusionPassenger.on_event(:starting_worker_process) do |forked| - ::File.open(history_file, 'a') do |f| - f.puts "worker_process_started: forked=#{forked}\n" - end - end - ::File.open(history_file, 'a') do |f| - f.puts "end of startup file\n" - end - }) - result = start - result[:status].should == "Ready" - File.read("#{@stub.app_root}/history.txt").should == - "end of startup file\n" + - "worker_process_started: forked=false\n" - end -end if TEST_CLASSIC_RAILS - -end # module PhusionPassenger diff --git a/test/ruby/classic_rails/preloader_spec.rb b/test/ruby/classic_rails/preloader_spec.rb deleted file mode 100644 index 2c6f4c5810..0000000000 --- a/test/ruby/classic_rails/preloader_spec.rb +++ /dev/null @@ -1,52 +0,0 @@ -require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') -require 'ruby/shared/loader_sharedspec' -require 'ruby/shared/ruby_loader_sharedspec' - -module PhusionPassenger - -describe "Classic Rails 2.3 preloader" do - include LoaderSpecHelper - - before :each do - @stub = register_stub(ClassicRailsStub.new("rails2.3")) - end - - def start(options = {}) - @preloader = Preloader.new(["ruby", "#{PhusionPassenger.helper_scripts_dir}/classic-rails-preloader.rb"], @stub.app_root) - result = @preloader.start(options) - if result[:status] == "Ready" - @loader = @preloader.spawn(options) - return @loader.start(options) - else - return result - end - end - - def rails_version - return "2.3" - end - - it_should_behave_like "a loader" - it_should_behave_like "a Ruby loader" - - it "calls the starting_worker_process event with forked=true" do - File.prepend(@stub.environment_rb, %q{ - history_file = "history.txt" - PhusionPassenger.on_event(:starting_worker_process) do |forked| - ::File.open(history_file, 'a') do |f| - f.puts "worker_process_started: forked=#{forked}\n" - end - end - ::File.open(history_file, 'a') do |f| - f.puts "end of startup file\n" - end - }) - result = start - result[:status].should == "Ready" - File.read("#{@stub.app_root}/history.txt").should == - "end of startup file\n" + - "worker_process_started: forked=true\n" - end -end if TEST_CLASSIC_RAILS - -end # module PhusionPassenger