Multiple rails apps on Phusion Passenger on Apache

I have an rails application setup on a linux server which works fine and I can access it through:

machine.mydomain.com

the passenger setup file (/etc/apache2/httpd.conf) has this section:

   <VirtualHost *:80>
      ServerName machine.mydomain.com 
      DocumentRoot /var/www/public    
      <Directory /var/www/public>
         AllowOverride all              
         Options -MultiViews           
      </Directory>
   </VirtualHost>

I added a new rails app under the same directory (it will not be there indefinately, it's only for testing) under the subdirectory sss and added a new section in the file:

   <VirtualHost *:80>
      ServerName machine.mydomain.com/sss
      DocumentRoot /var/www/sss/public
      <Directory /var/www/sss/public>
         AllowOverride all
         Options -MultiViews
      </Directory>
   </VirtualHost>

What am I doing wrong?

Answers


Assuming you're using rack, you have to change your httpd.conf like this:

<VirtualHost *:80>
  ServerName machine.mydomain.com
  DocumentRoot /var/www/public
  <Directory /var/www/public>
     AllowOverride all
     Options -MultiViews
  </Directory>

  RackBaseURI /sss
  <Directory /var/www/sss/public>
    Options -MultiViews
  </Directory>    

</VirtualHost>

Need Your Help

State machine and params in a rails app

ruby-on-rails design state

I am in the process of implementing state machine to a model having a subscription behaviour usin AASM. I want a state machine to be able to trigger actions when changing states.

How to create unit tests for legacy code

asp.net visual-studio-2010 unit-testing

I have inherited an ASP.Net c# application which I must now maintain; the application was developed a while ago and, although the code works, it is all mixed together (business logic and MySQL data

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.