溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

google cloud storage托管靜態(tài)頁面

發(fā)布時間:2020-06-18 14:32:11 來源:網(wǎng)絡 閱讀:630 作者:jonson_jackson 欄目:開發(fā)技術

初始步驟

1、 域名

2、 google Cloud create project. the project name must match the domain name

3、cname

1
2
NAME                  TYPE     DATA
www.example.com       CNAME    c.storage.googleapis.com.

Google Cloud SDK

oogle Cloud SDK 是一套工具,您可以使用這套工具來管理托管在 Google Cloud Platform 上的資源和應用。其中包括 gcloud、gsutil 和 bq 命令行工具。install

gsutil 工具

設置所有文件的權限可見

1
gsutil acl -r ch -u AllUsers:R gs://www.dreamerjonson.com/*

刪除文件:

-r遞歸遍歷所有

1
gsutil rm -r  gs://www.dreamerjonson.com/.git/

上傳單個文件

1
gsutil cp test.js gs://www.dreamerjonson.com

上傳文件夾下所有文件

1
gsutil cp -r ./ gs://www.dreamerjonson.com

增量同步

-m多線程 -d 刪除不匹配的文件 -r遞歸

1
gsutil -m  rsync -d -r ./ gs://www.dreamerjonson.com

設置 MainPageSuffix 和 NotFoundPage

在以下示例中,MainPageSuffix 被設置為 index.html,NotFoundPage 被設置為 404.html:

1
gsutil web set -m index.html -e 404.html gs://www.example.com

更新默認上傳權限

1
gsutil defacl ch -u AllUsers:R gs://www.dreamerjonson.com

參考資料

  • google domains help

  • storage托管靜態(tài)頁面

  • gsutil使用

  • gsutil快速入門

  • gsutil defacl

  • 本文鏈接: https://dreamerjonson.com/2018/11/03/google-cloud-storage托管靜態(tài)頁面/

  • 版權聲明: 本博客所有文章除特別聲明外,均采用 CC BY 4.0 CN協(xié)議 許可協(xié)議。轉(zhuǎn)載請注明出處!

google cloud storage托管靜態(tài)頁面

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內(nèi)容。

AI