views:

327

answers:

1

Looking ahead in the likely event we will build a server farm rather than maintaining individual servers etc I am looking into ways to reduce the task required for running an asp.net web application on a server farm.

With regards web.config files, I belive that all the web.configs need to be same on each machine. I assume that in the case where we use the configsource attribute to separate sections into their own files..eg:

...
<pages configSource="App_Data\Configuration\pages.xml"/>
...

...that all these files also need to be the same. This certainly makes sense but does this work in a server farm? ie using the configSource links or would it be a better practice to have a single web.config in each app on each machine?

+1  A: 

I would recommend a single web.config for each application and each machine.

Kane
Do you recommend this because it results in only one file to update and keep synched across the servers? Are there any other benefits?
Mark Redman
Accepted as the logical choice.
Mark Redman
Sorry for not getting back to you mark. The reason that I'd have the configs separated is redundancy. If the files are shared on a network drive you have a single point of failure (for all web servers). There are also a number of security issues with configuration files on a network share. The last reason would be to allow each server different configuration behaviour (if required). Hope that helps.Kane
Kane
Hi Kane, I would definately not have config files on a share, indeed that would be a single point of failure. I mean I have a web.config in the root of the site and have split some of the sections into their own files (connectionstrings, appsettings, pages(usercontrols) etc. These are just located in the App_Data folder for security. I guess as long as they're the same it should be ok? and if I need to sync the applications and other files in a an automated process, a couple more configs doesnt matter. I cant see how different servers would need different configurations...yet?
Mark Redman