全部產品
Search
文件中心

Object Storage Service:通過OSS和ROS建立Sharepoint 2013

更新時間:Feb 28, 2024

Resource Orchestration Service支援在模板中定義所需的阿里雲資源(例如ECS執行個體、RDS資料庫執行個體)、資源間的依賴關係等。ROS的編排引擎將根據模板自動完成所有資源的建立和配置,實現自動化部署及營運。本文介紹如何通過OSS以及ROS服務快速建立Sharepoint 2013。

說明

本文樣本由阿里雲使用者肖伊提供,僅供參考。

前提條件

步驟一:在Bucket中上傳sharepoint.exe檔案

  1. 登入OSS管理主控台

  2. 單擊Bucket 列表,然後單擊目標Bucket名稱。

  3. 在左側導覽列,選擇檔案管理 > 檔案清單

  4. 上傳已下載的sharepoint.exe檔案。

    上傳時,將檔案ACL設定為公用讀取,其他參數保留預設配置,關於上傳檔案的具體步驟,請參見上傳檔案

  5. 擷取檔案URL。

    檔案上傳完成後,單擊sharepoint.exe檔案右側的詳情,然後單擊複製檔案URLfileurl

步驟二:通過ROS建立資源棧

  1. 選擇模板。

    1. 登入Resource Orchestration Service控制台

    2. 在左側導覽列,單擊資源棧

    3. 在頁面左上方的地區下拉式清單,選擇華東1(杭州)

    4. 資源棧列表頁面,單擊建立資源棧,然後在下拉式清單中選擇使用ROS

    5. 選擇模板頁面,指定模板為選擇已有模板、模板錄入方式選擇輸入模板、在ROS模板內容的JSON頁簽輸入以下內容,然後單擊下一步

      {
        "ROSTemplateFormatVersion": "2015-09-01",
        "Description": "One simple ECS instance with SharePoint Foundation2013, default image is win2008r2_sp1_x64_ent_zh-cn_40G_alibase_20200116.vhd,The user needs to specify the instance type ",
        "Parameters": {
          "VpcCidrBlock": {
            "Type": "String",
            "Description": {
              "en": "The IP address range of the VPC in the CIDR Block form; <br>you can use the following IP address ranges: <br><font color='green'>[10.0.0.0/8]</font><br><font color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>",
              "zh-cn": "專用網路IP位址區段範圍,<br>您可以使用以下的IP位址區段:<br><font color='green'>[10.0.0.0/8]</font><br><font color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>"
            },
            "AllowedValues": [
              "192.168.0.0/16",
              "172.16.0.0/12",
              "10.0.0.0/8"
            ],
            "Label": {
              "en": "VPC CIDR Block",
              "zh-cn": "專用網路網段"
            },
            "Default": "192.168.0.0/16"
          },
          "VSwitchCidrBlock": {
            "Type": "String",
            "Description": {
              "zh-cn": "建立的虛擬交換器的子網,必須是所屬專用網路的子網段,並且沒有被其他交換器佔用。",
              "en": "Subnet of the created virtual switch,must be a sub-network segment of the proprietary network and is not occupied by other VSwitches."
            },
            "Label": {
              "zh-cn": "交換器網段",
              "en": "VSwitch CIDR Block"
            },
            "Default": "192.168.0.0/16"
          },
          "ZoneId": {
            "Type": "String",
            "AssociationProperty": "ALIYUN::ECS::Instance:ZoneId",
            "Description": {
              "en": "Availability zone ID,<br><b>note: <font color='blue'>Before selecting, please confirm that the Availability Zone supports the specification of creating ECS resources</font></b>",
              "zh-cn": "可用性區域ID,<br><b>註: <font color='blue'>選擇可用性區域前請確認該可用性區域是否支援建立ECS資源的規格</font></b>"
            },
            "Label": {
              "zh-cn": "交換器可用性區域",
              "en": "VSwitch Available Zone"
            }
          },
          "SharePointDownloadPath": {
            "Label": {
              "zh-cn": "SharePoint鏡像下載路徑",
              "en": "SharePoint Image Download Path"
            },
            "Type": "String",
            "Description": {
              "zh-cn": "SharePoint Foundation2013鏡像下載路徑,詳見: <a href='https://docs.microsoft.com/zh-cn/OfficeUpdates/sharepoint-updates' target='_blank'><b><font color='blue'>SharePoint Foundation2013鏡像下載路徑</b></font></a>",
              "en": "SharePoint Foundation2013 image download path, see detail: <a href='https://docs.microsoft.com/en-us/OfficeUpdates/sharepoint-updates' target='_blank'><b><font color='blue'>SharePoint Foundation2013 image download path</b></font></a>"
            }
          },
          "ImageId": {
            "Default": "win2008r2_sp1_x64_ent_zh-cn_40G_alibase_20200116.vhd",
            "Label": {
              "zh-cn": "鏡像",
              "en": "Image ID"
            },
            "Type": "String",
            "Description": {
              "zh-cn": "鏡像ID,關於SharePoint Foundation2013系統要求,詳見: <a href='https://docs.microsoft.com/zh-cn/sharepoint/install/hardware-and-software-requirements-0' target='_blank'><b><font color='blue'>SharePoint Foundation2013系統要求</b></font></a>",
              "en": "Image ID, About SharePoint Foundation2013 system requirements, see detail: <a href='https://docs.microsoft.com/en-us/sharepoint/install/hardware-and-software-requirements-0' target='_blank'><b><font color='blue'>SharePoint Foundation2013 system requirements</b></font></a>"
            }
          },
          "InstanceType": {
            "Type": "String",
            "Description": {
              "zh-cn": "填寫VSwitch可用性區域下可使用的規格;<br>通用規格:<font color='red'><b>ecs.c5.large</b></font><br>註:可用性區域可能不支援通用規格<br>規格詳見:<a href='https://help.aliyun.com/document_detail/25378.html' target='_blank'><b><font color='blue'>執行個體規格類型系列</font></a></b>",
              "en": "Fill in the specifications that can be used under the VSwitch availability zone;</b></font><br>general specifications:<font color='red'><b>ecs.c5.large</b></font><br>note: a few zones do not support general specifications<br>see detail: <a href='https://www.alibabacloud.com/help/en/doc-detail/25378.html' target='_blank'><b><font color='blue'>Instance Specification Family</font></a></b>"
            },
            "Label": {
              "zh-cn": "執行個體規格",
              "en": "Instance Type"
            },
            "AssociationProperty": "ALIYUN::ECS::Instance::InstanceType",
            "AssociationPropertyMetadata": {
              "ZoneId": "ZoneId"
            }
          },
          "Password": {
            "NoEcho": true,
            "Type": "String",
            "Description": {
              "en": "Server login password, Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).",
              "zh-cn": "伺服器登入密碼,長度為8~30個字元,必須包含三項(大寫字母、小寫字母、數字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符號)。"
            },
            "AllowedPattern": "[0-9A-Za-z\\_\\-\\&:;'<>,=%`~!@#\\(\\)\\$\\^\\*\\+\\|\\{\\}\\[\\]\\.\\?\\/]+$",
            "Label": {
              "zh-cn": "執行個體密碼",
              "en": "Instance Password"
            },
            "ConstraintDescription": {
              "en": "Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).",
              "zh-cn": "長度為8~30個字元,必須包含三項(大寫字母、小寫字母、數字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符號)。"
            },
            "MinLength": 8,
            "MaxLength": 30
          }
        },
        "Metadata": {
          "ALIYUN::ROS::Interface": {
            "ParameterGroups": [
              {
                "Parameters": [
                  "VpcCidrBlock",
                  "VSwitchCidrBlock"
                ],
                "Label": {
                  "default": "VPC"
                }
              },
              {
                "Parameters": [
                  "ZoneId",
                  "ImageId",
                  "SharePointDownloadPath",
                  "InstanceType",
                  "Password"
                ],
                "Label": {
                  "default": "ECS"
                }
              }
            ],
            "TemplateTags": [
              "acs:example:Windows應用服務:ROS_OOS建立SharePoint2013的windows執行個體"
            ]
          }
        },
        "Resources": {
          "RosWaitCondition": {
            "Type": "ALIYUN::ROS::WaitCondition",
            "Properties": {
              "Timeout": 2700,
              "Count": 2,
              "Handle": {
                "Ref": "RosWaitConditionHandle"
              }
            },
            "Metadata": {
              "ALIYUN::ROS::Designer": {
                "id": "47058b03-d345-4071-bcdb-9bc2888899be"
              }
            }
          },
          "EcsVswitch": {
            "Type": "ALIYUN::ECS::VSwitch",
            "Properties": {
              "VpcId": {
                "Ref": "EcsVpc"
              },
              "ZoneId": {
                "Ref": "ZoneId"
              },
              "CidrBlock": {
                "Ref": "VSwitchCidrBlock"
              }
            },
            "Metadata": {
              "ALIYUN::ROS::Designer": {
                "id": "3f1d6b20-25eb-4a1c-a40f-1f764b157bd6"
              }
            }
          },
          "SharePointServer": {
            "Type": "ALIYUN::ECS::Instance",
            "Properties": {
              "VpcId": {
                "Ref": "EcsVpc"
              },
              "UserData": {
                "Fn::Replace": [
                  {
                    "ros-notify": {
                      "Fn::GetAtt": [
                        "RosWaitConditionHandle",
                        "PowerShellCurlCli"
                      ]
                    }
                  },
                  {
                    "Fn::Join": [
                      "",
                      [
                        "[powershell]\r\n",
                        "New-Item -Path \"C:\\Install_dir\" -Force -type directory \r\n",
                        "$ossName = 'ros-template-resources' \r\n",
                        "$client = new-object System.Net.WebClient \r\n",
                        "$client.DownloadFile(\"",
                        {
                          "Ref": "SharePointDownloadPath"
                        },
                        "\", 'C:\\Install_dir\\SharePoint.exe') \r\n",
                        "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/AppFabric1.1-RTM-KB2671763-x64-ENU.exe\", 'C:\\Install_dir\\AppFabric1.1-RTM-KB2671763-x64-ENU.exe')\r\n",
                        "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/MicrosoftIdentityExtensions-64.msi\", 'C:\\Install_dir\\MicrosoftIdentityExtensions-64.msi')\r\n",
                        "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/setup_msipc_x64.msi\", 'C:\\Install_dir\\setup_msipc_x64.msi')\r\n",
                        "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/sqlncli.msi\", 'C:\\Install_dir\\sqlncli.msi')\r\n",
                        "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/Synchronization.msi\", 'C:\\Install_dir\\Synchronization.msi')\r\n",
                        "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/WcfDataServices.exe\", 'C:\\Install_dir\\WcfDataServices.exe')\r\n",
                        "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/Windows6.1-KB974405-x64.msu\", 'C:\\Install_dir\\Windows6.1-KB974405-x64.msu')\r\n",
                        "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/WindowsServerAppFabricSetup_x64.exe\", 'C:\\Install_dir\\WindowsServerAppFabricSetup_x64.exe')\r\n",
                        "cd C:\\Install_dir \r\n",
                        "New-Item \"install_sharepoint.bat\" -type File \r\n",
                        "Add-Content install_sharepoint.bat \"C:\" \r\n",
                        "Add-Content install_sharepoint.bat 'powershell.exe C:\\Install_dir\\Install_SharePoint.ps1' \r\n",
                        "New-Item \"Install_SharePoint.ps1\" -type File \r\n",
                        "Add-Content Install_SharePoint.ps1 'if(Test-Path \"C:\\Install_dir\\finished.log\"){' \r\n",
                        "Add-Content Install_SharePoint.ps1 \"cd C:\\Install_dir \" \r\n",
                        "Add-Content Install_SharePoint.ps1 \"}else{ \" \r\n",
                        "Add-Content Install_SharePoint.ps1 'Start-Process C:\\Install_dir\\2013\\Setup.exe -args \"/config C:\\Install_dir\\2013\\Files\\SetupSilent\\config.xml\" -Wait'\r\n",
                        "Add-Content Install_SharePoint.ps1 'cd C:\\Install_dir'\r\n",
                        "Add-Content Install_SharePoint.ps1 'New-Item \"finish.log\" -type File'\r\n",
                        "Add-Content Install_SharePoint.ps1 'Remove-Item \"C:\\Install_dir\\SharePoint.exe\"' \r\n",
                        "Add-Content Install_SharePoint.ps1 'Remove-Item \"C:\\Install_dir\\2013\\*\" -recurse' \r\n",
                        "Add-Content Install_SharePoint.ps1 'schtasks /delete /TN \"install_sharepoint\" /f'\r\n",
                        "Add-Content Install_SharePoint.ps1 'ros-notify'\r\n",
                        "Add-Content Install_SharePoint.ps1 \"}\" \r\n",
                        "Start-Process C:\\Install_dir\\SharePoint.exe  -args \"/extract:C:\\Install_dir\\2013 /quiet\" -Wait \r\n",
                        "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe -args \"/continue /unattended\" -Wait \r\n",
                        "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe  -args \"/SQLNCli:C:\\Install_dir\\sqlncli.msi /continue /unattended\" -Wait\r\n",
                        "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe  -args \"/IDFX:C:\\Install_dir\\Windows6.1-KB974405-x64.msu /continue /unattended\" -Wait\r\n",
                        "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe  -args \"/Sync:C:\\Install_dir\\Synchronization.msi /continue /unattended\" -Wait\r\n",
                        "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe -args \"/AppFabric:C:\\Install_dir\\WindowsServerAppFabricSetup_x64.exe /continue /unattended\" -Wait \r\n",
                        "Start-Process C:\\Install_dir\\MicrosoftIdentityExtensions-64.msi -args \"/quiet\" -Wait \r\n",
                        "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe -args \"/continue /unattended\" -Wait \r\n",
                        "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe -args \"/WCFDataServices:C:\\Install_dir\\WcfDataServices.exe /continue /unattended\" -Wait \r\n",
                        "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe -args \"/KB2671763:C:\\Install_dir\\AppFabric1.1-RTM-KB2671763-x64-ENU.exe /continue /unattended\" -Wait\r\n",
                        "schtasks /create /TN \"install_sharepoint\" /RU administrator /RP \"",
                        {
                          "Ref": "Password"
                        },
                        "\" /SC ONSTART /TR \"C:\\Install_dir\\install_sharepoint.bat\" \r\n",
                        "ros-notify \r\n",
                        "shutdown /r /f /t 1 \r\n"
                      ]
                    ]
                  }
                ]
              },
              "SecurityGroupId": {
                "Ref": "EcsSecurityGroup"
              },
              "VSwitchId": {
                "Ref": "EcsVswitch"
              },
              "ImageId": {
                "Ref": "ImageId"
              },
              "InstanceType": {
                "Ref": "InstanceType"
              },
              "Password": {
                "Ref": "Password"
              }
            },
            "Metadata": {
              "ALIYUN::ROS::Designer": {
                "id": "62ed3480-152b-40d3-946d-4d19c0de7530"
              }
            }
          },
          "EcsVpc": {
            "Type": "ALIYUN::ECS::VPC",
            "Properties": {
              "CidrBlock": {
                "Ref": "VpcCidrBlock"
              },
              "VpcName": "Vpc-sharepoint"
            },
            "Metadata": {
              "ALIYUN::ROS::Designer": {
                "id": "4dfdcadf-d55e-4085-af95-79d40005c3da"
              }
            }
          },
          "EcsSecurityGroup": {
            "Type": "ALIYUN::ECS::SecurityGroup",
            "Properties": {
              "SecurityGroupIngress": [
                {
                  "Priority": 1,
                  "PortRange": "3389/3389",
                  "NicType": "intranet",
                  "SourceCidrIp": "0.0.0.0/0",
                  "IpProtocol": "tcp"
                }
              ],
              "VpcId": {
                "Ref": "EcsVpc"
              }
            },
            "Metadata": {
              "ALIYUN::ROS::Designer": {
                "id": "f1c13fc6-e74d-477c-be14-9e24fd583b55"
              }
            }
          },
          "RosWaitConditionHandle": {
            "Type": "ALIYUN::ROS::WaitConditionHandle",
            "Metadata": {
              "ALIYUN::ROS::Designer": {
                "id": "d3d24118-a044-4f1d-9684-758480e50a31"
              }
            }
          }
        },
        "Outputs": {
          "InstanceId": {
            "Value": {
              "Fn::GetAtt": [
                "SharePointServer",
                "InstanceId"
              ]
            }
          },
          "PublicIp": {
            "Value": {
              "Fn::GetAtt": [
                "SharePointServer",
                "PublicIp"
              ]
            }
          },
          "SecurityGroupId": {
            "Value": {
              "Fn::GetAtt": [
                "EcsSecurityGroup",
                "SecurityGroupId"
              ]
            }
          },
          "VpcName": {
            "Value": {
              "Fn::GetAtt": [
                "EcsVpc",
                "VpcId"
              ]
            }
          }
        }
      }
  2. 配置模板。

    1. 配置模板參數頁面,填寫資源棧名稱,然後按以下要求完成各配置項。

      地區

      參數

      說明

      VPC

      專用網路網段

      選中192.168.0.0/16

      交換器網段

      填寫192.168.0.0/24

      ECS

      交換器可用性區域

      按需選擇交換器可用性區域,例如可用性區域G。

      鏡像

      建立ECS使用的鏡像ID。

      SharePoint鏡像下載路徑

      填寫sharepoint.exe的檔案URL。您可以從步驟一種擷取檔案URL。

      執行個體規格

      按需選擇執行個體規格,例如ecs.c5.large。

      執行個體密碼

      自訂ECS執行個體登入密碼。

    2. 單擊建立

      建立資源棧大約需要40分鐘。

  3. 登入ECS執行個體。

    1. 單擊已建立的資源棧。

    2. 單擊資源頁簽,單擊SharePointServerALIYUN::ECS::Instance資源ID。

      instance

    3. 在ECS管理主控台,單擊該執行個體右側的遠端連線,然後單擊Workbench遠端連線下的立即登入

  4. 體驗SharePoint。

    1. 開啟SharePoint 2013管理中心,輸入預設使用者名administrator與ECS執行個體登入密碼。

      root

  5. 在SharePoint管理網站,體驗SharePoint多種功能。

    SharePoint