Multitenant via Host Name

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Multitenant via Host Name

Mark-2
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Multitenant via Host Name

vijay Si
You will have to change the datasource names.
Are you mapping the url's "www.myerp.com" and others to ofbiz specific urls'
of <a href="https://x.y.z.m:PPPP/app/control/main">https://x.y.z.m:PPPP/app/control/main ?

The case you are trying out is perfectly possible.

On Wed, Feb 27, 2008 at 12:54 AM, Mark Ellul <[hidden email]> wrote:

> Hi,
>
> I was just wondering if anyone can think of a way I could change the
> datasource on a user per user basis...
>
> Basically what I am trying to do is this... When User A goes to
> www.myerp.com they go to my ofbiz instance running on my server... but
> based
> on the url they are going to, their datasource is set to the myerp
> database.
>
> When user B goes to www.yourerp.com they go to the same ofbiz instance
> running on my server with the same code base but based on the URL their
> datasource is the yourerp database...
>
> My aim is to have one tomcat and one code base service many URLs each with
> their own database, hopefully not having to change the datasource in each
> service.
>
> Sorry if I am not making myself clear...
>
> Any thoughts would be appreciated
>
> Regards
>
> Mark
>
Reply | Threaded
Open this post in threaded view
|

Re: Multitenant via Host Name

Mark-2
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Multitenant via Host Name

Vince Clark
Mark, what want to do is not possible. The database connection is initiated during startup based on the settings in entityengine.xml. In order to setup multiple instances each instance must have its own app server and database.

You can accomplish this on the same physical server two ways:
1. Use virtualization technology such as vserver, Xen, or VMWare
2. Use different ports on each instance (8080,8443,etc.)

The database is not a problem. Most DBMS support multiple databases (sometimes referred to as schemas or users) under the same installation of the DBMS.

----- Original Message -----
From: "Mark Ellul" <[hidden email]>
To: [hidden email]
Sent: Wednesday, February 27, 2008 2:18:33 AM (GMT-0700) America/Denver
Subject: Re: Multitenant via Host Name

Hi Vijay,

I guess it would be good to know if I could run it off the same tomcat/ofbiz
instance....

so in essence www.myerp.com and www.yourerp.com would both go
<a href="https://x.y.z.m:PPPP/app/control/main">https://x.y.z.m:PPPP/app/control/main. However the main would look at host
headers and set the datasource name based on the host headers... and
basically set the datasource name for the session.

Is that possible?

Our aim by doing this is to set up a sandbox and production site on the same
server using the same codebase and just different databases.

Your thoughts are appreciated

Regards

Mark


On Wed, Feb 27, 2008 at 8:46 AM, Vijay <[hidden email]> wrote:

> You will have to change the datasource names.
> Are you mapping the url's "www.myerp.com" and others to ofbiz specific
> urls'
> of <a href="https://x.y.z.m:PPPP/app/control/main">https://x.y.z.m:PPPP/app/control/main ?
>
> The case you are trying out is perfectly possible.
>
> On Wed, Feb 27, 2008 at 12:54 AM, Mark Ellul <[hidden email]> wrote:
>
> > Hi,
> >
> > I was just wondering if anyone can think of a way I could change the
> > datasource on a user per user basis...
> >
> > Basically what I am trying to do is this... When User A goes to
> > www.myerp.com they go to my ofbiz instance running on my server... but
> > based
> > on the url they are going to, their datasource is set to the myerp
> > database.
> >
> > When user B goes to www.yourerp.com they go to the same ofbiz instance
> > running on my server with the same code base but based on the URL their
> > datasource is the yourerp database...
> >
> > My aim is to have one tomcat and one code base service many URLs each
> with
> > their own database, hopefully not having to change the datasource in
> each
> > service.
> >
> > Sorry if I am not making myself clear...
> >
> > Any thoughts would be appreciated
> >
> > Regards
> >
> > Mark
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Multitenant via Host Name

vijay Si
Hello Mark,

I agree with Vince's both schemes, However it is also possible to have a
common Tomcat and different databases.
But this requires a lot of changes in many of the files importantly
beginning with
entityengine.xml. Here 1st and foremost you will have to:

1) Assign different delegators for different hosted  entities
2) Assign different  datasource-names
3) Different sequenced-id-prefix=""  for each,

besides you will also have to change some other files related to job. Then
lot of ftl files will get changed {those that access the url}.
So in a way Mr. Vince is correct in saying that as it is - ofbiz does not
directly support multi-tenancy but it can be done with tweaks!!

Regards


On Wed, Feb 27, 2008 at 6:48 PM, Vince M. Clark <[hidden email]>
wrote:

> Mark, what want to do is not possible. The database connection is
> initiated during startup based on the settings in entityengine.xml. In
> order to setup multiple instances each instance must have its own app server
> and database.
>
> You can accomplish this on the same physical server two ways:
> 1. Use virtualization technology such as vserver, Xen, or VMWare
> 2. Use different ports on each instance (8080,8443,etc.)
>
> The database is not a problem. Most DBMS support multiple databases
> (sometimes referred to as schemas or users) under the same installation of
> the DBMS.
>
> ----- Original Message -----
> From: "Mark Ellul" <[hidden email]>
> To: [hidden email]
> Sent: Wednesday, February 27, 2008 2:18:33 AM (GMT-0700) America/Denver
> Subject: Re: Multitenant via Host Name
>
> Hi Vijay,
>
> I guess it would be good to know if I could run it off the same
> tomcat/ofbiz
> instance....
>
> so in essence www.myerp.com and www.yourerp.com would both go
> <a href="https://x.y.z.m:PPPP/app/control/main">https://x.y.z.m:PPPP/app/control/main. However the main would look at host
> headers and set the datasource name based on the host headers... and
> basically set the datasource name for the session.
>
> Is that possible?
>
> Our aim by doing this is to set up a sandbox and production site on the
> same
> server using the same codebase and just different databases.
>
> Your thoughts are appreciated
>
> Regards
>
> Mark
>
>
> On Wed, Feb 27, 2008 at 8:46 AM, Vijay <[hidden email]> wrote:
>
> > You will have to change the datasource names.
> > Are you mapping the url's "www.myerp.com" and others to ofbiz specific
> > urls'
> > of <a href="https://x.y.z.m:PPPP/app/control/main">https://x.y.z.m:PPPP/app/control/main ?
> >
> > The case you are trying out is perfectly possible.
> >
> > On Wed, Feb 27, 2008 at 12:54 AM, Mark Ellul <[hidden email]>
> wrote:
> >
> > > Hi,
> > >
> > > I was just wondering if anyone can think of a way I could change the
> > > datasource on a user per user basis...
> > >
> > > Basically what I am trying to do is this... When User A goes to
> > > www.myerp.com they go to my ofbiz instance running on my server... but
> > > based
> > > on the url they are going to, their datasource is set to the myerp
> > > database.
> > >
> > > When user B goes to www.yourerp.com they go to the same ofbiz instance
> > > running on my server with the same code base but based on the URL
> their
> > > datasource is the yourerp database...
> > >
> > > My aim is to have one tomcat and one code base service many URLs each
> > with
> > > their own database, hopefully not having to change the datasource in
> > each
> > > service.
> > >
> > > Sorry if I am not making myself clear...
> > >
> > > Any thoughts would be appreciated
> > >
> > > Regards
> > >
> > > Mark
> > >
> >
>