Docstoc

Hosting Services Web Service

Document Sample
Hosting Services Web Service Powered By Docstoc
					                                           Hosting Services Web Service
                                                                       Installation and Configuration

                                                                                    Microsoft
                                                                                    Sunday, 7 March 2010
                                                                                    Version 1.0 Release
                                                                                    Prepared by
                                                                                    Mark Stevenson (MCS)
                                                                                    Sr. Consultant
                                                                                    markstev@microsoft.com




                                                                                                             Page 1
Hosting Services Web Service, Installation and Configuration, Version 1.0 Release
Prepared by Mark Stevenson (MCS)
"0299ece3-bfd7-42c2-97b5-18cb66d5f19b.doc" last modified on 7 Mar. 10, Rev 21
Table of Contents
Hosting Services Web Service .................................................................................................................. 1

Installation and Configuration ................................................................................................................... 1

1     Introduction .......................................................................................................................................... 3

2     Installation ............................................................................................................................................ 4
    Dependencies ........................................................................................................................................... 4

3     Installation of Host web services ....................................................................................................... 6

4     Configure the web service ................................................................................................................ 10

5     Installation of the Sample Client ...................................................................................................... 11

6     Configure the Sample Client ............................................................................................................. 16

7     Security ............................................................................................................................................... 17
    Add administrative users to the administrative security role in AD ......................................................... 17
    Encrypt Sensitive information in the host web.config ............................................................................. 17
    Other security considerations ................................................................................................................. 17




                                                                                                                                                          Page 2
                                   Hosting Services Web Service, Installation and Configuration, Version 1.0 Release
                                   Prepared by Mark Stevenson (MCS)
                                   "0299ece3-bfd7-42c2-97b5-18cb66d5f19b.doc" last modified on 7 Mar. 10, Rev 21
1         INTRODUCTION
    The Windows Web Service based host for IIS7 Hosting services includes the same functionality as the
    Windows Service based version of the host. The only difference is that the services are hosted in a
    Windows Web Service instead of an Windows Service based application.
    Note that this is a sample application and should not be used in a production environment.




                                                                                                             Page 3
                         Hosting Services Web Service, Installation and Configuration, Version 1.0 Release
                         Prepared by Mark Stevenson (MCS)
                         "0299ece3-bfd7-42c2-97b5-18cb66d5f19b.doc" last modified on 7 Mar. 10, Rev 21
2         INSTALLATION

Dependencies
    Prior to installation, the application server role must be setup in the server role management. The
    sample client installer requires the .NET Framework 3.5 as well as the Windows 3.1 installer.
    The hosting services sample requires .NET Framework 3.0 as well as the Windows 3.1 installer. The
    hosting services sample will operate using the .NET 3.5 framework and for simplicity it is easiest to
    standardize on 3.5 for both installations.


    Under server features, make sure the WCF Activation feature is installed.




    Create application pool for host
    As preparation for install, create an application pool with administrative privileges. In the below
    example, an application pool named HostingService has been created that runs under the
    administrator account.




                                                                                                             Page 4
                         Hosting Services Web Service, Installation and Configuration, Version 1.0 Release
                         Prepared by Mark Stevenson (MCS)
                         "0299ece3-bfd7-42c2-97b5-18cb66d5f19b.doc" last modified on 7 Mar. 10, Rev 21
You will need to create two additional site in IIS for hosting these samples. Use HostHeaders to
distinguish the sites. The two sites are HostingService and SampleClient as in the below screen
capture.




After creating the sites, create DNS or hosts entries for name resolution of the sites.




                                                                                                         Page 5
                     Hosting Services Web Service, Installation and Configuration, Version 1.0 Release
                     Prepared by Mark Stevenson (MCS)
                     "0299ece3-bfd7-42c2-97b5-18cb66d5f19b.doc" last modified on 7 Mar. 10, Rev 21
3            INSTALLATION OF HOST WEB SERVICES
    To install the web based host, double click on the HostServiceSetup.msi file to start the installation
    process.




    Figure 1 - Start Setup



    Choose Next to move to the next step.




                                                                                                                 Page 6
                             Hosting Services Web Service, Installation and Configuration, Version 1.0 Release
                             Prepared by Mark Stevenson (MCS)
                             "0299ece3-bfd7-42c2-97b5-18cb66d5f19b.doc" last modified on 7 Mar. 10, Rev 21
Figure 2 - License Agreement

Read and agree to the License agreement then select next.




                                                                                                                   Page 7
                               Hosting Services Web Service, Installation and Configuration, Version 1.0 Release
                               Prepared by Mark Stevenson (MCS)
                               "0299ece3-bfd7-42c2-97b5-18cb66d5f19b.doc" last modified on 7 Mar. 10, Rev 21
For the Installation Address, select the HostingService site “/” for the Virtual Directory and
HostingService for the application pool as in the following example.




Figure 3 - Install Address




Confirm the installation and select next. When the install is complete choose close to exit the install.(
Figure 4 – Complete)




                                                                                                                 Page 8
                             Hosting Services Web Service, Installation and Configuration, Version 1.0 Release
                             Prepared by Mark Stevenson (MCS)
                             "0299ece3-bfd7-42c2-97b5-18cb66d5f19b.doc" last modified on 7 Mar. 10, Rev 21
Figure 4 – Complete



After installation is complete go into authentication settings on the host web service and make sure that
the following is set:
      Windows Authentication is enabled
      Anonymous Authentication is enabled
      All other authentication types are disabled
      ASP.NET Impersonation is disabled




                                                                                                          Page 9
                      Hosting Services Web Service, Installation and Configuration, Version 1.0 Release
                      Prepared by Mark Stevenson (MCS)
                      "0299ece3-bfd7-42c2-97b5-18cb66d5f19b.doc" last modified on 7 Mar. 10, Rev 21
4         CONFIGURE THE WEB SERVICE

    The service must be configured by modifying the web configuration file in the installation directory. The
    file is named web.config. The ADConnectionString mush be changed to be the correct string to connec
    to AD for the environment. In the below example IIS7Live should be replaced by the machine name
    and the domain must be supplied in the DC= sections.
    <connectionStrings>
         <remove name="ADConnectionString" />
                 <add name="ADConnectionString"
                 connectionString="LDAP://IIS7Live/DC=ROOT,DC=IISHosting,DC=COM" />
    </connectionStrings>
    Under the activeDirectorySetting the server name, username and password must be stored in the
    config file.
    <webHostingService>
         <iis7ConfigSetting remote="false" serverName="" shared="false" applicationHostConfigPath=""/>
         <webSiteDirectorySetting defaultWebDirectory="wwwroot" defaultLogDirectory="logs"
         defaultLogFileDirectory="logfiles" defaultFailedRequestLoggingDirectory="failedReqLogfiles"/>
         <activeDirectorySetting serverName="iis7live" userName="root.iishosting.com\administrator"
         password="pass@word1"/>
    </webHostingService>


    Save the changes and setup should be complete.




                                                                                                              Page 10
                          Hosting Services Web Service, Installation and Configuration, Version 1.0 Release
                          Prepared by Mark Stevenson (MCS)
                          "0299ece3-bfd7-42c2-97b5-18cb66d5f19b.doc" last modified on 7 Mar. 10, Rev 21
5            INSTALLATION OF THE SAMPLE CLIENT

    To install the web based host, double click on the SampleClientSetup.msi file to start the installation
    process.




    Figure 5 - Start Setup



    Choose Next to move to the next step.




                                                                                                                 Page 11
                             Hosting Services Web Service, Installation and Configuration, Version 1.0 Release
                             Prepared by Mark Stevenson (MCS)
                             "0299ece3-bfd7-42c2-97b5-18cb66d5f19b.doc" last modified on 7 Mar. 10, Rev 21
Figure 6 - License Agreement

Read and agree to the License agreement then select next.




                                                                                                                   Page 12
                               Hosting Services Web Service, Installation and Configuration, Version 1.0 Release
                               Prepared by Mark Stevenson (MCS)
                               "0299ece3-bfd7-42c2-97b5-18cb66d5f19b.doc" last modified on 7 Mar. 10, Rev 21
For the Installation Address, select the SampleClient site “/” for the Virtual Directory and
DefaultAppPool for the application pool as in the following example.




Figure 7 - Install Address




Confirm the installation and select next. When the install is complete choose close to exit the install.(
Figure 4 – Complete)




                                                                                                                 Page 13
                             Hosting Services Web Service, Installation and Configuration, Version 1.0 Release
                             Prepared by Mark Stevenson (MCS)
                             "0299ece3-bfd7-42c2-97b5-18cb66d5f19b.doc" last modified on 7 Mar. 10, Rev 21
Figure 8 - Complete



At the completion of install, you will be presented with a dialog to select the SQL server type and set
the service principal names settings for the client configuration. Select the SQL version and set the
correct SPN – leave the “host/” as in the below dialog and press OK. If you choose cancel, you will
need to manually configure the client as in step 6.




                                                                                                          Page 14
                      Hosting Services Web Service, Installation and Configuration, Version 1.0 Release
                      Prepared by Mark Stevenson (MCS)
                      "0299ece3-bfd7-42c2-97b5-18cb66d5f19b.doc" last modified on 7 Mar. 10, Rev 21
After installation is complete go into authentication settings on the client and make sure that the
following is set:
     Windows Authentication is enabled
     ASP.NET Impersonation is enabled
     All other authentication types are disabled




                                                                                                         Page 15
                     Hosting Services Web Service, Installation and Configuration, Version 1.0 Release
                     Prepared by Mark Stevenson (MCS)
                     "0299ece3-bfd7-42c2-97b5-18cb66d5f19b.doc" last modified on 7 Mar. 10, Rev 21
6         CONFIGURE THE SAMPLE CLIENT
    The sample client must be configured by modifying the web configuration file in the installation
    directory.


    The sample client web.config contains a series of endpoint mappings that must be set to use the
    hosting services previously deployed. If the Hosting services were deployed to anywhere other than
    the previous example, the URL to each those services in the endpoint address must be updated to
    reflect the services location.
    In addition, the servicePrincipalName must be set to reflect the machine that is hosting the services. In
    this case the format is server.domain. It is relatively easy to perform a global search and replace in the
    web.config for the servicePrincipalName values.


    <endpoint address="http://HostingService/WebProvisioningService.svc"
    binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IWebProvisioningService"
    contract="Microsoft.Hosting.Web.Client.WebProvisioning.IWebProvisioningService"
    name="WSHttpBinding_IWebProvisioningService">
         <identity>
          <servicePrincipalName value="host/iisserver.iishosting.com" />
         </identity>
       </endpoint>


    If you have chosen to use the Windows Service sample as a host, there is a commented out section in
    the web.config that is set to use the service. The endpoint address for the web based services will
    need to be removed or commented out and the windows services section used instead. See the
    Windows Service install document for more information on the Windows Service version of the host.
        <!--endpoint address="http://localhost:8000/ContentProvisioning" binding="wsHttpBinding"
    bindingConfiguration="WSHttpBinding_IContentStorageProvisioningService"
    contract="Microsoft.Hosting.ContentStorage.Client.ContentProvisioning.IContentStorageProvisioningS
    ervice" name="WSHttpBinding_IContentStorageProvisioningService">
    <identity>
         <servicePrincipalName value="host/iisserver.iishosting.com" />
    </identity>
    </endpoint> 




                                                                                                             Page 16
                         Hosting Services Web Service, Installation and Configuration, Version 1.0 Release
                         Prepared by Mark Stevenson (MCS)
                         "0299ece3-bfd7-42c2-97b5-18cb66d5f19b.doc" last modified on 7 Mar. 10, Rev 21
7         SECURITY

Add administrative users to the administrative security role in AD
    The web services enforce security using role based security. Because the services perform
    administrative functions, they require that the caller be a member of the administrators group where the
    services are running.

Encrypt Sensitive information in the host web.config
    After installing and configuring the active directory connection information, the section should be
    protected using the aspnet_regiis –pef command. This will encrypt the section so that the user
    information is not stored in clear text.
    Encrypt Example:
    C:\inetpub\Hostingservice>aspnet_regiis -pef "webHostingService" C:\inetpub\Hostingservice
    If you need to decrypt this section to make changes later, use the
    Decrypt Example:
    C:\inetpub\Hostingservice>aspnet_regiis -pdf "webHostingService" C:\inetpub\Hostingservice

Other security considerations
    While communication between the client application and the host web services are secured by WCF
    message security, the client application should be run over SSL to protect the information traveling
    between the browser and the client web server.




                                                                                                             Page 17
                         Hosting Services Web Service, Installation and Configuration, Version 1.0 Release
                         Prepared by Mark Stevenson (MCS)
                         "0299ece3-bfd7-42c2-97b5-18cb66d5f19b.doc" last modified on 7 Mar. 10, Rev 21

				
DOCUMENT INFO