Jan
6
2012

IIS7: Moving the INETPUB directory to a different drive

Great article on what is involved in moving the IIS root folder in Server 2008 and newer OSs.

 

Having your content on a different partition than your Operating System is a good security practice. In previous IIS versions is was possible to do this during setup time in an unattend file. Due to changes in Vista and Windows Server 2008 setup it became impossible to do that however. After setup the IIS7 INETPUB directory will be on the same partition as Windows. Moving the INETPUB directory to a different drive has to be done after setup completes. Here is a table of configuration entries that use the INETPUB directory on a default install. An example in the right column shows how to move the setting to a different drive using the APPCMD command-line tool. Once all the settings are moved the only step left is to copy the INETPUB directory via XCOPY. Here is a link to a batch file (packaged up in MOVEIIS7ROOT.ZIP) that moves the INETPUB directory to a drive of your choice.

Directory Config setting location Example how to move setting to a different drive (this example uses the F:\ drive)
LOGS\FREBLOGS Failed Request Event Buffering (FREB) is a new IIS7 feature that logs failed requests. The default path for FREB logs is %systemdrive%\inetpub\logs\FailedReqLogfiles. %windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/sites -siteDefaults.traceFailedRequestsLogging.directory:"F:\inetpub\logs\FailedReqLogFiles"
LOGS\LOGFILES The default path for IIS7 log files is %systemdrive%\inetpub\logs\logfiles. %windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/sites -siteDefaults.logfile.directory:"F:\inetpub\logs\logfiles"%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/log -centralBinaryLogFile.directory:"F:\inetpub\logs\logfiles"%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/log -centralW3CLogFile.directory:"F:\inetpub\logs\logfiles"
TEMP\APPPOOLS AppPool isolation is a new feature in IIS7. A dedicated AppPool configuration file gets automatically created before a new Application Pool is started. The default location of these files is %systemdrive%\inetpub\temp\appPools  reg add HKLM\System\CurrentControlSet\Services\WAS\Parameters /v ConfigIsolationPath /t REG_SZ /d f:\inetpub\temp\appPools 
HISTORY Configuration history ensures that changes can be rolled back. The default location for configuration history is %systemdrive%\inetpub\history %windir%\system32\inetsrv\appcmd set config -section:system.applicationhost/configHistory -path:f:\inetpub\history
TEMP\ASP COMPILED TEMPLATES Classic ASP stores compiled ASP code on disk if more than 250 compiled templates are in memory. The default disk cache location is "%systemdrive%\inetpub\temp\ASP Compiled Templates" %windir%\system32\inetsrv\appcmd set config -section:system.webServer/asp -cache.disktemplateCacheDirectory:"f:\inetpub\temp\ASP Compiled Templates"
TEMP\IIS TEMPORARY COMPRESSED FILES IIS7 will cache compressed responses on disk if necessary. The default location for the compression cache is "%systemdrive%\inetpub\temp\IIS Temporary Compressed Files" %windir%\system32\inetsrv\appcmd set config -section:system.webServer/httpCompression -directory:"f:\inetpub\temp\IIS Temporary Compressed Files"
WWWROOT IIS7 comes with a Default Web Site which points to %systemdrive%\inetpub\wwwroot. %windir%\system32\inetsrv\appcmd set vdir "Default Web Site/" -physicalPath:f:\inetpub\wwwroot
CUSTERR IIS7 stores Custom Error Pages in %systemdrive%\inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='401'].prefixLanguageFilePath:f:\inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='403'].prefixLanguageFilePath:f:\inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='404'].prefixLanguageFilePath:f:\inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='405'].prefixLanguageFilePath:f:\inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='406'].prefixLanguageFilePath:f:\inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='412'].prefixLanguageFilePath:f:\inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='500'].prefixLanguageFilePath:f:\inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='501'].prefixLanguageFilePath:f:\inetpub\custerr%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='502'].prefixLanguageFilePath:f:\inetpub\custerr
WWWROOT and FTPROOT Locations Service Packs and other installers need to know where your WWWROOT and FTPROOT directory is. That's why the location is also specified in the registry.

reg add HKLM\Software\Microsoft\inetstp /v PathWWWRoot /t REG_SZ /d f:\inetpub\wwwroot
reg add HKLM\Software\Microsoft\inetstp /v PathFTPRoot /t REG_SZ /d f:\inetpub\ftproot

 

MOVING THE CONTENT:

Once the configuration is changed you have to copy all content from your root drive to your new drive including ACLs and empty directories:

Example:

                    xcopy c:\inetpub f:\inetpub /E /O /I

 

/E copies all directories even if they are empty
/O copies all security settings, i.e. Access Control Lists on files and directories
/I assumes the destination is a directory

PLEASE BE AWARE OF THE FOLLOWING:
WINDOWS SERVICING EVENTS (I.E. HOTFIXES AND SERVICE PACKS) WOULD STILL REPLACE FILES IN THE ORIGINAL DIRECTORIES. THE LIKELIHOOD THAT FILES IN THE INETPUB DIRECTORIES HAVE
TO BE REPLACED BY SERVICING IS LOW BUT FOR THIS REASON DELETING THE ORIGINAL DIRECTORIES IS NOT POSSIBLE.

Local copy of download

moveiis7root.zip (1.66 kb)

Nov
12
2010

Application Pool Recycle Utility for SharePoint Developers

This is a copy from here....

This freeware application is a System Tray utility for providing quick access to common IIS tasks which are useful on a SharePoint development box. It may also be useful to others working with IIS. In essence, it enumerates the app pools on your box and lets you right click 'em to bounce 'em!

If you are experiencing problems with APM, please see the FAQ.

 


Version 3.0.0.0 (7th December 2009)

SharePoint 2010 and IIS7 only

apm3a[3]

removal of IIS6 legacy code 
addition of new SP2010 services 
SharePoint to IIS App Pool name mapping

Download 
Application Pool Manager 3.0.0.0.

 


Version 2.0.0.0 (27th November 2008)

APM 2.0.0.0

Complete rewrite 
Vastly reduced working set 
Full Vista support 
UAC manifest 
IIS status detection 
IIS6 operations use legacy APIs 
IIS7 operations use Microsoft.Web.Administration 
Event Logging

Download 
Application Pool Manager 2.0.0.0.

 


Version 1.1.0.0 (23rd May 2008)

APM 1.1.0.0

 

New Options Layout 
Form does not show on start up 
Warm Up and IISReset now run in the background 
Option to hide Tool Tips 
Ability to hide Application Pools 
Restart WSS Timer & WSS Admin Services 
STSADM now works on localised versions of Windows Server 
Ability to exclude STSADM from Warm Up 
PID displayed on context menu for spun up Application Pools 
Version Check

Download 
Application Pool Manager 1.1.0.0.

 


Version 1.0.3.0 (10th August 2007)

Added Tooltip to display Process ID if an app pool has spun up. Refreshes in event of recycle. 
Does not depend upon iisapp.vbs

Windows 2008/Vista Support: Requires Legacy IIS WMI.

Download 
Application Pool Manager 1.0.3.0.

 


Version 1.0.2.0 (14th April 2007) 

Added Support for Windows Vista. 
Added ability to refresh the list of Application Pools. 
Removed dependency upon the "Warm Up" scripts. 
Added ability to "warm up" multiple URLs. 
Improved notifications. 
Removed 'Recycle' tooltip which caused artifacts on Virtual Machines. 
Improved keyboard navigation.

 

Application Pool Manager 1.0.2.0

System Requirements 
Windows Server 2003 Service Pack 1 or later, or Windows Vista. 
Internet Information Services 6.0 or 7.0 (with IIS6 Management Compatability installed). 
.NET Framework 2.0.

Download 
Application Pool Manager 1.0.2.0.

Instructions for post event warm ups: 
Enter the full URLs (including http:// , /default.aspx or /pages/default.aspx etc) in comma seperated format. Warm ups do not support HTTP 302s. There is no need to install the Warm Up scripts with this version. If you are upgrading from the previous version, remove the Path within applicationpoolmanager.config, this is no longer required.

 


Version 1.0.1.0 
Added Event Notifications. 
Added ability to perform an IISReset. 
Added ability to perform post event "Warm Ups".

System Requirements 
Windows Server 2003 Service Pack 1 or later. 
Internet Information Services 6.0 
.NET Framework 2.0

Download 
Application Pool Manager 1.0.1.0

 

Instructions for configuring post event "Warm Ups".

This requires the Warm Up Scripts posted by Joel Oleson. Download the ZIP file and extract the contents to a folder on your local disk (e.g. c:\warmup).

  1. Within the Options dialog of Application Pool Manager, select the Enable Post Events Warm Up check box.
  2. In the Path to WarmUpServer.cmd text box, enter the path you extracted the scripts to. 
    Note: do not include a trailing slash, or the filename itself.
  3. In the URL to Warm Up text box, enter the hostname you wish to warm up. 
    Note: do not include http:// or a trailing slash.
  4. Click OK to save the configuration. The configuration is persisted in the ApplicationPoolManager.config file.

Following a IISReset or Application Pool Recycle event, WarmUpServer.cmd will be run, and you will receive notifications of it's progress:

  

Note that the file startup.bat is redundant and not required. STSADM is run to warm up the admin interfaces by Application Pool Manager. Also there will be a delay whilst the HTTP GETs performed by WarmUpServer are executed before the final notification is displayed.

Don't forget to modify the WarmUpServer.cmd file to reference correct URLs for your SharePoint Central Administration and Shared Services Provider Administration web sites.

 

 

What might get done in the next version.

  •  
    • Allow associations between Application Pools and Warm Up Hosts. 
      e.g SharePoint Intranet App Pool when recycled warms up http://intranet/ but 
      SharePoint WCM App Pool when recycled warms up http://wcm/
    • Removal of initial display of About/Options form (if I can figure out how to do that).
    • Activate via keyboard shortcut (if I can figure out how to do that).
    • Add keyboard shortcuts for each Application Pool displayed.
    • Add ability to hide Application Pools (e.g. SharePoint Central Administration v3).
    • Add Start and Stop operations.

If you have feature requests, please leave a comment here. No promises!!

Aug
17
2010

Identify a web server

Here is a quick way to tell what software a web server is running

 

  1. Open a command prompt
  2. Enter: telnet [SERVER NAME/IP] 80
  3. Enter: HEAD / HTTP/1.0
  4. Enter: [blank line]
Result should look something like this

HTTP/1.1 200 OK
Server: Sun-ONE-Web-Server/6.1
Date: Tue, 17 Aug 2010 20:38:38 GMT
Content-type: text/html
Connection: close

or 


HTTP/1.0 500 Internal Server Error
Server: Microsoft-IIS
Date: Tue, 17 Aug 2010 20:41:41 GMT
p3p: CP="CAO PSA OUR"
Content-type: text/html