Skip to content

Commit

Permalink
Remove support for Rails 1.2-2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
FooBarWidget committed Sep 10, 2014
1 parent caee919 commit f017640
Show file tree
Hide file tree
Showing 18 changed files with 349 additions and 1,225 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions doc/Design and Architecture.txt
Expand Up @@ -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 | -
Expand Down
364 changes: 176 additions & 188 deletions doc/Users guide Apache.idmap.txt

Large diffs are not rendered by default.

152 changes: 2 additions & 150 deletions doc/Users guide Apache.txt
Expand Up @@ -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
<<rails_env,'RailsEnv'>> 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:
-------------------------------------------
<VirtualHost *:80>
ServerName www.mycook.com
DocumentRoot /webapps/mycook/public
<Directory /webapps/mycook/public>
Allow from all
Options -MultiViews
# Uncomment this if you're on Apache >= 2.4:
#Require all granted
</Directory>
</VirtualHost>
-------------------------------------------

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:

-------------------------------------------
<VirtualHost *:80>
ServerName www.phusion.nl
DocumentRoot /websites/phusion
<Directory /websites/phusion>
Allow from all
Options -MultiViews
# Uncomment this if you're on Apache >= 2.4:
#Require all granted
</Directory>
</VirtualHost>
-------------------------------------------

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 `<Location /{SUBURI}>` block.
3. Inside the Location block, set `PassengerBaseURI /{SUBURI}`.
4. Inside the Location block, set `PassengerAppRoot {PATH TO YOUR APPLICATION ROOT}`.
5. Create a `<Directory {PATH TO YOUR APPLICATION'S PUBLIC DIRECTORY}>` 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:

-------------------------------------------
<VirtualHost *:80>
ServerName www.phusion.nl
DocumentRoot /websites/phusion
<Directory /websites/phusion>
Allow from all
Options -MultiViews
# Uncomment this if you're on Apache >= 2.4:
#Require all granted
</Directory>

# These have been added:
Alias /subapp /websites/rails/public
<Location /subapp>
PassengerBaseURI /subapp
PassengerAppRoot /websites/rails
</Location>
<Directory /websites/rails/public>
Allow from all
Options -MultiViews
# Uncomment this if you're on Apache >= 2.4:
#Require all granted
</Directory>
</VirtualHost>
-------------------------------------------

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
<<sub_uri_deployment_uri_fix,How to fix broken images/CSS/JavaScript URIs in sub-URI deployments>>
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 <<application_root,root folder>>. 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 <<capistrano,Capistrano recipe>>.


== 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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f017640

Please sign in to comment.