Categories
Command Line cscript HTTP Headers IIS Linux Windows

Set IIS 6 (and IIS 7) custom HTTP headers from the command line

Command line method to set the Custom HTTP Headers.
*Must execute from (default) c:InetpubAdminScripts:

cscript adsutil.vbs set w3svc/HttpCustomHeaders “X-Powered-By: ASP.NET” “<Header 2>: <Value 2>” “<Header 3>: <Value 3>”

Just replace “Header 2”: “Value 2” and “Header 3”: “Value 3” with your own values. Add more as desired.

Note: This command updates/replaces current values and does not add to them so any existing value must be included or it will be overwritten. I included “X-Powered-By: ASP.NET” as it’s a common default HTTP header value.

This works on both IIS 6 and IIS 7, not sure about previous versions.

Categories
IIS Linux Web Deployment Tool Windows

Troubleshooting the Web Deployment Tool

This guide will help you troubleshoot the Web Deployment Tool.

Prerequisites

This guide requires the following prerequisites:

  • .NET Framework 2.0 SP1 or greater
  • Web Deployment Tool 1.0

Note: If you have not already installed the Web Deployment Tool, see Installing the Web Deployment Tool.

Troubleshooting operations

The first level of validation for an operation should be the -whatif flag. The -whatif flag will show you what would happen if you ran a command and everything was successful. It is intended to be a comparison flag, and will not show you many errors. But if the operation did not go as expected and –whatif did not find any issues, you can use the –verbose flag to specify output settings. This is very useful if you need to determine what failed to sync, and often gives additional detail about the operation.

To run with verbose output

1. Let’s say we were running a migration. Run the command again, with -verbose specified:

msdeploy.exe -verb:migrate -source:metakey=lm/w3svc/1,computername=Server1 -dest:metakey=lm/w3svc/1 -verbose >msdeploymigrate-verbose.log

By specifying > msdeploymigrate-verbose.log, the results of the operation and all the extra informational alerts will be listed in the log file and we can easily refer back to it.
Depending on the error, you should look through the log for related entries. For example, if a property wasn’t set correctly, check the verbose logging actions to see why it was missed or skipped.

Common errors

Cannot read configuration file or similar error may be due to running from a non-elevated command prompt on Windows Server 2008. Ensure you have administrative credentials for operations like reading or writing configuration or registry settings.
An assembly or other object with commas in its path does not sync correctly. This is a known issue and requires using double and single quotes around the path. For example, the path to an assembly contains commas and must be specially treated: -source:gacAssembly=”‘System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'”
If your site has no ServerComment set on IIS 6.0, the ABO Mapper component will be unable to recognize them on IIS 7.0 and they will not be migrated correctly.
If you do not have IIS installed on the source or destination machine when you are trying to access IIS-related providers such as metakey or apphostconfig, you may receive the following error message:

Retrieving the COM class factory for component with CLSID {2B72133B-3F5B-4602-8952-803546CE3344} failed due to the following error: 80040154.

Remote service errors

404 Remote file not found – the remote service is not installed or running, or the URL is incorrect. It is a Manual startup service so make sure that it is running.
The connection to the remote machine times out or returns a timeout error – verify that the port for the remote service is open on the target machine. If it is open, re-try the command. Many times it will work after a retry.

Summary

You have run operations with tracing or verbosity enabled as well as learned some errors that can occur. This guide will be updated to include additional error cases and troubleshooting tips.

Categories
IIS Linux Windows

Synchronize IIS 6.0 Between Servers

This will guide you through the process of using the Web Deployment Tool to sync a web site from a source to a destination on IIS 6.0. You can do this by “pushing” data to a remote destination, or by “pulling” data from a remote source. This guide will show both methods, as well as an option to just use an archive folder and not install the remote service.

Ways to sync using the Web Deployment Tool

  • Push (sync from a local source to a remote destination)
  • Pull (sync from a remote source to a local destination)
  • Independent Sync (initiate a sync from a machine where both destination and source are remote)
  • Manual Local Sync (create an archive of the source and copy it to the destination, then run it locally)

Prerequisites

This guide requires the following prerequisites:

  • .NET Framework 2.0 SP1 or greater
  • Web Deployment Tool 1.0

Note: If you have not already installed the Web Deployment Tool, see Installing the Web Deployment Tool.

Part 1 – View your site’s dependencies

1. Get the dependencies of the web site by running the following command:

msdeploy -verb:getDependencies -source:metakey=lm/w3svc/1

2. Review the output of the dependencies and look for any script maps or installed components in use by the site. For example, if Windows Authentication is in use by the web site, you will see .
3. If your site is inheriting any script maps, these will not be listed in the dependencies and you should also review the script maps for your site manually.
4. Compile a list of the components needed on the destination.
For detailed steps on analyzing the output of getDependencies, see Viewing Dependencies of a Web site.

Part 2 – Configure the target (destination)

1. Review the list of dependencies and install them on the destination server.
For example, let’s assume you had the following in use for your web site:

• ASP.NET

• Windows Authentication

• Anonymous Authentication

Based on analyzing your dependencies, you would install those components.

Part 3 – Sync your site to the target

1. Always make a backup of the destination and source servers. Even if you are just testing, it allows you to easily restore the state of your server.
2. Install the remote service on the source or the destination depending on if you want to “pull” the data from a remote source or “push” the data to a remote destination.
3. Start the service on the machine.

net start msdepsvc

4. Run the following command to validate what would happen if the sync were run. The whatif will not show every change, it will just show an optimistic view of what might be changed if everything succeeds (doesn’t catch errors where you can’t write to the destination, etc.)

Pushing to remote destination, running on source machine
msdeploy -verb:sync -source:metakey=lm/w3svc/1 -dest:metakey=lm/w3svc/1,computername=Server1 -whatif > msdeploysync.log
Pulling from a remote source, running on destination machine
msdeploy -verb:sync -source:metakey=lm/w3svc/1,computername=Server1 -dest:metakey=lm/w3svc/1 -whatif > msdeploysync.log

5. After verifying the output, run the same command again without the whatif flag:

Pushing to remote destination, running on source machine
msdeploy -verb:sync -source:metakey=lm/w3svc/1 -dest:metakey=lm/w3svc/1,computername=Server1 > msdeploysync.log
Pulling from a remote source, running on destination machine
msdeploy -verb:sync -source:metakey=lm/w3svc/1,computername=Server1 -dest:metakey=lm/w3svc/1 > msdeploysync.log

{Optional – Sync your site to the target using an archive}

If you don’t wish to sync from an archive, you can sync using the remote service.
1. Run the following command on the destination server to take an archive of the server for synchronization:

msdeploy -verb:sync  -source:metakey=lm/w3svc/1 -dest:archivedir=c:site1archive

2. Copy the archive folder to the destination server.
3. Run the following command on the destination server to validate what would happen if a sync was run:

msdeploy -verb:sync -source:archivedir=c:site1archive -dest:metakey=lm/w3svc/1 -whatif > msdeploysync.log

4. After verifying the output, run the same command again without the whatif flag:

msdeploy -verb:sync -source:archivedir=c:site1archive -dest:metakey=lm/w3svc/1 > msdeploysync.log

You are now done synchronizing your site. To verify, test browsing to the web site on the destination server. For troubleshooting help, see Troubleshooting the Web Deployment Tool.

Summary

You have now synchronized a web site from a source IIS 6.0 server to a destination IIS 6.0 server, including viewing the dependencies, configuring the destination IIS 6.0 server and performing the synchronization.

Categories
IIS Linux Web Deployment Tool Windows

Installing the Web Deployment Tool

What can be installed

  • Web Deployment Tool – Managed code framework that includes the public APIs and underlying engine. (This is the top-level node and cannot be removed.)
    • IIS Manager UI Module – UI module that allows users to perform a subset of deployment tasks, mainly packaging or deploying a Web site or app. Requires IIS 7.0 or IIS Remote Manager to be installed.
    • Remote Agent Service – An administrator-only service based on HTTP/HTTPS that allows server admins to connect and perform remote operations.
    • IIS 7.0 Deployment Handler – A handler that integrates with WMSVC and allows non-administrators or administrators to perform remote operations. Requires IIS 7.0 with WMSVC installed.

Choosing installation options

Before you install, decide whether you want to use the remote service to perform live operations between two servers, or if you prefer the offline mode. The remote service is not started by default and is set to Manual startup. It is only required to have it running during an operation and it can be stopped when not in use.
Offline mode is simply installation of the tool without the service. It requires you to create a local copy of a site or server, then manually copy this “snapshot” or archive to the destination.
Important note about installing the remote service: You only need the remote service installed on either the source or the destination of a sync. For example, to “push” all content from GoldenServer1 to Client1, Client2, etc., you would install the remote service on all client machines so that the content can be pushed from the source. Alternatively, you could have each client “pull” from the GoldenServer1, and only install the remote service on the source.

To install the tool using the default remote service URL

1. Download the Web Deployment Tool (x86 / x64).
2. Run the MSI file to install the tool.
3. Select a Custom installation to choose what to install.
4. Click on the remote service node to install the remote service.
5. Complete the installation.
6. Manually start the service by running the following command:

net start msdepsvc

7. Ensure that port 80 is open in the firewall.

To install the tool with a custom remote service URL

1. Download the Web Deployment Tool (x86 / x64).
2. Open an administrative command prompt on Windows Server 2008, or a command prompt on Windows 2003.
3. Change directory to the location of the setup file.
4. Run the following command (where the port and URL are specified, please customize):
msiexec /i  /passive ADDLOCAL=ALL LISTENURL=http://+:8080/MSDEPLOY2/
5. Manually start the service by running the following command:

net start msdepsvc

6. Ensure that the port you’ve chosen is open in the firewall.
The tool will be installed to %programfiles%IISMicrosoft Web Deploy. This cannot be changed.

Starting the Remote Service after Installation

The remote service will listen on http://+/MSDEPLOYAGENTSERVICE/ by default, or at whatever URL that you specified if you performed a custom installation.
You should now start the remote service. You can do this by going to Start > Run and typing services.msc. The service is listed as the Microsoft Web Deployment Agent Service.
The service startup is Manual by default, you can set the startup to Automatic in services.msc. You can also use the command-line tool, sc.exe, to set the startup to Automatic. Sc.exe is described in more detail in the following KB article, http://support.microsoft.com/kb/251192.

Example:

sc config msdepsvc start=auto

Summary

You have now installed the tool and configured the remote service, if you chose to install it. For more information, see Microsoft’s MS Deploy Installation guidance.

Categories
IIS Linux SSL Web Deployment Tool Windows

IIS Web Deployment Tool

The Web Deployment Tool simplifies the migration, management and deployment of IIS Web servers, Web applications and Web sites. Administrators can use command-line scripting with the Web Deployment Tool to synchronize IIS 6.0 and IIS 7.0 servers or to migrate an IIS 6.0 server to IIS 7.0. The Web Deployment Tool also enables administrators and delegated users to use IIS Manager to deploy ASP.NET and PHP applications to an IIS 7.0 server.

Migrate Web applications between IIS 6.0 and IIS 7.0 with ease

Simplify the planning of your IIS 6.0 to IIS 7.0 migrations by determining incompatibilities and previewing the proposed changes before starting the process. Learning about any potential issues in advance gives you the chance to take corrective measures and simplifies migration.

Synchronize your server farm efficiently

The Web Deployment Tool allows you to efficiently synchronize sites, applications or servers across your IIS 7.0 server farm by detecting differences between the source and destination content and transferring only those changes which need synchronization. The tool simplifies the synchronization process by automatically determining the configuration, content and certificates to be synchronized for a specific site. In addition to the default behavior, you still have the option to specify additional providers for the synchronization, including databases, COM objects, GAC assemblies and registry settings.

Package, archive and deploy Web applications more easily

The Web Deployment Tool enables you to package configuration and content of your installed Web applications, including databases, and use the packages for storage or redeployment. These packages can be deployed using IIS Manager without requiring administrative privileges. The tool integrates with Visual Studio 2010 to help developers streamline the deployment of Web applications to the Web server. The tool also integrates with the Web Platform Installer to allow you to simply and easily install community web applications. You can submit your own application to the Web Application Gallery – learn how.

Features

  • Seamless integration with IIS 7.0 Manager and Visual Studio 2010 interface for creating packages and deploying them onto a machine, both locally and remotely.
  • Seamless integration with the Web Platform Installer to install community web applications simply and easily.
  • Web application packaging:

    • Ability to package a Web application or an entire site, including the associated databases.
    • Ability to package ACLs, COM, GAC and registry settings.
    • Supports both live servers and zipped packages as a source or destination.

  • Web application deployment:

    • Administrative privileges are not required in order to deploy Web applications.
    • Ability to add powerful parameters to change text in files when they are deployed (such as prompting to replace a connection string when deploying from QA to staging environments).
    • Integration with the IIS 7.0 Web Management Service (WMSVC) for remote deployment by non-administrators.
    • Server administrators have granular control over the operations that can be performed and can delegate tasks to non-administrators.

  • Web server migration and synchronization:

    • Ability to synchronize or migrate the entire Web server, a Web site or application.
    • Synchronizes only the data that has changed.
    • Ability to detect missing dependencies during synchronization.
    • Automatically gathers content, IIS configuration, SSL certificates and ASP.NET configuration when you sync a Web site.

  • In addition to the IIS Manager and Visual Studio 10, tasks can be performed using the command-line, PowerShell cmdlets or public APIs.
Guide to installing the Web Deployment Tool.

Download x86 / 64.

Thanks to iis.net for this info.

Categories
CA certificate IIS Linux Microsoft SSL TLS Windows

Microsoft SSL Diagnostics

A common problem for administrators of IIS servers is configuring and troubleshooting SSL enabled websites. To assist in administrators efforts, Microsoft has designed a tool – SSL Diagnostics – to aid in quickly identifying configuration problems in the IIS metabase, certificates, or certificate stores.

This tool allows users to review configuration information in a easy to read view mode or to run the tool silently with only the creation of a log file. During use, administrators can simulate the SSL handshake to find errors. They can also quickly “hot swap” certificates for testing purposes.

These packages come in two forms: Express and Full. The express will only give the pertinent tools for administrators to use SSL Diagnostics while full install installs the same files with the appropriate documentation. Included in the full install is a SSL Frequently Asked Questions that can assist in the learning of SSL for administrators.

More details & download SSL Diagnostics for x86 or x64.

Categories
IIS Linux LogParser SQL Windows

Log Parser 2.2 – work with IIS log files and more

Log parser is a powerful, versatile tool that provides universal query access to text-based data such as log files, XML files and CSV files, as well as key data sources on the Windows® operating system such as the Event Log, the Registry, the file system, and Active Directory®.

Download LogParser 2.2 from Microsoft.

Get help with LogParser in the LogParser Forums.

More on LogParser

Categories
IIS Linux Microsoft Web PI Windows

Microsoft Web Platform Installer 2.0

The Microsoft Web Platform Installer 2.0 (Web PI) is a free tool that makes it simple to download, install and keep up-to-date with the latest components of the Microsoft Web Platform, including Internet Information Services (IIS), SQL Server Express, .NET Framework and Visual Web Developer. In addition, install popular open source ASP.NET and PHP web apps with the Web PI.

Web PI 2.0 Includes

  • Popular Web Apps
    Install free popular ASP.NET and PHP web apps such as DotNetNuke and WordPress.
  • .NET Framework
    Install the latest version of the .NET Framework. This includes everything you need to work with ASP.NET.
  • IIS and Extensions
    Install the latest version of IIS, including latest IIS Web extensions like IIS Media Services.
  • SQL Server
    Install the latest version of SQL Server 2008 Express. This includes both the database engine and tools.
  • Visual Web Developer
    Install the latest version of Visual Web Developer Express, Our full featured free web development tool.
  • Extra and Goodies
    In addition to everything above, the Web PI also includes the latest community version of PHP for Windows.

Download:
http://microsoft.com/web/channel/products/WebPlatformInstaller.aspx.