views:

189

answers:

1

Hi,

I want to know the best way of hosting a web application for different domains. What I want to achieve is this:

  1. Have single folder of the web application for easier maintenance.
  2. Be able to override some parts of Web.Config per each site (ATM only ConnectionString, but could be more).
  3. Store log files on file system without interferring between web sites.
  4. Store other files (produced by the application) on file system without interferring between sites.

The brute-force solution would be to create directory for each web site and change all the configuration for each one independently. This one really guarantess the sites are independent.

But for the sake of easier maintenance (is it really easier?) I would like to have the application in one folder (so I deploy in to one place, upgrade once etc).
But not sure how in this case I can achive things I mentioned.

I would like to hear some suggestions and maybe there is an elegant solution for this.

Thanks,
Dmitriy.

A: 

If you use the same files for multiple sites you will experience file locking. I would argue it is easier to Manage the web sites by separating it as well, because having a single shared web.config could confuse settings. Eg pointing the correct tracing/logging to the correct locations.

Russell
What files can be locked? ASP.NET compiles the files into a separate temp directory per web site. And yes, shared config does confuse the settings and that's why I asked what is a elegant solution.
Dmytrii Nagirniak
When you use pre-compiled applications (faster application launch speed, and hides aspx source), the ASP .NET doesn't do a recompile. If you dont recompile, using the implementation strategy you mentioned, you still have multiple copies of the assemblies (stored in the iis cache), it is just asp .net manages their locations.
Russell
I don't precompile the application. Can you point me to the article that shows .NET assemblies stored in IIS Cache? I don't think there is something to do with IIS cache. Also is your answer to have different folders for the same app and do not share anything?
Dmytrii Nagirniak
The cache is stored in "Temporary ASP.NET Files folder" as per this article:http://www.informit.com/articles/article.aspx?p=1073232I would reason to have different folders for the same app on each server in most scenarios. Hope you find this helpful. :)
Russell
Temporary ASP.NET Files is ASP.NET Cache, but NOT IIS. The article has nothing about cashing assemblies in **IIS**. So I still don't get what **assemblies ** can be locked because of so called "IIS Cache".
Dmytrii Nagirniak
Assembly locking occurs when ASP .net pre-compilation is done (not on the fly).My original terminology of IIS cache was incorrect: the compiled assemblies are stored in the "Temporary ASP .NET Files Folder."
Russell
Ok. We don't have IIS Cache. ASP.NET locks the compiled assembly (the one in Temp folder), not the assemblies in the application bin directory. Thus multiple web sites do not interfer as they lock their own, private assemblies. In any case, it doesn't answer my question.
Dmytrii Nagirniak
No - the problem is when you precompile the site, the assemblies are in the application bin directory, thus they will interfere.
Russell
Apart from locking precompiled (which is not my case) assemblies what are the other things to consider?
Dmytrii Nagirniak