Quick Guide for Shared Hosting Deployment

By Walter Oliver

December 1, 2007

Introduction

This article provides a basic overview of the manual steps to deploy a front-end Web server running IIS 7.5 or above for the Shared Hosting scenario. It also includes key per-site configuration settings. These steps are described in more detail in the Web Server For Shared Hosting and File Server For Content Storage articles of this guide.

Web Server Pre-Setup

Before configuring permissions on the file server, you must join the Web server to an Active Directory domain controller.

Note: It is possible to not use domain accounts, but the setup in this shared hosting architecture assumes a domain-joined machine. Certain things need to be changed for non-domain scenarios (if you are using content on a remote file server, the same user account with the same password must exist on both the Web server and the file server, for instance).

  1. Join the Web server to the Active Directory domain controller. This is not required if you are setting up a standalone server
  2. If you will be storing content or configuration on a remote file server, configure the MaxCmds registry key on the Web server -- see SMB Commands Registry Keys.
  3. If you will be using a Windows-based file server, add the MaxMptCt and MaxWorkItems registry keys on the file server -- see SMB Command Registry Keys.

Web Server Setup

  1. Install the Web Server Role - IIS.
  2. Run AppCmd to create an initial Backup.
  3. %windir%\system32\inetsrv\appcmd add backup "FirstBackup"
  4. Configure 32-bit mode worker processes globally on the server.
  5. %windir%\system32\inetsrv\appcmd  set config -section:applicationPools -applicationPoolDefaults.enable32BitAppOnWin64:true
  6. Configure the Application Pool Identity as Anonymous User (anonymous user is to be the worker process identity) globally on the server.
  7. %windir%\system32\inetsrv\appcmd set config -section:anonymousAuthentication /username:"" --password
  8. Configure Default Documents at the server level in IIS Manager.
  9. Select W3C Fields to Log at the server level in IIS Manager.
  10. Configure the dynamicIdleThreshold property.
  11. Configure Dynamic Compression.
  12. Enable Remote Web Service Management in IIS Manager.
    • Note: If you are using IIS Manager Users and the content is stored in a file share (UNC), set WMSVC to run as a custom identity that has read/write access to the share. For details on WMSVC’s read/write access actions see Remote Administration Behavior Matrix.
  13. Enable the WMSVC port within the local firewall on your Web server by opening the Control Panel and double-clicking the Windows Firewall icon. Then select "Change firewall settings" and add the port for the service.
    • Note: The firewall is enabled by default and you must add the default port (8172) or custom port if you chose one.
  14. Create a custom trust level based on Medium trust.
    • Set unrestricted true for WebPermission.
    • Add custom trust to Web.config and lock it.
  15. Enable Full trust to the remote file share. See Share and NTFS Permissions for more details.
  16. caspol -m -ag 1.  -url "file://\\remotefileserver\content$\*" FullTrust
  17. Open %windir%\Microsoft.NET\Framework\{version}\aspnet.config and set the gcServer enabled to false instead of true.
  18. <configuration> 
    <runtime>
    <gcServer enabled="false"/>
    </runtime>
    </configuration>
  19. Disable ASP template cache.
  20. %windir%\system32\inetsrv\appcmd set config -section:asp -cache.maxDiskTemplateCacheFiles:0
  21. Run AppCmd to create a Backup after all successful changes.
  22. %windir%\system32\inetsrv\appcmd add backup "AfterWalkthroughBackup"
  23. Enable Shared Configuration, if needed for your environment.
  24. Create a backup schedule.