On 03/31/2011 10:17 AM, Walther Diechmann wrote:
Hi,

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

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>
...et

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:

 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

--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to