Setting up Shared configuration on IIS 7.0

Posted: Jan 12, 2009  9 comments  

Average Rating

Tags
Configuration

Problem: When IIS 7.0 server is configured to work in shared configuration mode then configuration files are stored on a file share. This configuration is recommended for setting up web farms. But in case file share goes offline, the whole set up fails and web servers stop responding. Moreover when the file share comes up again, IIS server is not able to detect it gives following error message:

HTTP Error 500.19 - internal server errorThe requested page cannot be accessed because the related configuration data for the page is invalid.

We have to do an IISreset to start the web servers again after this.


Resolution: Follow the below given steps to set up shared configuration with offline files (client side caching) enabled.


Step 1: On the Web server, in Control Panel, open Offline Files.

Step 2: In the Offline Files dialog box, click Enable Offline Files. Do not reboot the machine yet.

Step 3: Ensure that the cache is set to read only by running the following command:REG ADD "HKLM\System\CurrentControlSet\Services\CSC\Parameters" /v ReadOnlyCache /t REG_DWORD /d 1 /f

Step 4:
Reboot the Web server.

Step 5:
Browse to the file share folder from web server. Right click and select “Always Available Offline”.

Step 6: Go to control panel  -- > Offline Files. Select Schedule option.

Step 7: Schedule offline file sync after every 1 day or as per the requirement. This could be in minutes too. Even without setting up any scheduler, the moment I change anything in applicationhost.config file, it is reflected on the web server.

Now the web server works fine even if the file share is offline and there is no need of IISReset now.

Many thanks to Amol Mehrotra for helping with the content.

Comments

I always use DFS to replicate the .config files so that each server has a physical copy of the file locally.  This eliminates the need for offline files, and the possibility that the file is unavailable.

Jan 13 2009 by Anonymous

Thanks very much for sharing this...I appreciate seeing another alternative to DFS.

Jan 13 2009 by Anonymous

how would you set this up using dfs?

Jan 15 2009 by Anonymous

man i got some pc issues is there any willing to explain some of this stuff to me please?

Jan 20 2009 by jbkb

thank you ^_^

Feb 01 2009 by Anonymous

I found you need Desktop Experience installed for Offline Files to work:

msdn.microsoft.com/.../cc296092(VS.85).aspx

Feb 26 2009 by Bret Bentzinger

How do you schedule the offline files to sync using a domain account?

Sep 15 2009 by aplevine

So I have these setup in my production environment but when the primary webserver (the server sharing the config) reboots all server participating in the web farm all die...

whats funny is that from the OS I can get to the shared offline files by using explorer but IIS refuses to open, saying it cant open the shared location...

Any bright ideas?

Nov 23 2009 by 2revup

Submit a Comment

  • Plain text is accepted.
  • URLs starting with http:// are converted to links.