0

We have a CMS application that currently is hosted under domain, and each of our clients have a sub domain to point to their version of the software. This is all hosted in IIS as 1 website, and the code checks the URL and determines which items it should display.

I am in the process of updating the software to use asp.net MVC web api and angularJS. I would like to host each site separately, so this would allow us to have a .config file for each client where we can setup different login methods (facebook, twitter or a custom one for a client) and also the company can have their own url/domain.

Am i right in thinking that in order to do this, i would need to have multiple copies of the website in separate folders and each folder would be setup as a different website in IIS?

This would make updating the software a bit of a pain, is there a way to have the website code in 1 place and have a separate config file for each client still?

I am not a "server" guy, but i know the basics in order to get a website up and running, so if someone has some examples that they can point me to about configuring this, that would be great.

Thanks in advance

Gillardo
  • 101
  • I'm not entirely sure how possible it is in your situation, but I've seen a situation where media was shared across several sites by using [virtual directories](http://www.iis.net/learn/get-started/planning-your-iis-architecture/understanding-sites-applications-and-virtual-directories-on-iis#Virtual) with `allowSubDirConfig` on false. – Reaces Jan 08 '15 at 14:54
  • There are a couple of links in response to this question that might help - look at the codebase directive. http://stackoverflow.com/questions/7417104/how-to-easily-include-common-code-across-multiple-asp-net-mvc-sites – Steve365 Jan 09 '15 at 21:44

1 Answers1

1

I would avoid using multiple sites/virtual directories pointing to the same physical folder. Especially if you're planning on adding more clients/sites, deployment/config changes will take down all of the sites depending on when/how you update.

Having separate sites gives you an advantage of being able to deploy one at a time, for example to test a new feature without affecting the rest of the sites. As long as you automate deployment of the same code, updating all should not be an issue, in the end it's all just file copy. Having this setup will also enable you to deploy feature branches, if you're using those, if not you will want to when you have lots of clients wanting different features and not wanting to be first to get new changes. I've managed over 500 sites running same code base this way with all having their own config/master pages/templates/etc.

Alternatively, if you still want to keep 1 site, just store "per client" configuration in your database so you don't have to have different config files for each.

andryuha
  • 297
  • 2
  • 8
  • Thank u. This does sound like the option to go for especially if i can automate the upgrade process. What about updating each web.config? I guess i would have to write something to automate this as well? – Gillardo Jan 21 '15 at 17:59
  • Is there also a limit on how many separate websites u can/should setup on one iis instance? – Gillardo Jan 21 '15 at 17:59
  • I kept the web.config the same across everyone, but only keeping client specific things like connection strings/etc in external config files. Here is a [decent article](https://learnable.com/books/the-asp-net-2-0-anthology-101-essential-tips-tricks-hacks/preview/how-can-i-simplify-my-web-config-file-a64852b) how to accomplish that. – andryuha Jan 22 '15 at 01:37
  • There is no limit to how many sites you can have, but you will run into hardware limitations like CPU/RAM/Disk IO as you get more and more sites on the server. You'll have to see how many yours will handle. – andryuha Jan 22 '15 at 01:50