473,398 Members | 2,212 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Multiple sites sharing single web.config file

Hello

I would like to have several sites share a single web.config file. To accomplish this, I would point the root of these sites to the same folder. Is there any reason why I might not want to do this? (IIS 5 or 6

In case you're wondering why I would do this, we have many web sites on a single server, and there are groups of sites that need to share common configuration information. I'd like to ease some administration by having one web.config file for each of these "site groupings". There may be many "site groupings", so I cannot use the machine.config file

An interesting side question: assuming that I do the above, is it ok to have several web applications sharing a single bin folder? If that is an OK solution, then I just might be able to avoid using the gac, any thoughts on that

Thanks
BPearson
Nov 18 '05 #1
5 10484
I have never tried it, but you should be able to specify particular items using the <location> element in the machine.config file. In there, you can specify which locations those particular settings apply to, and the rest of the sites on that server will ignore that section.
Nov 18 '05 #2
Hi BPearson,
I think it is important for you to understand how multiple Web.config
files can appear in multiple directories on a ASP.NET Web application
server.
Each Web.config file applies configuration settings to its own
directory and all the sub directories below it.Web.config files in sub
directories can supply configuration
information in addition to that inherited from parent directories, and the
sub directory configuartion settings can modify or override settings defined
in parent directories.
What you need to do is,
Make your groupings based on directory structure.
For example if you have database connection information
affecting all the web applications you put that key in the Web.config file
in the parent directory in the highest
level of the web site so that all the sub directories(up to the lowest
hierarchy in the directory structure) can inherit that information.
But in some cases for some web applications you need
to override the configuation settings in the root directory or put new
settings,so put that in the directory of that application so that
all the sub directories under it can make use of it(these sub directories
can be associated with it's own iis applications),you may call it a group.
You don't need to have several web applications
sharing the same bin folder,as you create more and more applications this
will be tedious to manage and
if that iis application goes down, lot of your web applications will stop
working.
You can have a web application with its own virtual
directory and bin folder,but you can still inherit the configuration
information from the parent directories.
If your application runs on Windows 2003 you can take
advantage of using application pools and configure each application on its
own worker process that
provides process-level isolation.This isolation is very good because if
something happens to the application pool only that web application(s) is
affected.

Hope this helps.
Regards,
Marshal Antony
..NET Developer
http://www.dotnetmarshal.com

"BPearson" <an*******@discussions.microsoft.com> wrote in message
news:BD**********************************@microsof t.com...
Hello,

I would like to have several sites share a single web.config file. To accomplish this, I would point the root of these sites to the same folder.
Is there any reason why I might not want to do this? (IIS 5 or 6)
In case you're wondering why I would do this, we have many web sites on a single server, and there are groups of sites that need to share common
configuration information. I'd like to ease some administration by having
one web.config file for each of these "site groupings". There may be many
"site groupings", so I cannot use the machine.config file.
An interesting side question: assuming that I do the above, is it ok to have several web applications sharing a single bin folder? If that is an OK
solution, then I just might be able to avoid using the gac, any thoughts on
that?
Thanks,
BPearson

Nov 18 '05 #3
Thank you for the reply. I do understand the cascading nature of the config files - but here is my dilemna:

machine.config allows me to specify configs that apply to the entire machine.
web.config allows me to specify configs that apply to one web site (or to more granular directories/virtual directories below).

BUT, I need something in between. I want a config file that will apply to x web sites on the machine.

eg - I need a multiweb.config that allows me to specify configs for web sites X, Y, and Z. I might have 1000 websites on a machine, and I need one config file that applies to 100 of them, another config that applies to another 200 and so on. Having web applications below the website level is not good enough, each web application must be a separate web site.

In my original post, I've gave a description of how I want to accomplish this, and I can't think of any negative consequences .... does anyone out there know of some reason why my proposed solution to this problem will not work? Or maybe someone knows that this is OK to do, and wants to say "go for it!"?

Thanks!
BPearson

----- Marshal Antony wrote: -----

Hi BPearson,
I think it is important for you to understand how multiple Web.config
files can appear in multiple directories on a ASP.NET Web application
server.
Each Web.config file applies configuration settings to its own
directory and all the sub directories below it.Web.config files in sub
directories can supply configuration
information in addition to that inherited from parent directories, and the
sub directory configuartion settings can modify or override settings defined
in parent directories.
What you need to do is,
Make your groupings based on directory structure.
For example if you have database connection information
affecting all the web applications you put that key in the Web.config file
in the parent directory in the highest
level of the web site so that all the sub directories(up to the lowest
hierarchy in the directory structure) can inherit that information.
But in some cases for some web applications you need
to override the configuation settings in the root directory or put new
settings,so put that in the directory of that application so that
all the sub directories under it can make use of it(these sub directories
can be associated with it's own iis applications),you may call it a group.
You don't need to have several web applications
sharing the same bin folder,as you create more and more applications this
will be tedious to manage and
if that iis application goes down, lot of your web applications will stop
working.
You can have a web application with its own virtual
directory and bin folder,but you can still inherit the configuration
information from the parent directories.
If your application runs on Windows 2003 you can take
advantage of using application pools and configure each application on its
own worker process that
provides process-level isolation.This isolation is very good because if
something happens to the application pool only that web application(s) is
affected.

Hope this helps.
Regards,
Marshal Antony
..NET Developer
http://www.dotnetmarshal.com

"BPearson" <an*******@discussions.microsoft.com> wrote in message
news:BD**********************************@microsof t.com...
Hello,
I would like to have several sites share a single web.config file. To accomplish this, I would point the root of these sites to the same folder.
Is there any reason why I might not want to do this? (IIS 5 or 6) In case you're wondering why I would do this, we have many web sites on a single server, and there are groups of sites that need to share common
configuration information. I'd like to ease some administration by having
one web.config file for each of these "site groupings". There may be many
"site groupings", so I cannot use the machine.config file. An interesting side question: assuming that I do the above, is it ok to have several web applications sharing a single bin folder? If that is an OK
solution, then I just might be able to avoid using the gac, any thoughts on
that? Thanks,

BPearson


Nov 18 '05 #4
Hi Bpearson,
I think as David pointed out you can do it by the location element
in the machine.config.
You may need to use the allowOverride="false" for the location element.
Also there is a location element in the Web.config which you can make use as
well in some cases.
Here is a link which explains it clearly.
http://support.microsoft.com/default...b;EN-US;815174
Hope this helps.
Regards,
Marshal Antony
..NET eveloper
http://www.dotnetmarshal.com


"BPearson" <an*******@discussions.microsoft.com> wrote in message
news:75**********************************@microsof t.com...
Thank you for the reply. I do understand the cascading nature of the config files - but here is my dilemna:
machine.config allows me to specify configs that apply to the entire machine. web.config allows me to specify configs that apply to one web site (or to more granular directories/virtual directories below).
BUT, I need something in between. I want a config file that will apply to x web sites on the machine.
eg - I need a multiweb.config that allows me to specify configs for web sites X, Y, and Z. I might have 1000 websites on a machine, and I need one
config file that applies to 100 of them, another config that applies to
another 200 and so on. Having web applications below the website level is
not good enough, each web application must be a separate web site.
In my original post, I've gave a description of how I want to accomplish this, and I can't think of any negative consequences .... does anyone out
there know of some reason why my proposed solution to this problem will not
work? Or maybe someone knows that this is OK to do, and wants to say "go
for it!"?
Thanks!
BPearson

----- Marshal Antony wrote: -----

Hi BPearson,
I think it is important for you to understand how multiple Web.config files can appear in multiple directories on a ASP.NET Web application
server.
Each Web.config file applies configuration settings to its own directory and all the sub directories below it.Web.config files in sub directories can supply configuration
information in addition to that inherited from parent directories, and the sub directory configuartion settings can modify or override settings defined in parent directories.
What you need to do is,
Make your groupings based on directory structure.
For example if you have database connection information affecting all the web applications you put that key in the Web.config file in the parent directory in the highest
level of the web site so that all the sub directories(up to the lowest hierarchy in the directory structure) can inherit that information.
But in some cases for some web applications you need to override the configuation settings in the root directory or put new settings,so put that in the directory of that application so that
all the sub directories under it can make use of it(these sub directories can be associated with it's own iis applications),you may call it a group. You don't need to have several web applications sharing the same bin folder,as you create more and more applications this will be tedious to manage and
if that iis application goes down, lot of your web applications will stop working.
You can have a web application with its own virtual directory and bin folder,but you can still inherit the configuration
information from the parent directories.
If your application runs on Windows 2003 you can take
advantage of using application pools and configure each application on its own worker process that
provides process-level isolation.This isolation is very good because if something happens to the application pool only that web application(s) is affected.

Hope this helps.
Regards,
Marshal Antony
..NET Developer
http://www.dotnetmarshal.com

"BPearson" <an*******@discussions.microsoft.com> wrote in message
news:BD**********************************@microsof t.com...
> Hello,
>> I would like to have several sites share a single web.config file.
To
accomplish this, I would point the root of these sites to the same folder. Is there any reason why I might not want to do this? (IIS 5 or 6) >> In case you're wondering why I would do this, we have many web
sites on a
single server, and there are groups of sites that need to share common configuration information. I'd like to ease some administration by having one web.config file for each of these "site groupings". There may be many "site groupings", so I cannot use the machine.config file. >> An interesting side question: assuming that I do the above, is it
ok to
have several web applications sharing a single bin folder? If that is an OK solution, then I just might be able to avoid using the gac, any thoughts on that? >> Thanks,

> BPearson


Nov 18 '05 #5
You can try to use "junction" utility from http://www.sysinternals.com
"BPearson" <an*******@discussions.microsoft.com> wrote in message
news:BD**********************************@microsof t.com...
Hello,

I would like to have several sites share a single web.config file. To accomplish this, I would point the root of these sites to the same folder.
Is there any reason why I might not want to do this? (IIS 5 or 6)
In case you're wondering why I would do this, we have many web sites on a single server, and there are groups of sites that need to share common
configuration information. I'd like to ease some administration by having
one web.config file for each of these "site groupings". There may be many
"site groupings", so I cannot use the machine.config file.
An interesting side question: assuming that I do the above, is it ok to have several web applications sharing a single bin folder? If that is an OK
solution, then I just might be able to avoid using the gac, any thoughts on
that?
Thanks,
BPearson

Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Craig | last post by:
I've developed an single sign on web application that we'd like to use with all the applications we're developing. The application's connection string is stored in web.config. I've gotten some...
1
by: abhijit | last post by:
Hi Xperts, I have multiple Web Sites in different Live Servers. I want to login any of the sites, and then I will access all the other sites without giving any more login information (i.e I want...
5
by: George | last post by:
Hi, Is it possible to specify the location of a web.config file in an ASP.NET application? I have one ASP.NET application which is to be hosted on 2 web sites in the same web server. I want...
6
by: Ludvig | last post by:
I have various domains using the same application/assembly They differ in contents and design, based on a "site id", and get its information from an SQL server. Now I have to deploy the...
3
by: Manohar Kamath | last post by:
Hello all, Consider that you have an ASP.NET application you have deployed as www.somesite.com. If I would like to create an intranet site with the same code (say http://intranetsite/ for use...
9
by: Graham | last post by:
I have been having some fun learning and using the new Controls and methods in .Net 2.0 which will make my life in the future easier and faster. Specifically the new databinding practises and...
2
by: Robert | last post by:
I am trying to run ASP.Net 2.0 pages within a ASP.Net 1.1 application. The 2.0 pages are located in a sub-directory of the 1.1 application. Once I create a new web.config file in the 2.0 folder the...
1
by: Mike Read | last post by:
I am creating a commercial site that will have 2 main components. Both being created with ASP.net 2.0 1. Main site which has public access to all pages, this site contains multiple...
1
by: Tony Jones | last post by:
Can I have two ASP.NET site using the same membership provider settings? For this to happen, the applicationName would have to be the same, but what about the configuration of the <properties>...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.