Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

What I am trying to do is run multiple Rails apps from a server machine at work. We dont have multiple hostnames for the box. We want to host some rails apps on it as well as our php apps. Currently users can connect http://computername/app/.

How can I host multiple Rails apps and keep this structure? It appears Passenger requires the use of VirtualHosts but I only have localhost:80.

Is it possible to host multiple Rails apps on a single VirtualHost?

The VirtualHosts have the DocumentRoot directive, is there a way for me to specify which hostname directory that is listened to on? ie /computername/blah/

Hope that was clear. Thanks.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Looks like this is what I was looking for.

http://www.modrails.com/documentation/Users%20guide%20Apache.html#deploying%5Frails%5Fto%5Fsub%5Furi

share|improve this answer
    
But how do you handle multiple Rails application that require different version of Rails and other gems? –  JJD Jun 8 '12 at 10:53
add comment

I would suggest to also read about the following directives, the use of which will give you extra flexibility in your setup:

  • PassengerEnabled: allows to enable/disable passenger in a specific context (main server/virtualhost/directory), so that you can have areas that are served by another web application if needed.
  • PassengerAppRoot: allows you to easily re-use the source of a web app for several instances of the application.
  • RailsBaseURI: allows you to run the web app in a sub directory.

Of course these are just pointers. I highly recommend reading the whole documentation for all the details.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.