Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I will describe how I run multiple Rails applications on one Linux server, using Apache, Phusion Passenger, and some version of Ruby. You have many choices, but this should help you get started. Many of these details come from the installation script</p> <p>First, install Phusion Passenger.</p> <pre><code>&gt; gem install passenger </code></pre> <p>Second, build the Apache 2 Passenger module. You should be able to execute the following script installed during step one.</p> <pre><code>&gt; passenger-install-apache2-module </code></pre> <p>This script will compile the Apache 2 module and explain how to configure Apache. If dependencies are missing the script should offer some helpful advice about how to install them.</p> <p>Third, edit your Apache configuration file. I have to add something like this. (Just use this for references and don't worry about .rvm) The script run in step two will give you something that you can copy and paste.</p> <pre><code>LoadModule passenger_module /Users/me/.rvm/gems/ree/gems/passenger-3.0.9/ext/apache2/mod_passenger.so PassengerRoot /Users/me/.rvm/gems/ree/gems/passenger-3.0.9 PassengerRuby /Users/me/.rvm/wrappers/ree/ruby </code></pre> <p>Fourth, add something like this to your Apache configuration file <em>for each application</em> you want to run.</p> <pre><code>&lt;VirtualHost *:80&gt; ServerName app1.example.com DocumentRoot /somewhere/app1/public # &lt;-- be sure to point to 'public'! &lt;Directory /somewhere/app1/public&gt; AllowOverride all # &lt;-- relax Apache security settings Options -MultiViews # &lt;-- MultiViews must be turned off &lt;/Directory&gt; &lt;/VirtualHost&gt; </code></pre> <p>If you have two Rails application sharing one database then they will both have similar connection information in config/database.yml</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload