multiple vhosts running off of one passenger/rails app

Hi,

I've been googling quite a bit - but up until now to no use :frowning:

My problem is how to configure Apache conf (and perhaps Passenger) for this setup to work:

<VirtualHost *:80>     ServerName oxen.company_A.com     DocumentRoot /var/www/html/oxen/sites/company_A/public     PassengerAppRoot /var/www/html/oxen     SetEnv OXID 23 </VirtualHost>

<VirtualHost *:80>     ServerName oxen.company_B.com     DocumentRoot /var/www/html/oxen/sites/company_B/public     PassengerAppRoot /var/www/html/oxen     SetEnv OXID 25 </VirtualHost> ...etc

That is - I'd like a few customers run off the same codebase (which will segment them on the OXID) and still offer each customer 'his' own public with css, javascripts, images, uploaded files etc

Does anyone here known if this will even work - or am I just rambling?

Best regards, Walther

I do something like that. I have a directory containing a normal ROR setup (we will call that ROR), I use a simple virtual host setup (this is extracted from the script that sets things up) with each DocumentRoot parent directory being a directory with symbolic links to the stuff in ROR created by:

<small> </small>ln -s ../ROR/* .;rm config log tmp backup;cp -rp ../ROR/config .; mkdir -p log backup tmp/cache tmp/pids tmp/sessions tmp/sockets

I then overwrite the db config file to contain the database info specific to the customer. I share the files in public but one could follow the same paradigm and make them specific to the customer. It works well for me and I have only one code base with distinct databases and logfiles etc. Nothing in the code has any concept of there being multiple users of the code. It is just shared code. This is a 2.2.2 configuration and it might change a bit for another version but I would imagine the same concepts would work.

Norm

I just create two separate folders but have them point to the same svn repository. Then I have a file called skin.yml (not checked in) that contains any data that differentiates them. So the files are duplicated, but they are always in sync because I deploy both sites in parallel.