Saturday, July 18, 2015

SharePoint 2013 BI Farm Setup Guide Section XI: Create the Baseline Web Applications and Site Collections

This is section XI of the MBP SharePoint 2013 BI Farm Setup Guide. 

This section describes how to create the b
aseline Web Applications and Site Collections we planned, including Home and MySites.

Below are links to all the sections of this Guide.
XIV.  Configure Business Intelligence
XV.   Turn Windows Firewalls Back On for All Servers

As mentioned in Section I, MBP stands for "Martin's Best Practices."  I use MBP as the acronym for the enterprise, the domain and also the name of the farm. MBP does not correspond to any actual company or client. You may use this guide as a template by globally replacing "MBP" with the acronym or name of your company or client.


About This Section

In this section, we’ll create the Home Web Application, the Home Site Collection, the MySite Web Application, and the MySite host site collection.

This guide uses short, simple PowerShell scripts such as CreateHomeWebApp.ps1 to create these Web Applications and Site Collections in an automated way. This is our best practice when first building farms with a small number (2 - 4) of web applications and a small number (3 - 6) site collections.


A Word About Alternative Approaches

Sometimes we need to automatically create large farms with many web applications and possibly hundreds of site collections. In that case, a different best practice uses a different kind of PowerShell script: a PowerShell script that takes, as input, an XML file that defines a complete hierarchy of servers, web applications, site collections and sub-sites together with parameters defining the attributes of each

AutoSPInstaller is the best example of this kind of large-scale PowerShell script. One key difference between AutoSPInstaller and this MBP SharePoint 2013 BI Farm Setup Guide is that AutoSPInstaller is a single, monolithic PowerShell script that takes a single, big XML file as input and does everything in one go. The MBP SharePoint 2013 BI Farm Setup Guide, in contrast, has twenty or more small PowerShell scripts, each of which does a single, focused step of the configuration process. Rather than a big XML file as input, these smaller MBP setup scripts take their input values from Environment Variables. I have used AutoSPInstaller and in some cases it is the better approach. In other cases, however, I tend to prefer the more "one step at a time" approach of the MBP process because I can test after each step and ensure the step has completed properly before moving on. 


A. Create the Home Web Application


1. Open a Remote Desktop connection to the Central Administration server (MBP-CA). Login as the SharePoint Setup Account: MBP\sp_admin.

2. From the Windows Start page, right-click SharePoint 2013 Management Shell and select Run as Administrator

3. At the UAC prompt, click Yes.

4. From the SharePoint 2013 Management Shell, navigate to the folder (F:\Scripts) that contains the PowerShell Scripts.

5. Run the CreateHomeWebApp.ps1 PowerShell script to create the Home web application.



Note: CreateHomeWebApp.ps1 uses MBP_HOME_URL and other environment variables set by the SetEnvironmentVariables.ps1 script. If CreateHomeWebApp.ps1 displays error messages about not able to get environment variables, you must go back to Section X and run the SetEnvironmentVariables.ps1 script on this server before you can run the other MBP Farm Setup PowerShell Scripts. You only need to run the SetEnvironmentVariables.ps1 script once per server.

CreateHomeWebApp.ps1 creates the Home web application as a claims-based web application. This is required in SharePoint 2013.


B. Create the MySite Web Application


1. Repeat steps 1 – 4 of the previous section (A) if necessary to get into the SharePoint 2013 Management Shell running as Administrator.

2. Run the CreateMySiteWebApp.ps1 PowerShell script to create the My Site web application.





C. Create the Home (root) Site Collection


1. Repeat steps 1 – 4 of section (A) if necessary to get into the SharePoint 2013 Management Shell running as Administrator.

2. Run the CreateHomeSiteCollection.ps1 PowerShell script.



When the CreateHomeCollection PowerShell script has completed, you should be able to open your home web site http://home.mbp.com in this case.  Be patient: it will take some time for SharePoint to warm up everything it needs to display the site in your browser. Also, only the Setup Account (sp_admin in this case) has permission so far. Use sp_admin to open when prompted and you should be rewarded with the SharePoint home page:


3. Run the CreateStandardGroups.ps1 PowerShell script passing, as input, the URL of the Home site as the first parameter, as shown below:

.\CreateStandardGroups.ps1  http://home.mbp.com




Now that your farm has a home web site, you normally want to share it with users by adding them to the “Visitors” or “Members” groups. 

4. Open your home web site (http://home.mbp.com in this case).

5. Click the “Share” icon in the upper right corner  (near “Follow”)

6. From the Share ‘Home’ dialog, in the Invite people to ‘View Only’ field, enter Everyone





7. Click Share 


D. Create the MySite Host Site Collection

1. Repeat steps 1 – 4 of section (A) if necessary to get into the SharePoint 2013 Management Shell running as Administrator.

2. Run the CreateMySiteCollection.ps1 PowerShell script.



3. Exit the SharePoint 2013 Management Shell


E. (Optional) Add SharePoint Web App Host Headers to the Hosts files on all SharePoint Web Front End Servers


For farms with only 1 Web Front End (WFE) server, you may skip this step.

For farms with 2 or more Web Front Ends, add one line to the hosts file for each Web Application hosted on the WFE servers.

Adding these entries to your hosts file is a best practice because, if you are logged in locally to one of the WFE servers, it forces your browser to always open the Web Application using the your current WFE server -- rather than having the request sometimes go to the other WFE server. This can simplify troubleshooting later by making sure when you are logged in to server A, you are seeing the web application served up by server A. 

1. Open a Remote Desktop connection to the first Web Front-End server (MBP-WFE1). Login as the SharePoint Setup Account: sp_admin

2. Open a command prompt using Run as administrator 

3. Run ipconfig to validate and take careful note of the IPV4 address of the current server

4. CD to the folder that contains the hosts file, e.g. C:\Windows\System32\drivers\etc

5. Edit the hosts file using notepad or a text editor of your choice. For each Web Application planned in your farm, add one line to the hosts file that specifies the IP address of the current server. In the MBP farm, there are three Web Applications hosted on the WFE servers:

  • home.mbp.com
  • mysite.mbp.com
  • bi.mbp.com


Therefore, on MBP-WFE1, add the following three lines to the hosts file:

    10.0.0.7 home.mbp.com
    10.0.0.7 mysite.mbp.com 
    10.0.0.7 bi.mbp.com

6. Save your changes to the hosts file, exit the text editor and exit the command window.

7. Repeat these steps on each WFE in your farm. For example, on MBP-WFE2, specify the IPV4 Address of MPP-WFE2 (10.0.0.8).



F. Create State Service

The CreateState.PS1 script does two things: it provisions the SharePoint State Service application and also provisions the Usage and Health Data Collection service application.

1. Open a Remote Desktop connection to the Central Administration server (MBP-CA). Login as the SharePoint Setup Account: sp_admin.

2. From the Windows Start page, right-click SharePoint 2013 Management Shell and select Run as Administrator

3. At the UAC prompt, click Yes.

4. From the SharePoint 2013 Management Shell, navigate to the folder (F:\Scripts) that contains the PowerShell Scripts.

5. Run the CreateState.ps1 PowerShell script to provision the state service.
  
            .\CreateState.ps1





G. Create the Managed Metadata Service 

NOTE: Run this script on the Application Server that should run the Managed Metadata service. In the MBP farm, we run this script on the Central Administration server MBP-CA.

This script assumes the SetEnvironmentVariables.ps1 script previously ran and set the MBP_MANAGED_META_DB environment variable to the name to use for the Managed Metadata service database in your environment. 

1. Connect to the Central Administration server (MBP-CA) logged in as the SharePoint Setup Account: sp_admin.

2. Run SharePoint 2013 Management Shell with Run as Administrator

3. Navigate to the folder (F:\Scripts) that contains the PowerShell Scripts.

4. Run the CreateManagedMetadataService.ps1 PowerShell script to provision Managed Metadata service.


NOTE: The CreateManagedMetadataService script creates an App Pool to run the Managed Metadata Service, creates the Managed Metadata Service application, creates the Managed Metadata Service Proxy, and starts the service.


Next Steps


This concludes section XI: Create the Baseline Web Applications and Site Collections. This section described how to create the baseline Web Applications and Site Collections we planned, including Home and MySites. 

In the next section, Section XII of the MBP SharePoint 2013 BI Farm Setup Guide, we configure Enterprise Search and User Profile Synchronization. 

1 comment:

  1. Martin,

    This is an awesome guide here! I am recently setting up a dev farm for our company in Azure as well and was following best practices on Todd Klindt's site as well but learning from my experiences as far as Azure is concerned. Your guide explained many things that I was missing on my end. One question -- if I create my farm in Azure using the preview portal and the resource group model, how can I have my WFE set up so that I could access web applications created on it publicly? I see that the one-click, 3-server SharePoint farm offered in Azure adds cloud services to the VMs that makes it publicly available but not sure how I could do that using this whole procedure?

    ReplyDelete