WikiGardening in progress. We’re combining/reorganizing several related howto’s at the moment, apologies for the dust. As a first stage, we are gathering all the related questions and their answers in one place and this is the place.
If you want to, you can have several Rails applications, each running on a different VirtualHost (though they could all still be on one machine) with URLs like:
<pre>
<a href="http://appOne.myhost.org/">http://appOne.myhost.org/</a>...
<a href="http://appTwo.myhost.org/">http://appTwo.myhost.org/</a>...
</pre>
To do this you will need to have someone (your ISP or Sir Tim, if you happen to know his home phone number) add DNS entries for each of the new “servers” pointing to the IP address of your machine.
Then, in your httpd.conf file, you would write something like this:
<pre>
NameVirtualHost *:80
<VirtualHost *>
ServerName appOne.myhost.org
DocumentRoot /var/www/html/appOne/public/
<Directory /var/www/html/appOne/public/>
Options ExecCGI FollowSymLinks
AllowOverride all
Allow from all
Order allow,deny
<VirtualHost *>
ServerName appTwo.myhost.org
DocumentRoot /var/www/html/appTwo/public/
<Directory /var/www/html/appTwo/public/>
Options ExecCGI FollowSymLinks
AllowOverride all
Allow from all
Order allow,deny
Rails 1.1 Users
Rails 1.1 by default stores its session data in RAILS_ROOT/tmp/sessions/ and not /tmp/sessions, so you’ll need to adjust its permissions in order to avoid ‘Permission denied’ errors with your app:
<pre>cd path_to_rails_app/tmp
chown -R apache:apache sessions</pre>
category: Howto