views:

82

answers:

1

ASP.net MVC

How to run multiple instances of the same app at the same time in different subdomains?

I have a dozen or so subdomains.

sub1.website.com sub2.website.com

and the folder structure like this

\website\sub1 \website\sub2

If i need to run the same app for all of the subdomains, what would be the best appoach?

Host is in the root \website\ and have it figure out where to look based on the "user"? (i imagine i need to implement de logic in the code)

OR

Just copy the app in each of the subdomains, and have the app "not knowing" that it is actually an instance? (this would mean that when i update the app, i have to copy it everywhere)

What other approaches are there to this kind of issue? Each app will use a different database name so that will need to we coded in somekind of external file.

A: 

If they use separate databases, this implies to me that they are completely separate sites. The fact that they are the same codebase is irrelevant.

Deploy each one to

/website/sub1
/website/sub2

Yes, when you release new code you will need to do it to each folder, but this is always a deployment problem, dont mangle your code or have some external config to compensate.

Write a deployment script in ruby/powershell/whatever if its a major headache

Andrew Bullock
Hello,Thank you for your comment. I have one more question... If i am to automate the add/remove of companies and users via a "master" app, would this app execute the same powershell script?Or do i have to "code" everything inside the app this time?
basilmir