[转]Installing SharePoint 2013 on Windows Server 2012 R2

转自:http://www.avivroth.com/2013/07/09/installing-sharepoint-2013-on-windows-server-2012-r2-preview/

Installing SharePoint 2013 on Windows Server 2012 R2 Preview

By Aviv Roth On July 9, 2013  · 46 Comments · In SharePoint, Windows 

EDIT: This has changed a little for Windows Server 2012 R2 RTM, so make sure that you also read my follow-up post before spending time on the below.

I was all excited when I found out that you could try out Windows Server 2012 R2 Preview for a free 30 day trial on Windows Azure.  So I proceeded to instantiate a virtual machine and also to attempt to install SharePoint 2013 Foundation.  It didn’t go so well.

The main problem is that you can’t install the SharePoint 2013 Prerequisites using the standard install wizard, since it doesn’t recognize Windows Server 2012 R2 Preview as a valid supported OS.  It displays an error: “There was an error during installation.  This tool does not support the current operating system”:

[转]Installing SharePoint 2013 on Windows Server 2012 R2

 

I did finally get it to work, but it was not trivial at all.  First of all, you have to install the prerequisites semi-manually.  Then, you need to make sure that permissions are set properly on certain files and directories so that the SharePoint Configuration Wizard can successfully complete.  But dear friends, I am here to walk you through the process step by step.

I. INSTALL PREREQUISITES MANUALLY

A. INSTALL WINDOWS ROLES/FEATURES

First, make sure that you have installed the following roles and features in Windows 2012 Server R2 Preview:

ROLES:

  • Application Server
  • Web Server (IIS)
  • EDIT: IIS 6 Management Console (h/t Darma)

FEATURES:

  • ASP.NET 4.5
  • Windows Identity Foundation 3.5

If you can do this on your own, go ahead and do it, and then skip to the next section.  Otherwise, here’s the step by step:

1) If it’s not already up (it starts by default in 2012), bring up the server manager, Dashboard view.  It should look like this:

[转]Installing SharePoint 2013 on Windows Server 2012 R2

2) Click on “Add roles and features”.

3) On the “Before you begin” page, click “Next”.

4) Select “Role based or feature based installation” and click “Next”.

5) If it isn’t already selected, select “Select a server from the server pool”, and the server that you are currently working on.  Then click “Next”.

6) On the “Select server roles” page, check “Application Server”,  ”Web Server (IIS)”, and (EDIT:) “IIS 6 Management Console” (under Web Server (IIS)->Management Tools->IIS 6 Management Compatibility->IIS 6 Management Console.  h/t Darma).  NOTE: When you check “Web Server (IIS)” or “IIS 6 Management Console”, another dialog will pop up, asking “Add features that are required for <feature name>?”  Click on the “Add Features” button here.  This will return you to the “Select Server Roles” page.  After adding all 3 roles, click “Next”.

7) On the “Select features” page, expand “.NET Framework 4.5 Features” group by clicking on it.  In here, check “ASP.NET 4.5″.

8) On the same page, check “Windows Identity Foundation 3.5″.  Click “Next”.

9) On the “Application Server” page, click “Next”.

10) On the “Select role services” page, check “Web Server (IIS) Support” and click “Next”.

11) When the “Add features that are required for Web Server (IIS) Support?” dialog pops up, click on “Add Features”.

12) Click “Next” again to go to the next page.

13) From the “Web Server Role” page, click “Next”.

14) From “Select role services”, click “Next”.

15) On the “Confirm installation selections” page, I suggest that you check “Restart the destination server automatically if required”.  (You’re going to need to reboot eventually anyway.)

16) Click “Install”.

17) Wait for feature installation to complete.  When it does, you can click “close”.  If the server doesn’t restart automatically, reboot it.

B. DOWNLOAD AND INSTALL SHAREPOINT PREREQUISITES 

OK, here’s the fun part.  You can easily download and install the prerequisites that SharePoint needs, but you have to do a little more than just download and run the install wizards.

The good news is that Craig Lussier has written three scripts to both download and install the SharePoint 2013 prerequisites.  The bad news is that only the download script works on Windows Server 2012 R2 (they probably work fine on vanilla 2012), because the install scripts use Prerequisiteinstaller.exe, which throws the same “This tool does not support the current operating system” error that we saw above.  So we’ll only take advantage of the download script, and do the rest manually.

So the steps:

1) Download the scripts from http://gallery.technet.microsoft.com/DownloadInstall-SharePoint-e6df9eb8.

2) Unzip to a directory of your choosing.

3) If you want to save the files to a new directory of your choosing, create that directory now.

4) Run PowerShell as an administrator.

5) In PowerShell, type “Set-ExecutionPolicy Unrestricted” and hit enter.  This is required because the scripts are unsigned and won’t run otherwise.

6) cd to the directory where you unzipped the scripts.  They should be .ps1 files.

7) Type “ .\Download-SP2013PreReqFiles.ps1” and press enter.

8) At the Security Warning, type “r” for “Run once”.

9) When prompted to “Please enter the directory path to where you wish to save the Sharepoint 2013 Prerequisite Files:”, type the directory of your choosing (which you may have created in step #3), and press enter.

10) The files will take some time to download, but there will be a text indicator that shows the download progress.

11) When you are done, the install files will be in the directory you chose.  Leave the PowerShell window open, since you’ll need it in a few steps.

12) Click on each file to run the installers, EXCEPT:

  • Windows6.1-KB974405-x64.msu
  • WindowsServerAppFabricSetup_x64.exe
  • AppFabric1.1-RTM-KB2671763-x64-ENU.exe

(In fact, you can even delete Windows6.1-KB974405-x64.msu.  I couldn’t get it to run successfully on Windows 2012 R2 no matter what Google told me.  Besides, it’s for installing WIF, which you installed above in step A.8, so we won’t be using it at all.)

13) Go back to PowerShell.  cd to the same directory as the install files.

14) To install AppFabric, type the following at the command line:

.\WindowsServerAppFabricSetup_x64.exe /i CacheClient","CachingService","CacheAdmin /gac

NOTE that there are quotes surrounding the commas.  These are important in PowerShell.  (h/t to Doug Hemminger for this tip).

15) Wait a minute or two for AppFabric to install.  Unfortunately, except for the cursor hourglass, there isn’t much of a cue that it’s done.

16) Now you can click on AppFabric1.1-RTM-KB2671763-x64-ENU.exe to install the AppFabric patch.

17) Reboot the server.

All the prerequisites should now be installed, and you should be able to install SharePoint 2013.

II. INSTALL AND CONFIGURE SHAREPOINT 2013 

A. INSTALL SHAREPOINT 2013

If you already know how, just install SharePoint the standard way that you know how (not the prerequisites, of course, which you’ve just installed), and skip to the next section.

If you’re new to SharePoint, here are the directions to install SharePoint 2013 Foundation (I have no idea how SharePoint Server differs):

1) Click on the SharePoint installer (sharepoint.exe).

2) On the “SharePoint Foundation 2013″ screen, click on “Install SharePoint Foundation”.

3) Follow the prompts through the wizard.  It should be relatively intuitive. (Note: For this example, I installed SharePoint as a stand-alone server type, since I was on Windows Azure and didn’t want to install a complete SQL Server database.  You can configure the Server Type however you like, though.  If you don’t know what to do, I’d recommend stand-alone for now.)

4) Do run the SharePoint Products Configuration wizard at the end of the installation.  Just note that it will fail during configuration task 8 of 10 (Creating sampledata), with the error: “The SDDL string contains an invalid sid or a sid that cannot be translated.”:

[转]Installing SharePoint 2013 on Windows Server 2012 R2

This is fine for now, as we will run the configuration tweaks below to fix that.  But we need the wizard to set up the initial databases and users for us to tweak first, so make sure that you do run it to failure, and click “Close” to exit the Wizard.

B. CONFIGURATION TWEAKS

If you go to Administrative Tools->Services, you’ll see that the AppFabric Caching Service is not running.  This is because it does not have proper permissions to a number of resources  We’ll need to set these and then start the service (as well as configure it to start automatically).

1. Set DATABASE permissions for NETWORK SERVICE

(I don’t remember the source for the below, but something similar was posted here.)

1) You will need SQL Server Management Studio so that you can access the database directly and set the permissions properly.  If you haven’t already installed SQL Server itself, then download and install SQL Server Management Studio Express for SQL Server Express 2008 R2 from http://www.microsoft.com/en-us/download/details.aspx?id=22985 (note that the version of SQL Express that SharePoint 2013 installs is 2008 R2, not 2012.  I know.).

NOTE: When installing SQL Server Management Studio Express, you will likely get warnings that say “This program has compatibility issues”.  Just click on “Run the program without getting help” and continue the install.

2) Run SQL Server Management Studio, and connect to the SharePoint database instance.  If you installed a stand-alone configuration, this server name you need to connect to is localhost\SHAREPOINT:

[转]Installing SharePoint 2013 on Windows Server 2012 R2

 

3) Expand the database, and expand the “Security” folder.  You should see the “NT AUTHORITY\NETWORK SERVICE” user

[转]Installing SharePoint 2013 on Windows Server 2012 R2

4) Right click on this NETWORK SERVICE user and select “Properties.”

5) Select “Server Roles” on the left, and check the “sysadmin” role on the right:

[转]Installing SharePoint 2013 on Windows Server 2012 R2

5) Click “OK”.  You can exit SQL Server Management Studio now.

2. Set config file permissions for the AppFabric Caching Service

(h/t: David Pokluda)

1) In the Windows File Explorer, navigate to C:\Program Files\AppFabric 1.1 for Windows Server\.

2) Right click on DistributedCacheService.exe.config and select “Properties”.

3) On the “Sharing” tab, click “Edit…”

4) Click “Add…”

5) In the white textbox on the bottom, type in “NETWORK SERVICE” and then “Check Names…”.  It should resolve to an underlined “NETWORK SERVICE”.

6) Click “OK”.

7) With “NETWORK SERVICE” selected, check the “Full Control” checkbox in the “Allow” column.

8) Click “OK”.

9) Click “OK” to exit the dialog box.

3. Set permissions on Analytics_<GUID> directory.

(h/t: Kancharia Srikanth)

1) If you are running SharePoint Foundation, navigate in the Windows File Explorer to C:\Program Files\Windows SharePoint Services\15.0\Data.  If you are running SharePoint Server, navigate to C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server.

2) You’ll see a folder in this directory called “Analytics_<some GUID>”, for example, “Analytics_939ab742-745f-456c-8623-fddca9b02334″ (your GUID will be different, of course).

3) Right click on the folder and select “Properties”.

4) Click on the “Sharing” tab, and then click on “Advanced Sharing…”.

5) Check the “Share this folder” checkbox.  Leave the default share name.

6) Click on the “Permissions” button near the bottom.

7) Click the “Add..” button.

8) In the white textbox on the bottom, type   “NETWORK SERVICE; WSS_ADMIN_WPG”.  Then click the “Check Names” button to make sure that the users resolve.

9) Click OK.

10) Select each user that you just added (NETWORK SERVICE and WSS_ADMIN_WPG), and check the “Full Control” checkbox in the “Allow” column.

11) Click “OK” to save the permissions.

12) Click “OK” to save the share settings.

13) Click “Close” to exit the dialog box.

4. Re-run the SharePoint Product Configuration Wizard.

1) From the Windows “Start” screen, type “SharePoint 2013 Products Wizard”

2) Click on the result that comes up.  The wizard will start running.

3) Click “Next” to run the wizard.

4) When the warning “The following services may have to be started or reset during the configuration:” pops up, just click on the “Yes” button.

5) You’ll notice that the wizard begins at task 4, but will successfully pass through task 8 to the last task (task 10), and complete successfully.

C. DEFAULT WEB APPLICATION PROVISIONING

At this point, SharePoint is successfully installed!  BUT: the permissions will be all messed up on the default web application, to the point that it will be unusable (or at least, that’s what I found).  You will have to delete and re-create the default SharePoint web application for it to be accessible.  Steps:

1. Delete and re-create the default web application.

1) From the Start screen, type “SharePoint 2013 Central Administration.”.  Click on the result that comes up.

2) IE will come up with Central Administration’s home page.

3) Under “Application Management”, click on “Manage web applications.”

4) You will see two web applications: the default (which is probably called “SharePoint – 80″) and “SharePoint Central Administration v4″.  Select the default SharePoint web application.  CAUTION: Do NOT select the Central Administration web application!

5) On the ribbon, click on the “Delete” button.

6) When the “Delete Web Application” dialog comes up, select ”Yes” for *both* “Delete Content Databases” and “Delete IIS Web Sites”.

7) Click the “Delete” button.

8) When the “Are you sure you want to delete this Web application…?” warning comes up, click “OK”.

9) You’ll have to wait a moment for the web application to be fully deleted, and for the Central Admin page to refresh, now showing only the Central Admin web application.

NOTE:  Clicking the “Delete” button does *not* refresh the page for me.  I don’t know why, and I can only assume it’s a SharePoint bug.  If it looks like nothing is happening, just close the warning dialog by clicking on the X on the upper right, and hit Ctrl+r to refresh the Web Applications page in Central Administration.  At *that* point, you should see that the default web application is gone, but Central Administration is still there.

10) Create a new web application by clicking the “New” button on the ribbon.

11) If you don’t know what to do at this point, just keep the defaults.  One thing you *will* have to do is go to “Select a security account for this application pool” and select “predefined”, which will probably display “Network Service”.  If you are an experienced SharePoint user, and you know what kind of web application settings you want, set them as you please.

12) Click OK.  You’ll see the “This shouldn’t take long” message, even though, of course, it will take quite some time for the web application to be created.

NOTE: Here, once again, you may have to X out of the dialog and refresh the Central Admin page to see the changes.

2. Create a default site collection in the new web application.

1) Under “Application Management” (on the left), find and click on “Create Site collections” (on the right).

2) Fill in as desired.  I would advise that one of the site collection administrators be the admin account that you used to install SharePoint.

3) Click “OK” to be returned to the Central Admin page, or click on the URL of the site to be redirected there (the site may take a while to come up on its first call).

 

Ta-Da!  That wasn’t too long, was it?  But now you have the latest and greatest SharePoint 2013 to play with on Windows Server 2012 R2.

Hope that this helps.  Please feel free to comment with questions or corrections.

[转]Installing SharePoint 2013 on Windows Server 2012 R2

上一篇:java api 视频面试准备


下一篇:Google首席软件工程师Joshua Bloch谈如何设计一款优秀的API【附PPT】