Walther Diechmann
2011-Mar-31 17:17 UTC
multiple vhosts running off of one passenger/rails app
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> ...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 -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Norm Scherer
2011-Mar-31 18:00 UTC
Re: multiple vhosts running off of one passenger/rails app
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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. On Thu, Mar 31, 2011 at 2:00 PM, Norm Scherer <normscherer-ihVZJaRskl1bRRN4PJnoQQ@public.gmane.org> wrote:> 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-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.