Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I already have an apache webserver set up, and it is working for PHP.

It has no static VirtualHosts set up, and dynamically routes all requests.

A request for would be served from the document root /var/www/ (VirtualDocumentRoot), and a request for would be served from the document root /home/user/public_html (mod_userdir). The latter works no matter what the domain.

I would like to be able to serve Ruby on Rails applications, from the root of a document root, or from a subdirectory, using Phusion Passenger. However, it requires me to add some lines to the <VirtualHost> directive, which obviously isn't there.

I would prefer a solution that does not require root to deploy an application, but this is not critical. I also do not mind a solution that does not use Passenger, if I have the same ease of deployment.

share|improve this question
Wow. I got Tumbleweed, no answers. I offered a 200point bounty, no answers. I guess it's time to give up. – fahadsadah Jul 11 '10 at 16:40

Simple solution is to write a location module in mod_perl that dynamically updates the virtualhost environment (not the container) on a per-request basis. That's how we handled 404s for sites that weren't set up prior to the client logging in via ftp.

share|improve this answer
Define "virtualhost environment", please. If you mean sites-enabled or an equivalent, we're not using it. Otherwise, yes, I could simply write a script to create a VirtualHost for each user – fahadsadah Jul 4 '10 at 19:01
with mass_virtual, you can affect the thread and dynamically add directives without needing a VirtualHost container. It affects the context of the request on a per-request basis, which will allow you to do exactly what you need to do. – karmawhore Jul 4 '10 at 19:35
I'm sorry, I still don't understand, and Google isn't being very helpful. Please could you post an example script? – fahadsadah Jul 5 '10 at 18:02
up vote 0 down vote accepted

Unfortunately, this doesn't seem possible. Passenger is completely incompatible with userdirs, and with VirtualDocumentRoot, a separate VirtualHost is required.

share|improve this answer

Your Answer


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.