All Products
Search
Document Center

Cloud Storage Gateway:Use CSG to build an IIS-hosted website

Last Updated:Sep 28, 2025

This topic describes how to build a website by using Internet Information Services (IIS) on Windows Server together with Cloud Storage Gateway (CSG).

Background information

CSG allows you to access and share data stored on Object Storage Service (OSS) by using Network-Attached Storage (NAS) or Samba. With CSG, you can enjoy the benefits of unlimited storage from OSS buckets, even without prior experience in OSS. IIS is a web server from Microsoft that can host web applications. It is favored by Windows Server users for its ease of service deployment.

Prerequisites

  1. An Alibaba Cloud account is created and real-name verification for the account is complete. For more information, see Create an Alibaba Cloud account.

    Note

    We recommend that you log on to the CSG console as a RAM user. For more information, see Use RAM to implement account-based access control.

  2. CSG is activated. If CSG is not activated, follow the on-screen instructions in the CSG console to activate CSG.

  3. A virtual private cloud (VPC) is available in the region where you want to create the file gateway. For more information, see Create a VPC with an IPv4 CIDR block.

  4. An ECS instance is created on the VPC in the region where you want to create the file gateway.

    Note

    If your on-premises host is connected to the VPC over an Express Connect circuit, you can also perform the steps by using the host.

  5. An OSS bucket is created. For more information, see Get started by using the OSS console.

    Important
    • File gateways support the following storage classes of OSS buckets: Standard, Infrequent Access (IA), and Archive. File gateways do not support OSS buckets for which back-to-origin routing is configured.

    • We recommend that you do not associate a gateway with an Archive bucket. If files that are written from a file gateway to OSS are infrequently modified, we recommend that you store the files in a Standard or IA bucket first and configure a lifecycle rule that changes the storage class of the files to Archive or Cold Archive. This reduces unnecessary restoration operations and optimizes storage costs and efficiency.

    • When a client writes a file to a file gateway, the gateway records at least two actions: writing the file and setting the file modification time. The gateway merges the two actions where possible. However, the gateway may still initiate multiple operations on the object to the bucket where the object is stored. The CopyObject operation is called to store the file modification time as a piece of metadata of the object in the bucket. If the object is an Archive or Cold Archive object, this operation requires object restoration, which takes some time to complete. This increases the time required for object uploads and even causes upload failures if not enough time is left to upload data in the cache.

Prepare CSG resources

  1. On the Gateways page of the CSG console, create a file gateway that has a Server Message Block (SMB) share. For detailed steps, see Manage a file gateway in the CSG console.

    Note

    In the Config Protocol step, select SMB for Protocol.

    2025-01-09_15-51-07

  2. On the Gateways page, click the ID of the file gateway. On the page that appears, click SMB Users > Create.

  3. In the Add SMB User dialog box, set the Username and Password.2025-01-09_16-35-50

  4. On the Shares tab, find the share and click Settings in the Actions column. The SMB Share Settings dialog box appears.

  5. Click Edit to grant read/write or read-only permissions to the SMB user.2025-01-09_17-22-08

Build an IIS-hosted website

Important

This section does not include all steps. For those unmentioned steps, keep the default settings and click Next.

  1. In the Control Panel, click Turn Windows features on or off. You can also open the Server Manager of Windows Server and use the Add Roles and Features Wizard. This topic shows how to build an IIS-hosted website on Windows Server 2022.启用和删除

  2. Click Add roles and features.添加角色和功能

  3. Select an installation type.安装类型

  4. Select the server on which you want to install the roles and features.服务器选择

  5. Select the Web Server (IIS) role from the Roles list.勾选IIS

  6. After the installation is complete, click Close.安装完成

  7. Open the Internet Information Services (IIS) Manager, right-click Sites, and choose Add Website.添加网站

  8. In the Add Website dialog box, enter a website name in the Site name field, enter the SMB mount target in the Physical path field, and click OK.添加挂载点

Mount the SMB share

  1. To allow IIS to access the mount target, add a local account on Windows.添加本地用户

  2. In the Internet Information Services (IIS) Manager, find the website and click Advanced Settings on the right side.添加物理

  3. In the Advanced Settings dialog box, click the 。。。。 icon next to the Physical Path Credentials field. In the Connect As dialog box, select Specific user and set the same user name and password as those of the SMB user, and click OK. If the user is a domain user, you can add the gateway to the Active Directory domain instead of separately creating a user.特定

  4. Open File Explorer. Select This PC from the left pane. Then, on the Computer tab, select Map network drive.

  5. In the Map Network Drive dialog box, enter the SMB mount target in the Folder field, select Connect using different credentials.映射

  6. Click Finish. In the dialog box that appears, enter the name and password of the SMB user to complete the mount operation. If the system fails to map the network drive, run the following command in Command Prompt:

    REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters /f /v AllowInsecureGuestAuth /t REG_DWORD /d 1

Access the IIS-hosted website

  1. In the mapped network drive, create an HTML file named hello.html:

    <!DOCTYPE html>
    <html>
      <head>
        <title>This is a title</title>
      </head>
      <body>
        <p>Hello world!</p>
      </body>
    </html>
  2. After IIS is started, enter 127.0.0.1/hello.html in the address bar of a browser. The website is accessible.访问服务