Last post Jul 27, 2010 08:26 PM by jigkin21
Jul 27, 2010 03:59 PM|jigkin21|LINK
How are you? I hope you could answer my below question.
We have 5 production servers in my company. Each server contains almost 50 sites. To hide the ASP.NET version, we have added <httpRuntime enableVersionHeader="false" /> line into web.config file for majority of the sites and pages. However, I have found
that there are few sites and pages doesn't have this line added. Now, it's a pain in a neck to add the line under web.config file for each individual site and the pages. Additionally, we have to do this change into all 5 production servers.
So after my little research, I found that I can simply add this line into machine.config file which will take care of the entire server.
However, I have one silly question. Will this change affect those sites and pages whichever's web.config file already has this line added? OR I have to remove this line from the web.config and then I can add into machine.config? OR It doesn't matter if I
keep on both places (web.config and machine.config) or not?
I am more concern since these 5 servers are production servers and I don't want to take a chance.
Please let me know if you require any more info to answer my question.
Jul 27, 2010 07:10 PM|karan@dotnet|LINK
Machine.config is the file that has the master settings for the machine and affects not only asp.net but other .NET applications. It is advisable not to mess with it. Since the configuration settings cascade ie web.config in the machine gets overridden
by settings in the app etc.. it is advisable to use the application level web.config for app specific settings.
Back to your question. Yes it will change/overwrite all your individual web.config file settings you might have and it should not affect the same changes that you already have in those files.
Jul 27, 2010 07:47 PM|jigkin21|LINK
Thank you so much, Karan.
I think I should go with machine.conf change because this is the only and one time change we would like to make on all 5 production servers so I don't think I will mess up anything else with the machine.conf file. For precausion, I am going to backup the
original/existed machine.conf file so I can retrive it if something goes wrong.
Does it sounds good?
Jul 27, 2010 07:57 PM|karan@dotnet|LINK
Yes sure its good to keep a backup to restore it back if something goes wrong
Jul 27, 2010 08:26 PM|jigkin21|LINK
Much appreciated with your quick and sensible responce.