What changes are required in web.config file to configure Web Farm ?
Normally, when asked this in an interview, you will be expected to know that all machines in a web farm should have the same <machineKey>.
Read more details here (Generate Machine Key Elements for Web Farm).
Related
This is my first post on this forum. I have a question in regards to securing connection strings in web.config and app.config for a solution I am working on. I have a web farm with a central node that's used to push out the solution to all the servers in the web farm, this is done using a batch script.
I would like to secure the connection strings in the web and app configs on all the solutions. I know that aspnet_regiis can only be used with web.configs so it's not an option and I built a small app that secures connection strings for web and app configs but it only runs on one machine, how can I programmatically secure web and app configs in a web farm scenario? I haven't tested it yet, because I imagine it will fail, but can I just copy the programmatically secured web.config and app.config to all the servers and it will...just...work?
It will work, provided you do have the same machineKey value set for each machine.
You can set it in machine.config file in framework home directory.
I'm developing a web application wich needs access to a specific directory on one of our servers. When the application is deployed it will run as a specific 'user' (configured in the IIS Application Pool) with access permissions to the given directory.
While developing/debugging the application with Visual Studio 2010's built-in webserver, the application has no permissions to the directory.
What would be the best way to develop/debug this application?
By "built-in webserver" you mean cassini?
If so just deploy the site on the machine's IIS the website project properties.
IIS Express is also an option but I prefer to develop on an environment closest as possible to the one I have in production and IIS is the key service I want to make sure won't give me any deployment problems.
Cheers,
Alex
We need to deploy our asp.net web site in web farm which consists of 16 web servers. Whenever we need to roll out a new release it is very time consuming and tedious as we need to deploy it first on the DR environment (16 web servers) and then on to Live environment (16 web servers).
Currently we prepare the msi on our build server and copy it on all the front end web servers which involves first FTPing the msi to a common location on hosting network and then copying from the common location to each server.
After thet we backup the existing website and then run the installer one by one on each machine.
After installing the new version we replace the web.config file with the older one as it is encrypted and hardly contains any new thing in it as part of new release. This saves us from encrypting the web.config file again.
Could somebody please suggest a better way of doing this deployement as it is really turning out to be time consuming. Previously this model was ok for us as we had only 4 web servers but not it is no longer a sutable option.
Thanks..
Take a look at the Web Farm Framework. It will handle the replication of your application across your entire farm.
Another option is to use the "Shared Configuration" option in IIS7 as well as a DFS share to replicate all of your files and metabase configuration. This just won't handle registry changes or the GAC.
I am trying to deploy the Bugtracker.NET tool (http://ifdefined.com/bugtrackernet.html), which is a normal ASP.NET 2.0 application, into the default web site of an IIS which already has Sharepoint installed in it. The OS is Windows Server 2008 R2, IIS 7.5 and Sharepoint Services 3.0.
The question is that when I execute the application, I get a NullReferenceException because HttpContext.Current.Session is null, and I think that this could be due to a problem with the configuration of the web site, as the application runs perfect in web sites with no Sharepoint installed.
I already know that Sharepoint customizes the web site with handles, modules and so on, that all applications in the web site inherit, modifying their behavior. I have already given to the ASP.NET application Full trust level, enabled Anonymous authentication and InProc session state, but I am still getting that HttpContext.Current.Session is null. Even changing the app pool from Wss3AppPool to DefaultAppPool does not succeed.
Maybe someone could tell me which settings do I need to tweak in the web site in order to avoid this exception.
Many thanks in advance.
José Antonio Arroba
You need to look into Managed Paths and excluding the path to your bugtrackernet app.
However why do you HAVE to use the default web application?
Why not keep your life simple and setup a new IIS web application on a separate host header or subdomain and host your app there.
e.g.
http://bugtracker.yourdomain/
or just
http://bugtracker/
Anybody can provide me the best practices to be followed in deployment of asp.net web application & WCF service in IIS 7 regarding the IIS 7 configuration settings , Security setting, application access level settings..
Does this help? IIS Security. Where possible you should only install / enable the IIS features that you intend to use.
It depends on your situation.
I always publish my solution to a folder, zip it, ftp it to my server.
On the server (using RemoteDesktop) i backup the running version (makes me feel safe & secure) and delete all the files, except web.config. I unzip the file i sent and copy all the files, except web.config. If i made changes to web.config i adjust it manually.
This works for me because i have a shitty internet connection. If it were faster i'd do it differently.