Mono Support Multitenant Application 

Viewed 115989 time(s), 46 post(s), 2/11/2014 5:18:06 AM - by Dinesh.Sajwan
2/11/2014 5:18:06 AM
1284 Reputation 156 Total posts

Hi,
Old topic was closed thats why i had to create new topic.

Want to enable multitenant support of Monox..

Requirement is that there should be one deployment of MonoX web as well as DB. 
There can be multiple client which will connect via different URL and they should save/view only their data and not others.
UI/Theme can be different of different clients.

Implemented the solution given by denis in the link "http://www.mono-software.com/blog/post/Mono/35/Hosting-multiple-applications-in-MonoX/".

Steps I performed
1. Created my custom module and onbeginrequest initailized context.Items["ApplicationName"] depending on the URL.
2. Changed VersionedPersonalizationProvider, MonoXRoleProvider and MonoXMembershipProvider.cs and overided "ApplicationName" function. Code given below

Is that all i have to do. 
Will this address the above requirement. 

Regards
Sumit

1
2/11/2014 7:45:20 AM
469 Reputation 60 Total posts

Hello,
There are several depts in my company and I would like to use only one instance of  MonoX. Several departments  here would like to have their own templates and masterpages. I think the topic that Dinesh.Sajwan started  is a good start point for me also. Could you please explain the multi-tenant structure of the MonoX  more detailed. In the most detailed topic given in the link given by Denis  "http://www.mono-software.com/blog/post/Mono/35/Hosting-multiple-applications-in-MonoX/" the explanation is somehow unfinished. At the end BILGINYAZAR asked on an important issue.

Is it possible to prepare a bunch of websites by using only one instance of MonoX?

Thank you very much..

2
2/11/2014 8:45:47 AM
15993 Reputation 2214 Total posts

Hi,

"Is it possible to prepare a bunch of websites by using only one instance of MonoX?" yes it is possible. There are few things that you need to know:

- MonoX database is prepared for multi-tenancy so you are good to go here
- You should implement everything Denis has described in his blog.
- You should use MonoX v4.9, if possible, as there are few fixed bugs related to multi-tenancy

That should be it, @Sumit please post your code so we can review it.

@BILGINYAZAR asked the following qestion and he answered his own question too, but for some reason it wasn't visible to the public (SPAM detection rules or something). I have published his answer and you have copy of it below.

But whenever I login in one of them the user name is also seen on the other sites, and that user is not registered for those applications (I am using two different IE instances. I think you are storing user details in the cache)
So my question is what should I do to separate user credentials between applications so that they will not collide?
@BILGINYAZAR answer
I could fixed my problem. The problem was occurred because both sites were using localhost. Even they were having different ports the cookies are shared together for both sites.
I have updated the hosts file and created 2 different entries for 127.0.0.1 and they will go to their web sites with different ports. So now their cookies are stored according to their URLs and there isn't any more collision.
Regards

3
2/11/2014 9:09:38 AM
469 Reputation 60 Total posts

Dear Khorvat,
Please help me a little bit more. In the blog post Hosting multiple applications in MonoX , there are 2 classes named 

i) DynamicApplicationModule 
ii) DynamicMembershipProvider

respectively.


Should I  use them to construct an  IIS module  as stated in here or should i use them in MonoX ver. 4.9 application?
Because in the first class it was said that 

 /// <summary>
/// You will need to configure this module in the web.config file of your
/// web and register it with IIS before being able to use it. For more information
/// see the following link: http://go.microsoft.com/?linkid=8101007
/// </summary>

and can you say how to configure this module in Monox's web.config ?

Thats all I wanna ask ....  :)

Regards

Inanc


4
2/11/2014 2:52:00 PM
1284 Reputation 156 Total posts

Thanks Khorvat,

In my production environment i am using version 4.5, so you are saying that multitenancy wlll not support nothing low that 4.9.. Thats sad.

For prototyping i am using 4.8 version. PFA code.

What is the next step? As after doing these changes application name with monox works fine but other give a error and does not load at all. 

do i need to do something in the database as well.

Regards
Sumit

5
2/11/2014 3:28:54 PM
15993 Reputation 2214 Total posts

No, I'm just saying that in prior v4.9 there are few bugs.

In my production environment i am using version 4.5, so you are saying that multitenancy wlll not support nothing low that 4.9.. Thats sad.
Can you send us exceptions that you get so we can check them and your code ?

Thanks

6
2/11/2014 3:52:14 PM
1284 Reputation 156 Total posts

Hi,

I am still at the prototyping stage and am doing prototype using version 4.8.
This is the error which i am getting on one VD but same code is working from other VD. 
PFA attached Screen Shot. I have attached code in last post.

Do you want any specific details.

Regards
Sumit

7
2/12/2014 7:09:22 AM
15993 Reputation 2214 Total posts

Ok, is there any error logs with stack trace in MonoX log or in Event Viewer logs ?

Regards

8
2/12/2014 7:17:58 AM
1284 Reputation 156 Total posts

Hi,

PFA logs..

Regards
Sumit

9
2/12/2014 10:55:23 AM
1384 Reputation 152 Total posts

Hello everyone

I think we have a little misunderstanding here.
The database setup part for additional applications is required.
The blog post by Denis only shows a general approach at how one would resolve multiple applications.

If you don't want to use v4.9 please just run the v4.9 installer to add entries for new applications to existing database (option 3), afterwards you can continue to use v4.8 but as mentioned by Kristijan there are a few bugs fixed related to multi-tenancy.

Also, please use the same name for new applications as in the resolver module.

Regards,
Igor

10
1 2 3 4 5
This is a demo site for MonoX. Please visit Mono Software for more info.